Skip to content

feat(picker): add preview toggle shortcuts - #375

Merged
fcoury merged 2 commits into
mainfrom
fcoury/picker-preview-toggle
Oct 12, 2026
Merged

fcoury merged 2 commits into
mainfrom
fcoury/picker-preview-toggle

Conversation

@fcoury-oai

Copy link
Copy Markdown
Collaborator

Long file paths can be difficult to inspect while a picker preview consumes half of the available width. This adds a reversible preview toggle with an F4 fallback for terminals where Alt key combinations are unavailable or unreliable.

The shared picker now hides or restores its preview with Alt-p or F4 and immediately recomputes result geometry without losing the query or selection. Buffer and project-search pickers route both shortcuts through their existing plugin-owned toggle so their persisted preview state remains authoritative. The shortcut reference documents both bindings.

How to Test

  1. Open the file picker with Ctrl-p and select a deeply nested file. Press Alt-p and verify the preview disappears, the result row expands to show more of the path, and the query and selection remain unchanged.
  2. Press F4 and verify the preview and split layout return.
  3. Open Buffers with Ctrl-j and Find in Files with Space g. Repeat Alt-p and F4 and verify each plugin-owned preview hides and restores without desynchronizing its state.
  4. Run cargo test --lib ui::picker::tests::preview_shortcuts_toggle_layout_without_losing_picker_state and cargo test --lib ui::picker::tests::dynamic_picker_emits_custom_key_actions.

@fcoury-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-12T17:54:08.718407Z fec58b2 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fec58b2ca6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread plugins/buffer_picker.hk Resolved
@fcoury
fcoury merged commit ebb8a8e into main Oct 12, 2026
15 checks passed
@fcoury
fcoury deleted the fcoury/picker-preview-toggle branch October 12, 2026 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants