Skip to content

fix(editor): keep conflict navigation in its owning pane - #34902

Merged
OrcaWin merged 1 commit into
mainfrom
OrcaWin/editor-conflict-reveal
Oct 29, 2026
Merged

OrcaWin merged 1 commit into
mainfrom
OrcaWin/editor-conflict-reveal

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​42 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​41
Prod 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​31 $\color{#cf222e}{\Huge{\mathbf{−}}}$​10 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​21

Problem

Conflict Next/Previous navigation published a reveal with only filePath. Editors filter reveals by pane only when viewStateId is set, so:

  • With the same conflicted file open in two split panes, navigating in one pane also moved the other.
  • Read-only conflict-review overview mirrors ignored every reveal. Their banner buttons never moved the mirror. Instead they moved another editable pane showing that path, or left a pending reveal that fired later when the file was opened.

Fix

  • useEditorConflictNavigation now includes the file's fileId and the requesting pane's viewStateId in the reveal. Both fields already exist on PendingEditorReveal.
  • EditorEditFileSurface and EditorConflictReviewSurface pass their pane id to the hook. The review surface also passes viewStateId to MonacoEditor.
  • Each read-only overview mirror gets its own id (<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

  • Two cases added to 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=2 passes.

@OrcaWin
OrcaWin force-pushed the OrcaWin/editor-conflict-reveal branch from babf3bf to 78bd885 Compare October 28, 2026 23:22
@OrcaWin
OrcaWin marked this pull request as ready for review October 29, 2026 00:08
@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 70779f27-4495-4994-a43a-3a1e3c92ff66
Commits

Reviewing files that changed from the base of the PR and between b2feed0 and 6a412d4.

Files selected for processing: 4
  • src/renderer/src/components/editor/EditorConflictReviewSurface.live-record.test.tsx
  • src/renderer/src/components/editor/EditorConflictReviewSurface.tsx
  • src/renderer/src/components/editor/EditorEditFileSurface.tsx
  • src/renderer/src/components/editor/useEditorConflictNavigation.ts
  • 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.

❤️ Share

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

@greptile-apps

greptile-apps Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge, with a non-blocking test gap remaining from the previous review.

Findings

  1. P2 Tests miss the pane identifier ▶

Summary

Conflict navigation now names the file and pane that requested it.

  • Conflict navigation moves only the editor pane whose banner was clicked.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Conflict banner] --> B[Reveal with file and pane IDs]
  B --> C{Matching editor?}
  C -->|Yes| D[Reveal conflict and clear request]
  C -->|No| E[Leave editor unchanged]
Loading

Reviews (2) · Last reviewed commit: "fix(editor): keep conflict navigation in..." · Reviewed by Greptile

const ownOverview = render(store, review, 'disk', {
pendingEditorReveal: { ...reveal, viewStateId: 'panel-1:overview:file.ts' }
})
expect(ownOverview.revealLine).toBe(9)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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.
@OrcaWin
OrcaWin force-pushed the OrcaWin/editor-conflict-reveal branch from 78bd885 to 6a412d4 Compare October 29, 2026 00:27
@OrcaWin
OrcaWin merged commit 53cbc49 into main Oct 29, 2026
39 of 41 checks passed
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