Skip to content

Add keybinding to toggle file navigation in Code Review#11077

Open
vkodithala wants to merge 1 commit into
masterfrom
varoon/file-exp-keybind
Open

Add keybinding to toggle file navigation in Code Review#11077
vkodithala wants to merge 1 commit into
masterfrom
varoon/file-exp-keybind

Conversation

@vkodithala
Copy link
Copy Markdown
Contributor

@vkodithala vkodithala commented May 15, 2026

Description

Adds an F keyboard 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 typing f inside any of those still inserts the character.

Implementation notes

  • CodeReviewView::keymap_context now adds a "CodeReviewView_NotEditing" flag when the focused view is not EditorView, RichTextEditorView, or CodeEditorView (the inline diff editor focuses itself).
  • New editable binding code_review:toggle_file_navigationCodeReviewAction::ToggleFileSidebar, scoped to that flag and gated behind FeatureFlag::GitOperationsInCodeReview so the shortcut only registers when the file-nav button is live. Users can rebind it from Settings → Keybindings.
  • The file-nav button's tooltip is built dynamically and includes the live shortcut (e.g. Show file navigation (F) / Hide file navigation (F)), via keybinding_name_to_display_string so it honors user customizations.

Linked Issue

N/A. Sourced from internal #feedback-app channel.

Testing

  • I have manually tested my changes locally with ./script/run
  • Opened Code Review, pressed F → sidebar toggles (and tooltip updates between Show/Hide with the (F) hint).
  • Clicked into an inline file diff editor, pressed f → letter is typed, sidebar untouched.
  • Opened the comment composer, pressed f → letter is typed.
  • Focused the find bar input, pressed f → letter is typed.
  • Verified cargo fmt --check and cargo clippy --workspace --all-targets --tests -- -D warnings pass.

Screenshots / Videos

Demo here.

Agent Mode

  • Warp Agent Mode - This PR was created via Warp's AI Agent Mode

Agent conversation · Plan

@cla-bot cla-bot Bot added the cla-signed label May 15, 2026
Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@vkodithala vkodithala changed the title initial implementation Add F keybinding to toggle file navigation in Code Review May 15, 2026
@vkodithala vkodithala changed the title Add F keybinding to toggle file navigation in Code Review Add keybinding to toggle file navigation in Code Review May 15, 2026
@vkodithala vkodithala requested a review from alokedesai May 15, 2026 23:13
@vkodithala vkodithala marked this pull request as ready for review May 15, 2026 23:13
@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented May 15, 2026

@vkodithala

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 /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

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

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

Comment on lines +7030 to +7041
// 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")
});
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants