Repository navigation
fix(editor): keep conflict navigation in its owning pane - #34902
Conversation
babf3bf to
78bd885
Compare
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 7 minutes. View limit details
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 |
[Medium impact] The PR appears safe to merge, with a non-blocking test gap remaining from the previous review. Findings
SummaryConflict navigation now names the file and pane that requested it.
|
| const ownOverview = render(store, review, 'disk', { | ||
| pendingEditorReveal: { ...reveal, viewStateId: 'panel-1:overview:file.ts' } | ||
| }) | ||
| expect(ownOverview.revealLine).toBe(9) |
There was a problem hiding this comment.
Tests miss the pane identifier
The new tests check revealLine but never check the viewStateId passed to MonacoEditor. Removing that prop would leave both tests passing, while the real editor would reject the targeted reveal because its own viewStateId would not match. Assert the editor's viewStateId in both cases so the tests protect the full fix.
Conflict Next/Previous published a path-only reveal, so every editable pane showing that file jumped, and overview mirrors never moved. Target the reveal at the requesting file id and pane view id, and let read-only overview mirrors accept only reveals that name them.
78bd885 to
6a412d4
Compare
Problem
Conflict Next/Previous navigation published a reveal with only
filePath. Editors filter reveals by pane only whenviewStateIdis set, so:Fix
useEditorConflictNavigationnow includes the file'sfileIdand the requesting pane'sviewStateIdin the reveal. Both fields already exist onPendingEditorReveal.EditorEditFileSurfaceandEditorConflictReviewSurfacepass their pane id to the hook. The review surface also passesviewStateIdtoMonacoEditor.<scope>:<suffix>) and accepts only reveals that name that id. Untargeted reveals, such as those from search, still reach editable editors as before.The change is renderer-only, with no IPC or protocol change.
Test
EditorConflictReviewSurface.live-record.test.tsx: an overview applies a reveal aimed at it and rejects one aimed at another pane, and the selected review editor is scoped the same way. Both cases fail without the fix.pnpm check:changed --maxWorkers=2passes.