Repository navigation
fix(editor): apply Rich mode to the source tab opened from a diff - #34898
Merged
Merged
Conversation
OrcaWin
force-pushed
the
OrcaWin/editor-diff-rich-selection
branch
from
October 28, 2026 23:21
f89fd97 to
f29a0d8
Compare
OrcaWin
marked this pull request as ready for review
October 29, 2026 00:08
Contributor
|
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 |
[Low impact] The PR appears safe to merge. SummaryApplies Rich mode to the source tab returned by
Reviews (2) · Last reviewed commit: "fix(editor): apply diff Rich mode to the..." · Reviewed by Greptile |
handleOpenDiffTargetFile keyed editor/markdown view-mode preferences by the raw file path, but openFile returns owner-scoped IDs for remote runtime files and same-path tabs in other worktrees, so Rich mode was lost or written onto another owner's tab.
OrcaWin
force-pushed
the
OrcaWin/editor-diff-rich-selection
branch
from
October 29, 2026 00:27
f29a0d8 to
9b39b96
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
Clicking Rich Editor from a Markdown diff calls
openFilefor the source file, then sets the editor and Markdown view-mode preferences keyed byactiveFile.filePath.openFilereturns the actual tab ID, and that ID is owner-scoped for remote runtime/SSH files, for the same path open in another worktree, and for restored scoped tabs. In those cases:Fix
Use the file ID returned by
openFilewhen callingsetEditorViewModeandsetMarkdownViewMode. If the existing tab's ID is the bare path, the returned ID is that same path, so behavior there does not change.Tests
EditorPanel.diff-rich-owner.test.tsxuses the real store and realopenFileID resolution:Both cases fail on
main.pnpm check:changedpasses.