Skip to content

fix: pass through in search#1203

Merged
andrinoff merged 1 commit intofloatpane:masterfrom
mvanhorn:fix/1199-search-key-passthrough
Apr 30, 2026
Merged

fix: pass through in search#1203
andrinoff merged 1 commit intofloatpane:masterfrom
mvanhorn:fix/1199-search-key-passthrough

Conversation

@mvanhorn
Copy link
Copy Markdown
Contributor

What?

In tui/folder_inbox.go, skip the FolderInbox.Update keypress switch while m.inbox.searchOverlay != nil so the message falls through to m.inbox.Update, which already routes overlay keys to SearchOverlay.Update for text input.

Adds TestSearchOverlayKeysNotIntercepted in tui/folder_inbox_test.go to lock in the behavior. The test fails on master and passes after the fix.

Why?

Closes #1199.

FolderInbox.Update runs before the inner Inbox.Update. When the search overlay was open (after pressing /), folder-level keybindings such as kb.Folder.Move (default m) matched on msg.String() and started the move-to-folder flow instead of letting the keystroke reach the search input. Reproducer from the issue: enter inbox -> / -> press m and the "Move to folder:" popup appears.

Other kb.Folder.* bindings (tab, shift+tab, ], [) had the same problem in principle. Routing all keys through to the inner inbox while the overlay is open fixes them in one place. The overlay's own Esc handler in Inbox.Update (line 647-650) still works because the inbox's keypress branch checks m.searchOverlay != nil first.

Closes floatpane#1199

When the inbox search overlay was open (after pressing /), folder-level
keybindings such as 'm' (move) were intercepted by FolderInbox.Update
before the inner inbox could route the keystroke to the search input.
This caused the user to start a move-to-folder flow instead of typing
the letter into the search field.

Skip the FolderInbox keypress switch while m.inbox.searchOverlay != nil
so the message falls through to m.inbox.Update, which already routes
overlay keys to SearchOverlay.Update for text input.
@mvanhorn mvanhorn requested a review from a team as a code owner April 30, 2026 12:16
@github-actions github-actions Bot added the bug Something isn't working label Apr 30, 2026
Copy link
Copy Markdown
Member

@floatpanebot floatpanebot left a comment

Choose a reason for hiding this comment

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

Hi @mvanhorn! Please fix the following issues with your PR:

  • Title: Is too long (52 characters). The PR title must be strictly under 40 characters.

@andrinoff
Copy link
Copy Markdown
Member

/build

@floatpanebot
Copy link
Copy Markdown
Member

Build complete (595ef1c)

Warning

This is an unreviewed PR build and has not been security audited. It may contain bugs, vulnerabilities, or malicious code. Do not use for daily use. Only use for testing purposes.

OS Arch Download
Linux amd64 matcha_preview_linux_amd64.tar.gz
Linux arm64 matcha_preview_linux_arm64.tar.gz
macOS amd64 matcha_preview_darwin_amd64.tar.gz
macOS arm64 matcha_preview_darwin_arm64.tar.gz
Windows amd64 matcha_preview_windows_amd64.zip
Windows arm64 matcha_preview_windows_arm64.zip

@andrinoff andrinoff changed the title fix: pass through search overlay keys in FolderInbox fix: pass through in search Apr 30, 2026
@floatpanebot floatpanebot dismissed their stale review April 30, 2026 14:55

Formatting issues have been resolved. Thank you!

Copy link
Copy Markdown
Member

@andrinoff andrinoff left a comment

Choose a reason for hiding this comment

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

lgtm

@andrinoff
Copy link
Copy Markdown
Member

/approve

Copy link
Copy Markdown
Member

@floatpanebot floatpanebot left a comment

Choose a reason for hiding this comment

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

Approved on behalf of @andrinoff via /approve command.

@andrinoff andrinoff merged commit cdf3c7f into floatpane:master Apr 30, 2026
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: m key triggers move in search field

3 participants