Skip to content

Make Ctrl+F move the caret forward in Program view#687

Merged
edwin-zvs merged 1 commit into
mainfrom
program-ctrlf-cursor-forward
Jul 2, 2026
Merged

Make Ctrl+F move the caret forward in Program view#687
edwin-zvs merged 1 commit into
mainfrom
program-ctrlf-cursor-forward

Conversation

@edwin-zvs

Copy link
Copy Markdown
Contributor

Summary

  • The web Program editor bound Ctrl+F to open its Find bar, so it swallowed the Emacs cursor-forward keystroke the TUI's Program surface already supports (C-f → move caret forward one character).
  • Rebind Ctrl+F to move the caret forward one character (via Selection.modify("move", "forward", "character")) and preventDefault() so the browser's native Find dialog never opens either.
  • Find remains reachable via the toolbar's Find button (its tooltip no longer advertises a Ctrl+F shortcut it doesn't have anymore); docs/program.md updated to match.

Test plan

  • cargo build --manifest-path Cargo.toml — clean build, only pre-existing unrelated warnings.
  • Added an e2e assertion in crates/e2e/tests/program_view.rs that dispatches a Ctrl+F keydown on the Program editor and checks the caret advances by one and the Find bar never opens.
  • Verified the new assertion actually catches the regression: reverted the JS change, rebuilt construct, confirmed the test fails (head: null, findVisible: true); restored the fix, rebuilt, confirmed it passes.
  • cargo test -p agentd-e2e --test program_view web_program_view_full_parity passes end-to-end (headless Chromium).

The web Program editor bound Ctrl+F to its Find bar, so it swallowed
the Emacs cursor-forward keystroke the TUI's Program surface already
supports. Rebind it to move the caret forward one character (via
Selection.modify) and preventDefault so the browser never opens its
own Find dialog either. Find is still reachable via the Find button.
@edwin-zvs
edwin-zvs merged commit 43201db into main Jul 2, 2026
1 check 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.

1 participant