Skip to content

refactor(code): share newline affordances across input surfaces#4852

Merged
Mason Daugherty (mdrxy) merged 4 commits into
mainfrom
mdrxy/code/goal-editor-newline-hint
Jul 21, 2026
Merged

refactor(code): share newline affordances across input surfaces#4852
Mason Daugherty (mdrxy) merged 4 commits into
mainfrom
mdrxy/code/goal-editor-newline-hint

Conversation

@mdrxy

@mdrxy Mason Daugherty (mdrxy) commented Jul 20, 2026

Copy link
Copy Markdown
Member

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

The goal-criteria review editor hardcoded "Shift+Enter newline" in its
footer hints. On terminals that cannot report Shift+Enter (e.g. macOS
Terminal.app), that key is indistinguishable from plain Enter and submits
instead of inserting a newline, so the hint told users to press the wrong
key. Use the terminal-aware `newline_shortcut()` helper the chat input
already uses, so the editor advertises Ctrl+J / Option+Enter where
appropriate.

Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
@github-actions github-actions Bot added dcode Related to `deepagents-code` fix A bug fix (PATCH) internal User is a member of the `langchain-ai` GitHub organization size: XS < 50 LOC labels Jul 20, 2026
@mdrxy
Mason Daugherty (mdrxy) marked this pull request as ready for review July 20, 2026 14:24

@open-swe open-swe Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Open SWE Review: No issues found

Open SWE reviewed this PR and found no potential bugs to report.

Open in WebView Open SWE trace

Move the modifier-Enter / Ctrl+J newline bindings and the VSCode
backslash+enter fallback into the shared PasteBurstTextArea base so the
goal editor and ask_user free-text prompt gain them, not just the chat
input. Add a shared newline_hint() helper and advertise the newline
shortcut in the ask_user footer. Any future TextArea-based input surface
that extends the shared base inherits these affordances.

Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
@open-swe open-swe Bot changed the title fix(code): use terminal-aware newline hint in goal editor fix(code): share newline affordances across input surfaces Jul 20, 2026
@github-actions github-actions Bot added size: M 200-499 LOC and removed size: XS < 50 LOC labels Jul 20, 2026
@github-actions github-actions Bot added size: L 500-999 LOC and removed size: M 200-499 LOC labels Jul 21, 2026
@mdrxy Mason Daugherty (mdrxy) changed the title fix(code): share newline affordances across input surfaces refactor(code): share newline affordances across input surfaces Jul 21, 2026
@github-actions github-actions Bot added refactor Code change that neither fixes a bug nor adds a feature and removed fix A bug fix (PATCH) labels Jul 21, 2026
@mdrxy
Mason Daugherty (mdrxy) merged commit 67bcb56 into main Jul 21, 2026
66 checks passed
@mdrxy
Mason Daugherty (mdrxy) deleted the mdrxy/code/goal-editor-newline-hint branch July 21, 2026 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dcode Related to `deepagents-code` internal User is a member of the `langchain-ai` GitHub organization refactor Code change that neither fixes a bug nor adds a feature size: L 500-999 LOC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant