feat(source-control): add hover button to open a changed file for editing#920
feat(source-control): add hover button to open a changed file for editing#920wang-mingxue wants to merge 1 commit into
Conversation
…ting Clicking a changed file in the Source Control panel opens the read-only diff. Opening the editable file was only reachable through the right-click "Open File" context menu item, which is easy to miss. Surface it as a one-click hover action on each file row (next to discard/stage), reusing the existing onOpenFile handler. No behavior change to the diff click or the context menu.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds a new inline "Open file for editing" icon button to each row in SourceControlPanel's changed-file list. The button is conditionally rendered based on deletion state, path availability, and callback presence, using the newly imported File01Icon. ChangesOpen File Action
Estimated code review effort: 1 (Trivial) | ~5 minutes Related Issues: None specified Related PRs: None specified Suggested labels: ui, source-control Suggested reviewers: None specified Poem: 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
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 |
|
Heads-up per CONTRIBUTING: this wasn't pre-discussed in an issue/Discord. It's a small, self-contained discoverability tweak (one file, +13 lines) surfacing the existing "Open File" context-menu action as a hover button — so I opened it directly. If you'd rather align on direction first, happy to move the discussion to an issue or Discord, or close it. No worries either way. |
What
Add a one-click hover button on each changed-file row in the Source Control panel that opens the editable file (not the read-only diff).
Why
Clicking a changed file opens the read-only diff view. Opening the actual editable file was only reachable via the right-click → "Open File" context-menu item, which is easy to miss. This surfaces that same action as a visible hover control.
How
Reuses the existing
onOpenFilehandler already wired to the panel. The button renders on row hover next to the stage/discard controls (only for non-deleted files, matching the existing "Open File" menu-item guard). No change to the diff-click behavior or the context menu.Testing
pnpm exec tsc --noEmitcleanScreenshots / GIFs
Hover a changed file row → a file icon button appears beside the stage checkbox; clicking it opens the editable file.
Notes for reviewer
Tiny, focused change (one file, +13 lines). Pure discoverability win for an action that already existed in the context menu. Happy to adjust the icon or placement.
Summary by CodeRabbit