Skip to content

fix(ui-egui): Ctrl+F and Ctrl+E go to the search box, not into the note (#134) - #184

Merged
DWAA1660 merged 1 commit into
AlienTechSoftware:mainfrom
DWAA1660:fix/ctrl-f-search
Nov 12, 2026
Merged

DWAA1660 merged 1 commit into
AlienTechSoftware:mainfrom
DWAA1660:fix/ctrl-f-search

Conversation

@DWAA1660

Copy link
Copy Markdown
Collaborator

What and why

Fixes #134. In the ordinary page editor, Ctrl+F wasn't handled at all. With the caret in a paragraph, the key went nowhere and the next text, findneedle in the issue, was inserted into the note and saved.

Ctrl+F, and Ctrl+E (OneNote's key for searching all notebooks, as the issue suggests), are now consumed in the window's shortcut handling. That's the same place Ctrl+S / Ctrl+Z / Ctrl+Y are taken, before any widget sees them. They move the keyboard to the existing Search all pages box in the title bar, through the same focus_search path its search button uses, and drop any pending caret focus request. While the code view is open the shortcut is left alone, because the code view has its own Ctrl+F Find for the file it shows.

Escape in the search box gives the focus up as before. Clicking back into the page puts the caret where it's clicked. A per-page Find bar (highlighting matches inside the current page) would be a larger feature. This fixes the routing, so typing a query can no longer edit the note.

How it was checked

  • New UI test ctrl_f_in_the_page_goes_to_search_and_writes_nothing, run for both Ctrl+F and Ctrl+E: caret in a paragraph, press the key, type findneedle. The page body is unchanged and the query is in the search box. Fails without the fix (the query lands in the note), and passes with it.
  • The code view's own Find test (the_code_view_colours_the_file_and_finds_text_in_it, which uses Ctrl+F) still passes
  • cargo test -p notecraft-ui-egui: all pass (302 unit, 203 UI)
  • cargo fmt --all -- --check, cargo clippy -p notecraft-ui-egui --all-targets -- -D warnings: clean

🤖 Generated with Claude Code

With the caret in a page, Ctrl+F did nothing and the words typed next,
meant as a search, were written into the note (AlienTechSoftware#134). Ctrl+F, and
Ctrl+E as OneNote has it, are now taken before the page sees them and
put the keyboard in the Search all pages box. The code view keeps its
own Ctrl+F Find while it is open.

Fixes AlienTechSoftware#134

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@DWAA1660
DWAA1660 merged commit f9594bc into AlienTechSoftware:main Nov 12, 2026
9 checks passed
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.

[BUG] Ctrl+F does not open search in the page editor and subsequent query text edits the note

1 participant