Repository navigation
Conversation
…ooleans Subscribe sidebar thread row hooks to per-environment boolean atoms instead of the whole server-config map so unrelated server-config updates do not re-render every sidebar row.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
Thanks for this. #40048 makes the same change and is the one being kept. #40048 makes the same per-environment boolean subscription change with a smaller patch and includes measurements on the Windows platform requested by the issue. That platform evidence is the deciding difference. Your render-isolation regression test adds useful coverage for unrelated updates and real capability changes. It would be worth carrying that coverage into the kept change. Closing as a duplicate. |
|
That makes sense. I'll start on another issue you posted and get that one done. |
Problem
On load or reconnect, each sidebar thread row re-renders every time the server-config Map is replaced, which happens twice during startup. Each row only needs one boolean per environment (config loaded, issues capability), and those don't change. At 300 threads that is 600 wasted row renders per load.
Change
useSupportsMultiplePullRequestsanduseSidebarLinkedIssueStatenow read per-environment boolean atoms (useEnvironmentServerConfigLoaded,useEnvironmentSupportsIssues) derived fromserverConfigsAtom, instead of subscribing to the whole Map. Rows still re-render when an environment's config presence or issues capability actually changes. Rows without linked issues don't subscribe to the issues atom at all.Scope
Fixes #39934
The separate
providerEntryByInstanceIdrow passes (#39933) are intentionally left out.Verification
Setup: Linux x86_64, Node v26.13.1, production
apps/webbuild served byapps/server, isolated home,T3CODE_DEV_SEED=0,TZ=UTC, 10 projects x 30 finisheddevReplaythreads = 300 threads.Steps: an AI agent ran the issue's probe script, 10 loads each on base
2770bf3c61and candidate08fd6f8d3f.2770bf3c6108fd6f8d3frowRendershook59:Map(1)longTaskMsmedianmount: 300,props:providerEntryByInstanceId: 600,props:sortable: 300,hook52:Array: 300andhook76:Object: 13are unchanged. One load from each log, unedited:Base
2770bf3c61:Candidate
08fd6f8d3f:Regression test: a new case in
Sidebar.browser.test.tsx(sidebar render isolation) checks that unrelated config updates leave both hooks quiet and that real capability or config changes still re-render them. It fails on base (expected "vi.fn()" to be called 1 times, but got 2 times) and passes on the candidate. Test delta is quiet (+1 test, no new files).Gates: an AI agent ran
vp run check:changed 2770bf3c61on Node v26.13.1: format, lint (0 warnings, 0 errors), knip, typecheck (2 packages), 5 test files / 25 tests and the React compiler check all passed.Links: #39934
Not shown: Windows Server 2025 was not measured; only Linux x86_64 ran.
Generated with Claude Opus 5.5 in T3 Code Nightly