Repository navigation
Offer Enter or Shift+Enter to send from Settings (#3114) - #3168
Conversation
The cases drive the General page main has today: the writable page draws six controls and no Shortcuts section, and the read-only page never names the send key. They fail until composer.js carries the choice and settings.js draws it. Part of #3114 (the umbrella stays open — this slice closes its own issue).
General → Shortcuts picks which key sends: Enter keeps the shell's habit, Shift+Enter flips it so Enter starts a new line. The choice is this window's own (localStorage) — no host field, no cross-device sync — and the composer presses the card's own Send button or inserts the line break in a capture listener. A read-only window names the choice instead of drawing a picker. Fixes #3167 Part of #3114 (the umbrella stays open — this slice closes its own issue).
|
Verdict: PASS at bc469a4 Ran at this tip: Read at 2026-11-18T13:40Z on the tip tarball Red first. Reverting only Range. Behaviour against the anchors. Tests. The Gates. CI on the tip. 19 check-runs, all terminal, none failing ( Not covered, and it is the hand-check item. The unit card is a mock, so "a real |
Fixes #3167
Part of #3114 (the umbrella stays open — this slice closes its own issue).
Owner: Dev
Reviewer: Reviewer
Written-by: Dev
Tier: T1 — the tier the enqueue-guard computed from this diff
What changed
core/src/client/settings.js): a writable window gets a two-button picker, Enter to send (the default, keeping the shell's habit) or Shift+Enter to send; the other key starts a new line. The choice is written to this window'slocalStorage(flybot-send-key), not to team state, so there is no host field and no cross-device sync. A read-only window draws one text row naming the choice instead of a picker.core/src/client/composer.js):SEND_KEYS/normalizeSendKey/readSendKey/writeSendKey, the pureshouldSendOnKey/shouldBreakOnKeypredicates (IME composition, the legacykeyCode 229, and Ctrl/Cmd/Alt pass through),findSendButton(marker first, then the Send label, excluding dictate/mic/voice/add/plus/stop),insertComposerNewline(value field splice; the Lexical contenteditable takesinsertLineBreak→insertParagraph→insertText), andinstallSendShortcut, one capture-phase window listener mounted byComposerVoice. Shift+Enter clicks the card's own Send button; Enter inserts the break; a disabled or absent Send (a running turn's Stop, a read-only composer) leaves the key to the shell.core/src/client/i18n.js): five zh keys (Shortcuts,Send shortcut,Enter to send,Shift+Enter to send, and the sentence under the row).core/test/settings-readonly-pages.test.js, on the existing harness — no new test file): thelocalStoragestub becomes a writableMap, the virtual entry exports the three composer functions, and five cases are added — two Settings cases (writable picker + stored choice, read-only text) and three composer cases (Shift+Enter sends and Enter breaks; Enter-to-send leaves the key alone; a missing/disabled Send or a locked field is left alone). The writable-control count goes 6 → 7.docs/subsystems/core-client.md(the composer's own page) andchangelog.d/3114-send-key.added.md.Not in this cut: light/dark/auto/system mode (the shell's theme service owns
data-ds-dark-theme), the Grove palette /--bt-selected, language, folding, Channels, and persisting the key through the host (core/src/host/channel.jsis a T3 path andsetPrefssilently drops unknown fields).patches/ds-bot/topics.jsonis untouched (no new source file).Verification at the tip
Tip SHA:
bc469a433c794c97e6e1540fd01981f2653b8380Base:
483fb8fe2696b4e79735a505af77a878ce705423(liveorigin/mainwhen the branch was cut;mainwas still that sha when the branch was pushed)Ran:
cd core && node --import ./test/harness-resolve.mjs --test test/settings-readonly-pages.test.jsbefore the implementation (test changes only) →# tests 10 / # pass 7 / # fail 3, red onGeneral keeps its four switches beside the send-key picker(6 !== 7),the choice has its own section, andthe page still names the setting.# tests 13 / # pass 13 / # fail 0.cd core && node scripts/build-client.mjsthennode core/scripts/build-client.mjs --check→ exit 0 (core/client.js24122 → 24252 lines, +130).node scripts/ds-bot-patches.mjs generate→ wrotefiles/(429 files) + 10 patches, exactly the 5 expected generated paths changed;node scripts/ds-bot-patches.mjs check→ok 10 patches apply cleanly in order·ok core/ equals ds-bot/ + patches/ds-bot/;node scripts/ds-bot-patches.mjs canonical→ok patches/ds-bot/ is what generate writes (generate is a no-op). This machine has no git inPATH; the repo's own gates ran with the bundled git 2.53.0 at/data/dsh/bot/workspace/tools/git(bin +GIT_EXEC_PATH), andcanonicalwas green here, not deferred to the tip CI.TZ=UTC TMPDIR=/data/flybot-tmp npm run verify→ exit 0 (core 3309 tests: 3308 pass, 1 skipped; every plugin suite, core lint with 89 warnings / 0 errors, arch-docs OK on 12 files, both-checks, canonical, and the interop/live-e2e suites green).settings-polish,settings-page-keys,client-bundle,composer-send-readonly,i18n,i18n-missing-entries→ 38/38.Not run (and why):
[data-composer-card]must yield the Send button byaria-label/title/textContent; pressing Shift+Enter with Shift+Enter to send chosen must actually send; pressing Enter must insert a line break. That structure assumption is not covered by a unit test, so a break there shows up as a silent non-send, not an error.core/dev/bench.sh): no host,index.jsor turn-pipeline change.Checkpoint
{
"pr": 3168,
"claim": "Dev",
"issue": 3167,
"summary": "General → Shortcuts now offers Enter to send (the default) or Shift+Enter to send, stored for this window only. The composer reads that choice at each key press: Shift+Enter presses the card's own Send button, Enter inserts a line break, and a disabled or missing Send falls back to the shell. A read-only window names the choice instead of drawing a picker, and the five zh keys cover the new copy. The suite adds three UI cases and three composer cases to the existing Settings harness, 13/13 after the implementation (10/7/3 red first).",
"files": [
"core/src/client/composer.js",
"core/src/client/settings.js",
"core/src/client/i18n.js",
"core/test/settings-readonly-pages.test.js",
"docs/subsystems/core-client.md",
"changelog.d/3114-send-key.added.md",
"core/client.js",
"patches/ds-bot/0001-core-fixes.patch",
"patches/ds-bot/0008-client-bundle.patch",
"patches/ds-bot/0012-room-membership.patch",
"patches/ds-bot/0014-flybot-branding.patch",
"patches/ds-bot/files/test/settings-readonly-pages.test.js"
],
"checks": { "ran": "TZ=UTC TMPDIR=/data/flybot-tmp npm run verify", "result": "green", "at": "bc469a433c794c97e6e1540fd01981f2653b8380" },
"next": "none — ready for review"
}