Files
Mason Daugherty 67bcb564ff refactor(code): share newline affordances across input surfaces (#4852)
Fixes the newline-entry inconsistencies across dcode's text-entry
surfaces, and refactors so any future surface inherits the affordances.

Three gaps came out of a comparison with Codex and opencode:

- The goal-criteria editor advertised a hardcoded "Shift+Enter newline"
in its footer. On terminals that cannot report Shift+Enter (e.g. macOS
Terminal.app) that chord submits, so the hint pointed at the wrong key.
- The VSCode `backslash+enter`→newline fallback (for terminals that
emulate Shift+Enter that way) lived only in the chat input, so
Shift+Enter submitted with a stray backslash in the goal editor and the
`ask_user` free-text prompt.
- The `ask_user` free-text prompt never told users how to insert a
newline at all.

Rather than patch each surface, the shared newline affordances now live
in the common `PasteBurstTextArea` base: the modifier-Enter / Ctrl+J
bindings, the derived newline-key set, and the backslash+enter fallback
(via small `_consume_backslash_enter_newline` /
`_track_backslash_pending` / `_consume_modifier_newline` helpers). Both
the chat input and the inline prompts inherit them, and any future
`TextArea`-based input surface that extends the base gets them for free.
A shared `newline_hint()` helper renders the terminal-aware shortcut
(`Ctrl+J` / `Option+Enter` / `Shift+Enter`) consistently, now used by
both the goal editor and the `ask_user` footer.

The chat input's existing behavior — including the completion-active
gating on the backslash path and key ordering — is preserved.

Made by [Open
SWE](https://openswe.vercel.app/agents/a7bdfa65-aba1-0246-373d-5a12d84a9860)

---------

Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
2026-07-21 11:25:29 -04:00
..