Skip to content

feat(fm): MC-style keyboard cursor + function-key bar (FM increment A)#27

Merged
iret77 merged 1 commit into
mainfrom
feat/fm-mc-keyboard
Jul 4, 2026
Merged

feat(fm): MC-style keyboard cursor + function-key bar (FM increment A)#27
iret77 merged 1 commit into
mainfrom
feat/fm-mc-keyboard

Conversation

@iret77

@iret77 iret77 commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator

First increment toward using the integrated file manager the Midnight Commander way — the keyboard/interaction core.

What lands

  • keynav.rs — pure, unit-tested cursor arithmetic (Up/Down/First/Last/Page + clamp): no wrapping, empty-list safe, stale-cursor safe.
  • A keyboard cursor distinct from the multi-selection set: a single accent-bar row (inverse video, MC's cyan cursor). Arrows move it; Enter/Right open/enter a directory; Left/Backspace go up; Space toggles selection; Home/End/PageUp/PageDown jump. The cursor shares one visible_indices() source of truth with the rendered rows and re-clamps after every refresh/filter/navigation.
  • Function-key footer — F3 View · F4 Edit · F5 Copy · F6 Rename · F7 MkDir · F8 Delete · F10 Quit — mirroring the physical F-keys, also clickable for mouse users.

Honest scope: F5/F6 copy/move into another file panel (the defining MC operation) is the next increment — it needs the FM-pane registry + a copy primitive/transfer engine. Pressing F5/F6 today says so plainly rather than silently doing nothing. This PR makes a single panel fully keyboard-drivable; the two-panel copy/move follows.

Verified: cargo check -p warp 0 errors/0 warnings; 236 sftp tests + 6 keynav tests green (incl. 5 new view-level cursor/filter tests). No build triggered (per the standing no-build-without-substantial-progress rule).

🤖 Generated with Claude Code

The integrated file manager becomes keyboard-drivable like Midnight
Commander — the first half of making it usable the MC way.

- keynav.rs: pure, unit-tested cursor arithmetic (Up/Down/First/Last/
  Page, clamp), no wrapping, empty-list safe, stale-cursor safe.
- A `cursor` distinct from the multi-selection set: a single accent-bar
  row (inverse video, MC's cyan cursor) rendered by file_list. Arrow
  keys move it; Enter/Right open or enter; Left/Backspace go up; Space
  toggles selection; Home/End/PageUp/PageDown jump. The cursor is the
  single source of truth with the rendered rows (shared visible_indices)
  and re-clamps after every refresh/filter/navigation.
- Function-key footer (F3 View · F4 Edit · F5 Copy · F6 Rename · F7
  MkDir · F8 Delete · F10 Quit), mirroring the physical F-keys and
  clickable for mouse users. F5/F6 copy/move to *another* file panel is
  the next increment (registry + transfer engine); pressing them today
  says so plainly rather than doing nothing.

Verified: cargo check -p warp 0/0; 236 sftp tests + 6 keynav tests
green (5 new view-level cursor/filter tests). No build triggered.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@iret77 iret77 merged commit 36e8a49 into main Jul 4, 2026
2 checks passed
@iret77 iret77 deleted the feat/fm-mc-keyboard branch July 4, 2026 08:53
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