You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Highlight the active committed file in Source Control - #36301
Opening a file under Committed on Branch showed its diff but left its Source Control row unmarked, making it hard to keep your place during review. The active-file adapter handled only pending-change row keys, and committed rows lacked the current-row styling.
Committed rows now highlight the active file in both list and tree views through the same active-tab-to-row-key mapping used by pending changes. An older comparison tab does not mark a current same-path row: its base reference and comparison version must match the published summary. Both row components share the existing current-row style.
Tracked in STA-12791; tracked in #35905. Credit to simon-caignart and #35915 for the report, diagnosis and regression scenario.
Plan
Extend the existing SCM adapter rather than introduce a separate branch-active path. Keep pending bulk selection independent, reuse the existing comparison-version derivation, and give both row components one current-row style. The opening routes remain intact, preserving the earlier HTML preview rollback and its ownership/access boundaries. One renderer PR, with no saved fields, migration or wire change.
The single comparison-identity validation point is signature-time, in buildActiveOpenFileSignature: it checks the active tab snapshot against the published summary before returning a branch signature. buildActiveOpenRowKeys maps the resulting signature and filters displayed keys; neither it nor the row components repeat the snapshot comparison. Branch list keys now match the existing tree key format; the old single-colon list keys were renderer/virtualizer keys only.
Monaco needs no changes: the correct diff already opens, and the selected editor tab already contains the resource and comparison identity. The missing behavior belongs to the Source Control adapter and row presentation.
Intended differences from the common pattern
Intended: preserve the existing passive current-file accent independently of bulk selection and focus, extending the pending-row indication requested in [Bug]: Committed on Branch rows don't highlight the file whose diff is open #35905. The common pattern uses setting-gated reveal/selection/focus, so importing it wholesale would give a different interaction and no indication when disabled. Pending rows already expose this separate current-file relation; this fix preserves it without adding reveal behavior or a setting.
Intended: preserve the existing passive relation for staging sides and immutable committed snapshots. open-history-diff.ts creates distinct tabs by workspace/base/version/path, and useEditorPanelDiffContentLoader.ts loads their stored comparison OIDs. Two same-path tabs can therefore show different content, while the displayed branch row represents one comparison. The common primary-resource lookup has no equivalent committed comparison group/predicate, and generic path/group precedence cannot preserve that relation. The existing staged/working-tree mapping and plain-editor fallback also remain intact.
Folder workspaces continue to skip branch comparison, including Git-containing folders; the test covers no branch summary/row. Remote worktrees use existing workspace-scoped tab and summary data without filesystem or host calls.
The match is against the published rendered summary. Existing upstream summary equality omits mergeBase/baseRef, so this PR does not claim to make every incoming summary change observable or modify that separate mechanism.
Review classification
Full path.
Size: 77 changed production lines across 8 production files; the light path's file-count criterion fails. Tests: 367 changed lines across 3 existing files.
Risky areas: renderer derivation and presentation only; no saved state, ownership, lifecycle, ordering, wire, process, auth or default changes.
Local effect: one Source Control current-file behavior, shared by list/tree and pending/committed rows.
Validation
49 focused tests across five named Vitest files passed through tc-gate: SCM signature/renderer checks, branch snapshot/layout consumers, and the production-hook operation contract at 100 and 1,000 files. The contract separately counts projection and Set ingestion and verifies zero availability rebuilds for unrelated updates while real current-file changes still render.
Full review completed in two behavioral rounds with no open findings. The review added the missing scaling contract; CI then identified an erased test-iterator type annotation, corrected in e8ee9543313. Production code remained unchanged through both repairs.
Branch screenshot run on 348629e689b: real committed row clicks opened Monaco diffs and highlighted the correct row in list/tree; pending-row separation, retained-tab return and non-editor clearing passed. Light/dark screenshots are attached in the review status comment. No baseline app or agent run was required for this renderer-only tests-row flow. The later e8ee9543313 commit is test-only and preserves that screenshot evidence.
The renderer fixture asserts click/open arguments and modeled-tab presentation; the screenshot run separately exercised real opening and subscription delivery. Folder exclusion, stale/missing identity, separator paths and existing pending-side/editor fallback have targeted coverage. No broad remote/mobile/restart/upgrade run is claimed.
One main sync before final validation; no conflicts or changes to the reviewed SCM files. Normal commit hooks, the required main-merge lint-staged check, changed-file formatting and git diff checks passed. Final-head CI passed static analysis/typecheck, all 12 unit shards, both package jobs and the aggregate gate (run).
Branch comparison data now determines whether an open branch diff matches a branch row. Visible branch rows participate in active-row matching in list and tree modes. Matching rows receive persistent highlight styling, and tests cover comparison mismatches and other tab, worktree, and repository conditions.
Priority: Low
Merge Risk: Minimal · up to 39b7b
Committed-row highlighting has no identified merge-blocking issue. A mounted-store regression test is recommended.
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 28.57% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta…
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 4 passed
Check name
Status
Explanation
Title check
The title clearly and concisely describes the main change: highlighting the active committed file in Source Control.
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Description check
The description is detailed, on-topic, and covers the user impact, implementation, rationale, linked issue references, visual evidence, testing, review scope, risks, and validation results. It does no…
Full details: Description check
Explanation
The description is detailed, on-topic, and covers the user impact, implementation, rationale, linked issue references, visual evidence, testing, review scope, risks, and validation results. It does not use the template headings consistently and does not include an explicit Fixes # entry, but the required information is otherwise substantially present.
Full details: Docstring Coverage
Explanation
Docstring coverage is 28.57% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 7 functions across 10 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Finishing Touches: 💡 1
📝 Generate docstrings: 💡
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
Add a mounted-store regression test for committed-row highlighting.
The current test mocks openBranchDiff, then injects the expected tab state and remounts SourceControl. It does not detect a regression where the click opens the tab but the mounted listing misses the active-tab update.
The real openBranchDiff action updates openFiles, activeFileIdByWorktree, and activeTabTypeByWorktree. Add a focused test that uses a subscription-capable store, keeps SourceControl mounted, clicks a committed row, and asserts that the row becomes highlighted after that update.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.
Opening a file in Committed on Branch displayed the correct comparison but left its Source Control row unmarked. The adapter only mapped pending-change rows, and the committed-row component had no current-file presentation.
The active editor now marks its matching committed row in list and tree views using the same adapter and accent as pending rows. It checks the tab’s comparison against the displayed summary, so an older same-path comparison does not mark a newer row. Monaco and file-opening behavior are unchanged.
Review: full path, two behavioral rounds plus the CI type-only correction; correctness and architecture checks accepted the selected mechanism. The one review finding was missing operation-count coverage for the new row traversal; 106b63900fe adds the production-hook contract. CI also caught an iterator-completion type annotation in that test; e8ee9543313 corrects it without changing emitted JavaScript. No open findings or deferrals.
Verified: 49 focused tests across five named files through tc-gate, including the production-hook contract at 100 and 1,000 files and existing editor snapshot/layout consumers. CI passes on e8ee95433138ec70531e6086bcc760299287d728 (completed run). The screenshot run reached the committed rows through Source Control, opened their actual diffs, and verified list/tree current-row presentation and pending-row separation. No agent run was needed for this renderer-only tests-row flow.
Screenshot source is 348629e689bd3c039e929e34d9db0f214d20ec35, the single final main-merge head. The only later commit, e8ee9543313, changes the test-only type annotation described above; its 11 focused tests and normal hook passed, and the screenshot evidence carries across it. No screenshot run was repeated.
The comparison is against the published rendered summary; upstream summary publication/equality remains outside this change.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Opening a file under Committed on Branch showed its diff but left its Source Control row unmarked, making it hard to keep your place during review. The active-file adapter handled only pending-change row keys, and committed rows lacked the current-row styling.
Committed rows now highlight the active file in both list and tree views through the same active-tab-to-row-key mapping used by pending changes. An older comparison tab does not mark a current same-path row: its base reference and comparison version must match the published summary. Both row components share the existing current-row style.
Tracked in STA-12791; tracked in #35905. Credit to
simon-caignartand #35915 for the report, diagnosis and regression scenario.Plan
Extend the existing SCM adapter rather than introduce a separate branch-active path. Keep pending bulk selection independent, reuse the existing comparison-version derivation, and give both row components one current-row style. The opening routes remain intact, preserving the earlier HTML preview rollback and its ownership/access boundaries. One renderer PR, with no saved fields, migration or wire change.
The single comparison-identity validation point is signature-time, in
buildActiveOpenFileSignature: it checks the active tab snapshot against the published summary before returning a branch signature.buildActiveOpenRowKeysmaps the resulting signature and filters displayed keys; neither it nor the row components repeat the snapshot comparison. Branch list keys now match the existing tree key format; the old single-colon list keys were renderer/virtualizer keys only.Monaco needs no changes: the correct diff already opens, and the selected editor tab already contains the resource and comparison identity. The missing behavior belongs to the Source Control adapter and row presentation.
Intended differences from the common pattern
open-history-diff.tscreates distinct tabs by workspace/base/version/path, anduseEditorPanelDiffContentLoader.tsloads their stored comparison OIDs. Two same-path tabs can therefore show different content, while the displayed branch row represents one comparison. The common primary-resource lookup has no equivalent committed comparison group/predicate, and generic path/group precedence cannot preserve that relation. The existing staged/working-tree mapping and plain-editor fallback also remain intact.Folder workspaces continue to skip branch comparison, including Git-containing folders; the test covers no branch summary/row. Remote worktrees use existing workspace-scoped tab and summary data without filesystem or host calls.
The match is against the published rendered summary. Existing upstream summary equality omits
mergeBase/baseRef, so this PR does not claim to make every incoming summary change observable or modify that separate mechanism.Review classification
Full path.
Validation
e8ee9543313. Production code remained unchanged through both repairs.348629e689b: real committed row clicks opened Monaco diffs and highlighted the correct row in list/tree; pending-row separation, retained-tab return and non-editor clearing passed. Light/dark screenshots are attached in the review status comment. No baseline app or agent run was required for this renderer-only tests-row flow. The latere8ee9543313commit is test-only and preserves that screenshot evidence.