Repository navigation
perf: preserve matching Accounts settings sections during search - #23192
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughAccountsPane now delegates section rendering and separators to SettingsSectionStack. New tests cover section identity and provider call counts across search, refresh, usage updates, hiding, reopening, and unmounting. A reliability-gate record defines the section-lifetime invariant and documents test evidence and coverage gaps. Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to The Accounts sections retain stable identity across filtering, with no identified issue blocking merge after normal checks. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 2 systems. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 3 files. (1 skipped: 1 unsupported.)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
This review covered the full diff of PR #23192 at 844f7c15.
- Stable section keys in
AccountsPane— the outer wrapper now keys onsection.keyrather than the array index, so filtering out an earlier search result no longer remounts later sections;filter(Boolean)becomes a null-narrowingfilter. Every section element carries a unique explicit key (account-runtime,claude-accounts,codex-accounts,gemini,opencode-go,minimax,grok,cursor), so identity is preserved exactly when it should be. - Regression suite
AccountsPane.section-lifetime.test.tsx— 10 cases pinning Grok/Cursor status reads and the Codex login subscription across matching-search rerenders, plus controls for explicit refresh, usage-driven refresh, and genuine removal/unmount. - Reliability gate
settings.accounts-section-lifetime— experimental/partial manifest entry wiring the new suite into the gate set.
I reproduced the red/green boundary independently: reverting the wrapper to key={index} fails 7 of the 10 new cases (Grok 4/6 reads, Cursor 4, Codex 4 reads plus re-subscribe) while 3 controls pass, matching the PR's evidence exactly; with the change it is 10/10. The existing AccountsPane.test.tsx (9 tests) still passes, check-reliability-gates reports 127 gates with no failures, and oxlint is clean on both changed renderer files.
The intentionally dropped incidental search-driven refresh is called out in the PR body and knownGaps; explicit refresh, usage-timestamp refresh, pushed login URLs, and true hide/reopen/removal all remain, so the freshness trade-off is deliberate and contained. Nothing blocking.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
This incremental review covered the delta since the prior Pullfrog review at 844f7c15 — the new shared section wrapper and the corresponding test/gate updates.
- Extracted
SettingsSectionStack—AccountsPanenow delegates itsvisibleSectionsrender to a new shared component that keys each child on the section element's ownkeyrather than the array index, filters nulls internally, and takes the pane spacing via aspacingprop (group=space-y-8). Behavior is identical to the inline wrapper it replaced: same DOM nesting, same separator placement, same stable keys. - Hardened the regression assertions — the exact one-read counts became post-mount count capture plus DOM-node identity (
toBe(mountedHeading)) and non-growing counts, so the suite pins section identity rather than a magic number. - Updated the
settings.accounts-section-lifetimegate — oracle/evidence text now describes node identity and the shared component.
I independently confirmed the refined suite still fails on the defect: temporarily reverting SettingsSectionStack to key={index} produces exactly 7 failures (2 Grok, 2 Codex, 1 Codex subscription, 2 Cursor) with the 3 refresh/removal controls green, matching the PR's evidence. pnpm tc:web and oxlint on all three changed TS/TSX files are clean.
ℹ️ The same remount pattern still lives in three other settings panes
SettingsSectionStack now documents the key={index} remount hazard, but only AccountsPane was migrated. GeneralPane.tsx:287, TerminalPane.tsx:291, and RepositoryPane.tsx:420 still key their searchable section lists on the array index, so a matching search there still tears down and remounts surviving sections. This is a scope observation, not a defect in this PR — those panes are deliberate follow-ups.
Technical details
# Remaining `key={index}` section lists
## Affected sites
- `src/renderer/src/components/settings/GeneralPane.tsx:287` — `space-y-6` map; sections carry keys (`navigation`, `workspace`, `project-runtime`, `editor`, `cli`, `updates`).
- `src/renderer/src/components/settings/TerminalPane.tsx:291` — `space-y-6` map; sections carry keys (`default-shell`, `windows-shell`, `rendering`, `pane-interaction`, `setup-script`, `manage-sessions`, `advanced`).
- `src/renderer/src/components/settings/RepositoryPane.tsx:420` — `space-y-8` map; sections carry keys (`hooks`, `identity`, `source-control-ai`, `symlinks`, `sparse-presets`, `mcp-configs`).
## Required outcome
- None for this PR. When those panes are migrated, they are drop-in: every section element already carries a unique key, so `<SettingsSectionStack sections={...} spacing="section" | "group" />` preserves identity without further changes. `GeneralPane` must keep its `Support` section outside the stack (it owns its own collapsing separator), which the fragment-returning component already allows.
## Open questions for the human (optional)
- Is migrating the remaining panes planned, or is `SettingsSectionStack` intended to stay Accounts-only while other panes keep their inline maps?DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
fb40837 to
92b15ee
Compare
…tionStack Replaces the pane-local index-keyed wrapper with the shared SettingsSectionStack so the search-stable identity rule lives in one place, and restates the read/subscription-count oracles as node identity plus non-growing counts so a future freshness fix cannot read as a regression. Applied on the branch head; the rebase onto main is still outstanding.
92b15ee to
e248bfc
Compare

ELI5
Typing in Accounts search keeps a matching section open, so it no longer flashes Loading or repeatedly reconnects its sign-in updates.
What Changed
The outer wrapper uses each section's existing stable key. Previously, filtering an earlier section changed later wrapper positions and remounted their contents. This includes the Cursor section added on current
main.Counts use actual components with synthetic API/store boundaries. They measure renderer admissions, not provider latency or whole-app speed.
Why
Keeping component identity removes redundant mount work without adding a cache or timer. Adding a cache would introduce another invalidation policy. This intentionally changes state lifetime and is a separate trade-off PR.
Linked Issue
N/A — PR only, as requested by the maintainer.
Visual Proof
Hidden Electron comparison using actual Accounts/Grok components, synthetic status and inert other sections. Repeated reads are held to expose Loading. These screenshots compare the original audit baseline; the upstream Cursor addition is covered separately by current-main tests.
Both sides initially loaded:
Matching
g→gr: original reloads; candidate retains status:Actual hide/reopen: both reload:
Testing
ORCA_BACKGROUND_LAUNCH=1 pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/settings/AccountsPane.section-lifetime.test.tsx: 10 pass on current main; original main 7 fail / 3 controls pass. Genuine removal, subscription cleanup, explicit actions and usage-driven refresh are covered with Windows account support enabled/disabled.Web typecheck, scoped lint/format and the 127-entry isolated reliability manifest pass. The shared checkout's changed-code quality gate passes across 198 files. Native Linux/Windows, live SSH/WSL/providers and a packaged whole-app run remain untested. The gate starts experimental without CI soak history.
AI Disclosure
Review
Independent source/lifetime review approved. It checked upstream Cursor preservation, status and login owners, subscription cleanup and clipboard-feedback timers. Merge risk: low to moderate, because the production change is two lines but intentionally retains state longer.
Agent skill upstream boundary
Notes
Negative user-facing trade-offs: matching search no longer incidentally refreshes Grok/Cursor status or pending Codex login URLs. Child drafts, errors, copied feedback and timers persist until their own transition or genuine removal. Explicit refresh, usage timestamps, pushed login URLs and true hide/reopen remain; no automatic freshness deadline is added. Cursor's explicit refresh still depends on a changed usage timestamp, as on main.
No account mutation, credential policy, path, shortcut, execution-host routing or wire change. Existing remote/folder workspace ownership policies remain in force.
Checklist