Registry Mirror
Skip to content

Conversation

@Ajay-Satish-01

Copy link
Copy Markdown
Contributor

Summary

  • Adds hunk.review.saveNote (default ctrl+s) so the note composer save shortcut comes from [keybindings] instead of a hardcoded widget key.
  • Escape, Enter, and F10 stay widget-owned. While the composer is focused, only the resolved chords save; unbinding or remapping away from ctrl+s also stops CSI-u / raw Ctrl-S.
  • The composer footer and ? help show the live chord (Ctrl+S by default, e.g. Ctrl+Enter after a remap). Unbound omits the key and leaves a clickable Save.
  • This has to be a host change: focused text inputs sit above session extension keyboard modes, so an extension cannot claim the chord while the composer has focus.

Fixes #846

Test plan

  • c to start a draft; footer shows Ctrl+S save; Ctrl-S (including CSI-u \e[115;5u) saves
  • Config "hunk.review.saveNote" = "ctrl+enter": footer shows Ctrl+Enter save; Ctrl-S does not save; Ctrl+Enter does
  • Config "hunk.review.saveNote" = false: Ctrl-S and CSI-u leave the draft; ? drops the save-note row
  • Clicking Ctrl+S save still saves
  • command_executed fires with hunk.review.saveNote on a successful save

Verified: unit tests for catalog, chord matching (including Ctrl+Shift+S no longer saving), execute-by-id ownership, help remap/unbind; AppHost remap to ctrl+enter, unbind, and CSI-u after remap-away; bun test ./test/pty/notes.test.ts (19 pass, including live Ctrl+S save and click-to-save). format:check and lint on the changed files passed. bun run test had four failures already present on this machine (Jujutsu source logging, two Shiki catalog checks, install VM symlink contract); none of those files are in this diff.

Screenshots

Composer footer is driven by the resolved hunk.review.saveNote label (default Ctrl+S save Esc cancel). After "hunk.review.saveNote" = "ctrl+enter", AppHost frames show Ctrl+Enter save. I can attach live TUI captures if useful.

@greptile-apps

greptile-apps Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

PR author is not in the allowed authors list.

@vercel

vercel Bot commented Aug 31, 2026

Copy link
Copy Markdown

@Ajay-Satish-01 is attempting to deploy a commit to the Modem Team on Vercel.

A member of the Team first needs to authorize it.

@Ajay-Satish-01

Copy link
Copy Markdown
Contributor Author

@benvinegar, would you be able to take a look at this? Thanks

@benvinegar

Copy link
Copy Markdown
Member

Good find. I'll probably queue up for the next minor release.

@Ajay-Satish-01

Copy link
Copy Markdown
Contributor Author

Good find. I'll probably queue up for the next minor release.

Sure. Thanks

@benvinegar

Copy link
Copy Markdown
Member

Still works after the recent repo move, but this command should only be enabled while a draft exists. Right now its key is consumed globally and emits command_executed even when there’s nothing to save. Otherwise the approach looks good.

@Ajay-Satish-01

Copy link
Copy Markdown
Contributor Author

Still works after the recent repo move, but this command should only be enabled while a draft exists. Right now its key is consumed globally and emits command_executed even when there’s nothing to save. Otherwise the approach looks good.

I worked on the change. Please check and let me know if this approach works.

@Ajay-Satish-01

Copy link
Copy Markdown
Contributor Author

@benvinegar would you be able to take a look at this? Thanks

Ajay-Satish-01 and others added 3 commits October 12, 2026 13:55
Zellij and similar multiplexers swallow Ctrl-S before Hunk sees it, so the composer save shortcut is now hunk.review.saveNote (default ctrl+s) instead of a hardcoded widget key.
Format the moved command catalog so oxfmt passes on CI, and keep the save
chord from dispatching or emitting command_executed when there is no draft.
@benvinegar

Copy link
Copy Markdown
Member

Rebased onto fresh main (7572a228) and force-pushed with an explicit lease. Resolved conflicts while preserving newer note actions, visual selection, key defaults, and focused-editor buffer saving. This still correctly addresses #846.

Added a fix for the new pre-mount input path: it now honors the resolved save binding, and saving remains enabled for a draft opened earlier in the same input chunk. Added real-PTY remap/unbind coverage for legacy and CSI-u Ctrl-S, pre-mount input, Ctrl+Enter save, and clickable Save when unbound.

Validation on Linux:

  • bun run typecheck: passed.
  • bun run test:integration: 248 passed, 1 platform skip.
  • bun test test/pty/notes.test.ts: 32 passed; reran the remap/mounting cases after expanding them, 4 passed.
  • Targeted catalog, AppHost keybindings, note component, command, menu, and help tests: 213 passed.
  • bun run test:tty-smoke: 11 passed. Also opened the actual repository diff in a real PTY and saved a note successfully.
  • bun run deps:check, formatting and lint on changed files, and git diff --check: passed.
  • bun run install:bin: rebuilt and installed successfully.
  • bun run test: 4,996 passed, 13 skipped, 3 failed. All three failures reproduce on fresh main with bun test packages/hunk/src/app/sessionBootstrap.test.ts packages/hunk/src/extensions/apply.test.ts packages/hunk/src/extensions/publicApiRobustness.test.ts packages/hunk/src/ui/lib/ui-lib.test.ts: VCS detection selects jj where those tests expect git. That targeted command also reproduces an existing Unicode prepend-width failure on main.

GitHub now reports the PR as mergeable (no conflicts). macOS, Windows, and an actual Zellij session were not tested.

This comment was generated by Pi using GPT-6.1 (gpt-6.1-sol)

@benvinegar
benvinegar merged commit 55c5ac1 into modem-dev:main Oct 13, 2026
14 of 15 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.

Allow the note composer save note command (Ctrl-S) to be remapped

2 participants