Add keybinding to toggle file navigation in Code Review#11077
Add keybinding to toggle file navigation in Code Review#11077vkodithala wants to merge 1 commit into
Conversation
|
I'm starting a first review of this pull request. You can view the conversation on Warp. I completed the review and no human review was requested for this pull request. Comment Powered by Oz |
There was a problem hiding this comment.
Overview
Adds an editable f keybinding for toggling Code Review file navigation, scopes it away from focused editor descendants, and updates the file-nav button tooltip to show the active shortcut.
Concerns
- No blocking correctness, security, or user-facing evidence concerns found in the reviewed diff.
Verdict
Found: 0 critical, 0 important, 0 suggestions
Approve
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
| // Surface a context flag that is true only when no descendant text editor | ||
| // is focused. This lets us register single-letter shortcuts on the pane | ||
| // (e.g. `F` to toggle file navigation) without stealing keystrokes from | ||
| // file editors or comment composers within the pane. Note that the inline | ||
| // file diff editors call `ctx.focus_self()` on `CodeEditorView`, so we | ||
| // check that variant in addition to the lower-level editor view names. | ||
| let editor_focused = ctx | ||
| .focused_view_id(self.window_id) | ||
| .and_then(|view_id| ctx.view_name(self.window_id, view_id)) | ||
| .is_some_and(|name| { | ||
| matches!(name, "EditorView" | "RichTextEditorView" | "CodeEditorView") | ||
| }); |
There was a problem hiding this comment.
Do we actually need this? If an editor is focused won't it receive the f first so it's not bubbled up to the code review pane anyway?

Description
Adds an
Fkeyboard shortcut for toggling the file navigation sidebar in the Code Review pane. Fires only when the Code Review pane is in scope and no descendant text editor (file diff editor, find bar, or comment composer) is focused, so typingfinside any of those still inserts the character.Implementation notes
CodeReviewView::keymap_contextnow adds a"CodeReviewView_NotEditing"flag when the focused view is notEditorView,RichTextEditorView, orCodeEditorView(the inline diff editor focuses itself).code_review:toggle_file_navigation→CodeReviewAction::ToggleFileSidebar, scoped to that flag and gated behindFeatureFlag::GitOperationsInCodeReviewso the shortcut only registers when the file-nav button is live. Users can rebind it from Settings → Keybindings.Show file navigation (F)/Hide file navigation (F)), viakeybinding_name_to_display_stringso it honors user customizations.Linked Issue
N/A. Sourced from internal #feedback-app channel.
Testing
./script/runF→ sidebar toggles (and tooltip updates between Show/Hide with the(F)hint).f→ letter is typed, sidebar untouched.f→ letter is typed.f→ letter is typed.cargo fmt --checkandcargo clippy --workspace --all-targets --tests -- -D warningspass.Screenshots / Videos
Demo here.
Agent Mode
Agent conversation · Plan