@devries-cameron20 / t3code Mirror · read-only / commits / da0792efb1
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 23, 05:30 UTC

perf(web): toggling a client setting no longer re-renders every settings row (#20830)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Julius Marminge committed Oct 17, 2026 at 02:01 UTC da0792efb1974df29b0949abb0b7e6479210a9c1
1 file changed +10 -3
apps/web/src/components/settings/useSettingsProjectGroups.ts
+10 -3
@@ -1,18 +1,25 @@
1 import { useClientSettings } from "../../hooks/useSettings";
2 -import { selectProjectGroupingSettings } from "../../logicalProject";
2 import { buildSidebarProjectSnapshots } from "../../sidebarProjectGrouping";
3 import { useEnvironments, usePrimaryEnvironmentId } from "../../state/environments";
4 import { useProjects } from "../../state/entities";
5
6 export function useSettingsProjectGroups() {
7 const projects = useProjects();
9 - const settings = useClientSettings(selectProjectGroupingSettings);
8 + // Read the grouping fields one by one: a selector that builds an object hands back a new
9 + // identity on every client settings write, which rebuilds every group and, through the
10 + // settings scope, re-renders every settings row.
11 + const sidebarProjectGroupingMode = useClientSettings(
12 + (settings) => settings.sidebarProjectGroupingMode,
13 + );
14 + const sidebarProjectGroupingOverrides = useClientSettings(
15 + (settings) => settings.sidebarProjectGroupingOverrides,
16 + );
17 const primaryEnvironmentId = usePrimaryEnvironmentId();
18 const { environments } = useEnvironments();
19 const labels = new Map(environments.map((entry) => [entry.environmentId, entry.label]));
20 return buildSidebarProjectSnapshots({
21 projects,
15 - settings,
22 + settings: { sidebarProjectGroupingMode, sidebarProjectGroupingOverrides },
23 primaryEnvironmentId,
24 resolveEnvironmentLabel: (id) => labels.get(id) ?? null,
25 }).sort((a, b) => a.displayName.localeCompare(b.displayName));