Repository navigation
Description
Fourth slice of #3114 (umbrella stays open). Spec: #3114 comment 6979176591, with the erratum that supersedes parts of it: comment 6979492049.
Scope
The shell always sends on Enter and breaks on Shift+Enter; FlyBot has no switch (sendOnEnter / Shift+Enter are 0 hits in the repo). This slice adds one setting: Settings → General gets a Shortcuts section where a writable window picks Enter or Shift+Enter to send (the other key inserts a line break), stored in this window's local prefs. A read-only window only names the setting.
core/src/client/composer.js:SEND_KEYS,normalizeSendKey,readSendKey/writeSendKey,shouldSendOnKey/shouldBreakOnKey(IME and modifiers pass through),findSendButton,insertComposerNewline,installSendShortcut, and a capture listener in the composer that honours the choice.core/src/client/settings.js: the Shortcuts section in both the writable and the read-only General page.core/src/client/i18n.js: five zh keys (Shortcuts,Send shortcut,Enter to send,Shift+Enter to send, one sentence).core/test/settings-readonly-pages.test.js: three UI cases on the existing harness, plus a writablelocalStoragestub and the two export lines the harness needs.docs/subsystems/core-client.md: one line in the composer section.changelog.d/3114-send-key.added.md.
Deliberately not in this slice
- light/dark/auto/system mode: that belongs to the shell's theme service (
ctx.theme.overrideTokens,data-ds-dark-theme); the client only reads it today, and writing the same attribute from FlyBot would be a second owner for it. - Grove palette /
--bt-selected(0 references on main), language, folding, Channels. - Persisting the key through the host (
core/src/host/channel.jsis a T3 path, andsetPrefssilently drops unknown fields).
Size
12 files (6 hand-written + 6 generated), hand-written +275/−3 = 278 lines, T1 (under limits.T1 of 400 lines / 20 files). No gate file, no core/src/shared/**, topics.json untouched.
Acceptance
Hand-written red-first: with only the test changes, settings-readonly-pages gives # tests 10 / # pass 7 / # fail 3 red on the three new assertions; after the implementation # tests 13 / # pass 13 / # fail 0. build-client --check exit 0 (core/client.js 24122 → 24252). ds-bot-patches generate then check + canonical must be green on the machine that writes the branch (both need git). TZ=UTC TMPDIR=/data/flybot-tmp npm run verify exit 0. No .github/ or policy/ path in the diff.
Part of #3114. Does not close it.
Activity