fix: polish tab strip context interactions#150
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAdds a right-click context menu to the editor tab strip. A new ChangesTab Strip Right-Click Context Menu
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/app/central_panel.rs`:
- Around line 659-673: The code in the tab_context_reveal_path block is
collapsing file paths to their parent directory before opening them in the
explorer, which prevents revealing the actual selected file. Remove the logic
that converts files to their parent directory (lines 660-664 containing the if
let Some(path) assignment and the folder variable construction). Instead, pass
the original path directly to open::that(), allowing RevealInExplorer to target
the selected file itself for file-backed tabs while still handling directory
paths correctly.
- Around line 577-628: The tab context menu dismissal logic is currently nested
inside the if let block that checks for an active menu, so it only runs while
the tab strip is visible. When the tab strip stops rendering (such as when
entering Zen Mode), the menu state in self.state.ui.tab_context_menu is never
cleared and persists as stale data. Add code outside the tab context menu
rendering block to clear self.state.ui.tab_context_menu to None when the tab
strip is not being rendered or is hidden, ensuring the popup cannot reappear at
stale screen positions when the tab strip becomes visible again.
In `@src/ui/action_registry.rs`:
- Line 58: The "Copy File Path" label in the ActionDefinition for
ContextActionId::CopyPath on line 58 is hardcoded in English instead of using a
localized label like the sibling actions in the same registry. Replace the
hardcoded string "Copy File Path" with a localized label using the same i18n
pattern that the adjacent action definitions use in this file, ensuring
consistency across all action labels in the action_registry.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 94ca2ca8-b40d-4bc9-8b70-dc74745b2ab6
📒 Files selected for processing (5)
src/app/central_panel.rssrc/app/navigation.rssrc/state.rssrc/ui/action_registry.rssrc/ui/mod.rs
|
Fresh refresh on PR 150: the latest CI run I also re-ran |
Description
Polishes tab-strip interactions so tabs respond immediately on pointer press, use stable egui IDs, show the full file path on hover, and expose a small right-click context menu.
Related: #118
Type of Change
Changes Made
Screenshots
If this PR includes UI changes, please add before/after screenshots:
Checklist
cargo fmtand it produces no changescargo clippyand it produces no warningscargo testand all tests passcargo build --releasesuccessfullyBreaking Changes
None.
Testing
git diff --checkcargo checkAdditional Notes
cargo checkpasses with three pre-existing warnings insrc/markdown/mod.rsandsrc/markdown/video_embed.rsabout unused video embed exports/functions. I did not include a broadcargo fmtrun because the current tree contains unrelated formatting diffs in files outside this change; this PR avoids that noise.Summary by CodeRabbit
Release Notes