# refactor\(web\): the background activity setting and its dialog live in their own file · PR \#22669 · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/pull/22669)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

State: merged

Source repository: pingdotgg/t3code

Source branch: refactor/settings-split-background-activity

Target branch: refactor/settings-split-appearance

Head commit: 383fa630bb722838040c1997825f354ceb44f790

[Discussion and reviews](https://git.cafe/pingdotgg/t3code/pull/22669)

[Commits](https://git.cafe/pingdotgg/t3code/pull/22669/commits?format=markdown)

[Files changed](https://git.cafe/pingdotgg/t3code/pull/22669/diffs?format=markdown)

## Description

---

Moves the background activity row, its advanced dialog, and its constants into `BackgroundActivitySettings.tsx`. The row is now a `BackgroundActivitySettingsRow` component that owns the dialog's open state. Before, that state lived in `GeneralSettingsPanel`, so opening or closing the dialog re-rendered the whole General page; now only the row re-renders.

| File | Before | After |
|---|---|---|
| SettingsPanels.tsx | 2413 | 1952 |
| BackgroundActivitySettings.tsx | - | 487 |

Renders. Measured with `~/.cache/cvlayers/rc-init.js` (counts only the fibers React rendered) on a dev server seeded by `vp run migrate-dev-db`, driven by agent-browser. Main is `6a6c84f990`; after is the stack top, `1da6ebacee`. Each cell is the median of 3 runs, shown as React commits / component renders. The Connections layers above this one don't touch the General page, so these numbers are this layer's effect.

| Interaction | main | after |
|---|---|---|
| open General | 9 / 942 | 9 / 943 |
| toggle a setting (Rich text composer) | 1 / 103 | 1 / 104 |
| background activity dialog open + close | 39 / 441 | 39 / 385 |

Opening and closing the dialog drops 56 renders (441 to 385): only `BackgroundActivitySettingsRow` re-renders, not all of `GeneralSettingsPanel`. Opening the page and toggling a setting each cost 1 extra render, for the new row component.

Tests run: `tsc-rs --noEmit` for apps/web, `vp lint` on changed files, `vp test run src/reactCompilerCoverage.test.ts -t settings/` (0 bailouts), `SettingsPanels.logic.test.ts`, `ConnectionsSettings.logic.test.ts`.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

