Skip to content

perf(renderer): scope folder review cache projections - #8136

Merged
nwparker merged 2 commits into
mainfrom
nwparker/renderer-perf-18
Jul 11, 2026
Merged

nwparker merged 2 commits into
mainfrom
nwparker/renderer-perf-18

Conversation

@nwparker

@nwparker nwparker commented Jul 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The visible folder-workspace PR Checks panel subscribed to the entire hosted-review, PR, and checks cache maps. Any background provider refresh therefore rebuilt every attached worktree row even when none of the changed entries belonged to that folder.

This change keeps the existing provider-aware projection builder and runs it behind a selector that records the exact cache keys it reads. Later store writes reuse the same projection unless one of those entry references changes. Missing relevant keys are recorded as undefined, so a later insertion still rebuilds immediately.

Performance evidence

Fixture: 100 attached worktrees, followed by 200 unrelated writes to each of the three review caches.

Exact-branch Electron validation used an isolated disposable profile and the real folder PR Checks surface:

  • Confirmed app identity was renderer-perf-2 @ nwparker/renderer-perf-18
  • Rendered 100 attached rows in the visible Review checks panel
  • First 600 unrelated cache writes produced 0 panel DOM mutations and retained the same first-row DOM node
  • Inserting the relevant entry produced 6 targeted mutations and visibly rendered Improve terminal font rendering, per-pane zoom, and UI zoom #7, OPEN, and Relevant review inserted
  • A second 600 unrelated writes produced 0 panel DOM mutations and retained the updated row
  • Clicking the real row expanded its No checks configured details

Correctness

  • The existing projection builder and cache-key generation remain unchanged.
  • Hosted-review fallback, GitHub PR fallback, checks-with-head, and checks-without-head reads are tracked lazily.
  • The selector is recreated when attached worktrees, repos, settings, or local refresh outcomes change.
  • SSH/runtime host scoping and GitLab/other provider behavior stay behind the existing review-cache identity and projection code.

Validation

  • 20 focused selector/projection tests passed
  • Entire right-sidebar suite: 142 files / 1,199 tests passed
  • pnpm typecheck passed
  • Targeted Oxlint, React Doctor, formatting, reliability gates, max-lines ratchet, and diff checks passed
  • Full pnpm lint passes all code/reliability/max-lines gates, then stops at the unchanged mainline Japanese interpolation mismatch for components.native-chat.composer.uploadingAttachments
  • Exact-branch visible Electron validation passed as described above

ELI5

The folder review panel used to rebuild all of its rows whenever any review cache changed anywhere in Orca. It now tracks only the review and check entries those rows actually use.

@coderabbitai

coderabbitai Bot commented Jul 10, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The parent PR checks panel now obtains its projection through createParentPrChecksProjectionSelector. The selector tracks accessed entries in hosted review, PR, and checks caches, reuses the previous projection when those entries remain unchanged, and rebuilds when a relevant value changes. Tests cover scoped memoization, relevant cache-entry insertion, projection reference changes, and updated review labels.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is detailed, but it omits required template sections like Screenshots, AI Review Report, Security Audit, and Notes. Add the missing template sections, including screenshots or 'No visual change', an AI review report, a security audit summary, and notes.
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title is concise and accurately summarizes the main change: scoping folder review cache projections.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nwparker
nwparker merged commit a4fb828 into main Jul 11, 2026
2 checks passed
@nwparker
nwparker deleted the nwparker/renderer-perf-18 branch July 11, 2026 03:52
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
* perf(renderer): scope folder review cache projections

* fix(renderer): keep checks selector notifications constant-time
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant