Skip to content

Hint when Shift+Enter arrives as Ctrl+J in a form (#125) - #189

Merged
smarzban merged 3 commits into
mainfrom
tsk/t214-hint-when-shift-enter-arrives
Oct 11, 2026
Merged

smarzban merged 3 commits into
mainfrom
tsk/t214-hint-when-shift-enter-arrives

Conversation

@smarzban

@smarzban smarzban commented Oct 9, 2026 •

Copy link
Copy Markdown
Owner

Fixes #125.

A terminal bound to send a bare line feed for Shift+Enter (Ghostty keybind = shift+enter=text:\n) delivers it as Ctrl+J, which every form ignored silently.

Change

  • map_form_edit_key: ctrl+j → new BoardIntent::ShiftEnterAsCtrlJ. One site covers Title, Notes, Thread, Scope, the step editor, and the single-field editors.
  • Reducer shows Shift+Enter sent Ctrl+J: check terminal keys as a 5 s ephemeral status (a sticky message underneath is restored). Not a save, never persists; added to the empty-step-editor allowlist so it doesn't close a fresh + step row. The wording fits a 52-column pane.
  • Docs: keys.md "If Shift+Enter does not save" subsection; CHANGELOG Unreleased → Fixed.

Not covered (deliberate)

  • Quick-add line: it is the status row, so a message there is invisible and would leak onto the board after close. Plain Enter saves there, so nobody is stuck.
  • Standalone src/ui/capture.rs (unreachable per invariant).

Before / after

Binaries: /tmp/tsk-t214-before (origin/main 39e3a8e, release) and /tmp/tsk-t214-after (this branch, release). Same scenario on each, in a 52×24 Herdr pane with a fresh isolated TSK_STATE_DIR: add a ready task with notes draft, Enter to open, ctrl+e to edit, Tab to Notes, then herdr pane send-text <pane> $'\n' (the raw line feed Ghostty sends), read the pane, quit, read the store.

Before (main): the key is swallowed; the row just says editing….

  ○ T1 Smoke                                 ready
  ────────────────────────────────────────────────
  draft


  steps 0/0
   + step












  thread · tsk-t214-hint-when-shift-enter-arrives ·…
────────────────────────────────────────────────────
 editing…
 shift+enter save · tab next · esc cancel
stored notes: 'draft'

After (branch): the hint names the cause; draft and store unchanged.

  ○ T1 Smoke                                 ready
  ────────────────────────────────────────────────
  draft


  steps 0/0
   + step












  thread · tsk-t214-hint-when-shift-enter-arrives ·…
────────────────────────────────────────────────────
 Shift+Enter sent Ctrl+J: check terminal keys
 shift+enter save · tab next · esc cancel
stored notes: 'draft'

How to test

Already running in Herdr (workspace of this task, tabs before and after). Each board is open on task T1 with the Notes editor active (draft draft), against its own store: /tmp/tsk-t214-state-before and /tmp/tsk-t214-state-after.

In each tab, press ctrl+j (the same byte the Ghostty shift+enter=text:\n binding sends).

  • before: nothing visible; the row still says editing….
  • after: the row reads Shift+Enter sent Ctrl+J: check terminal keys in full, Notes still draft (no newline), still editing. It clears after ~5 s. Shift+Enter still saves.

Quit with Esc Esc ctrl+q. To rerun from scratch (throwaway state only; no setup or Herdr config touched):

S=$(mktemp -d) && chmod 700 "$S"
env TSK_STATE_DIR="$S" /tmp/tsk-t214-after add -p "$PWD" -t "Ctrl+J test" -n "draft"
env TSK_STATE_DIR="$S" /tmp/tsk-t214-after status 1 ready
env TSK_STATE_DIR="$S" /tmp/tsk-t214-after

Run from inside a Git repo so the task shows under the board's project. Then Enter (open T1), ctrl+e (edit), Tab (Notes), ctrl+j. Swap in /tmp/tsk-t214-before on a fresh S to see the bug. Clean up with rm -rf "$S".

Verification

  • cargo fmt --check && cargo clippy --all-targets -- -D warnings && cargo test: green.
  • cargo clippy --all-targets --target x86_64-pc-windows-gnu -- -D warnings: green.
  • site: npm test && npm run build: 49/49.
  • New tests in tests/queue_board_edit.rs: input map across editors, and a render of the hint at 52 and 100 columns with the draft intact. Both fail with the mapping hunk reverted; the render test also fails at 52 columns with the old, longer wording.

@vercel

vercel Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
herdr-tsk Ignored Ignored Preview Oct 11, 2026 6:23pm UTC

@smarzban
smarzban merged commit 9f087eb into main Oct 11, 2026
8 checks passed
@smarzban
smarzban deleted the tsk/t214-hint-when-shift-enter-arrives branch October 11, 2026 18:31
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.

can't save new task

1 participant