Skip to content

feat(composer): choose Enter or Cmd/Ctrl+Enter to send messages - #2431

Open
zandt-square wants to merge 3 commits into
block:mainfrom
zandt-square:fizz/composer-send-keys
Open

zandt-square wants to merge 3 commits into
block:mainfrom
zandt-square:fizz/composer-send-keys

Conversation

@zandt-square

@zandt-square zandt-square commented Nov 4, 2026 •

Copy link
Copy Markdown

Latest head: 048999705bc28472be1eb94ebf5bea1a5efe533d, rebased onto main at 1da5031. Three linear commits; no merge commits. Current push hooks and 4/4 Chromium/WebKit checks pass. Hosted CI: https://github.com/block/buzz-app/actions/runs/41875179848 (queued at last inspection). Earlier snapshot results below are historical, not a current hosted pass.

Summary

  • Add Settings → Appearance → Conversations → Send messages with: Enter (default) or Cmd+Enter on Apple / Ctrl+Enter elsewhere.
  • In modified-Enter mode, plain Enter inserts a new line; Shift+Enter continues to insert a line and list items keep normal editing behavior. Modified Enter sends lists rather than continuing them.
  • Save the choice on this device, update mounted composers immediately, observe other windows, and retain/retry the active choice if storage fails.
  • Preserve the existing IME, completion and repeat guards; update the bundled agent help.

Uses the existing shared composer and SettingsGroup/PreferenceRow/Select/ToastNotice/Button owners. No new CSS, plugin API, signing policy, or relay protocol changes. Local Block development sign-in configuration is git-ignored and is not included.

Validation

Implementation head: f0afac6e3cc5a27a5c6c35c03584dbfbd0e91c8f, rebased onto upstream 73255c5d7bb1cfa7c454a2d33335053c2ac18165.

  • Mandatory pre-commit hooks passed before rebase. Commit includes DCO sign-off and agent co-author credit.
  • Current-head pre-push hooks passed: TypeScript + related unit tests, design-system checks, applicable Clippy selector and machine policy.
  • Current-head Chromium and WebKit: 4/4 checks passed across composer-send-key.spec.mjs and send-key-settings.spec.mjs. Covers native editor line splitting, send, actual preference persistence and draft restoration after reload, host Settings updating a retained composer, both themes and a narrow 480px layout at 200% interface size. Fixtures use ephemeral keys and the browser host; these do not prove native identity/relay acceptance.
  • Before rebase: frontend build and design type/guard checks passed. Full Vitest: 16,407 passed / 1 failed / 21 skipped. The failure was the existing SidebarNavigation.test.tsx compiled-style test hitting its 5-second timeout. Its cause/baseline status is not yet established; no claim of a green full suite.
  • Before rebase: MessageComposer 500 tests and AppearanceSettings 23 tests passed, including the new modifier/IME/repeat/list/thread/default-switching and persistence/recovery coverage.
  • Independent read-only review by Quark found no blockers (9/10). Addressed the optional persistence-test correction and reran both browser engines.
  • Human tested the native development app with Block relay access, explicitly confirming plain Enter adds a line and Cmd+Enter sends. Rebase adds upstream changes; automated browser checks above were rerun afterward. Thread replies, restart persistence and switching back were not separately confirmed by the human.

Scope and remaining checks

Two browser scenarios added, no scenarios removed. Real browser/native caret handling and Settings-to-retained-editor integration justify this layer; modifier, IME, repeat and recovery matrices stay in mounted Vitest tests.

Draft: inspect the current hosted CI run before ready-for-review. The earlier local timeout passed on the later full-suite run described below. Broader Node/Rust/browser suites and post-rebase native acceptance remain deferred. No merge requested.

CI correction — 0277bf44bc16ae9e8498dd998f9e526039a46790

The initial hosted run's only failing job was JavaScript shard 3: the Windows preference test synchronously queried an option before Base UI exposed its popup. Changed getByRole to awaited findByRole, matching neighboring Select tests. No retry, longer timeout, weaker assertion, or product-code change.

  • Full local Vitest with the correction, on the f0afac6 working tree before committing: 16,449 passed, 21 skipped (913 files passed, 7 skipped), 875.91s with two workers. The earlier SidebarNavigation timeout passed in this run; no claim that every potential timing failure is eliminated.
  • Current correction commit: mandatory pre-commit and pre-push hooks passed, including TypeScript, related unit tests and design checks. Remote head verified.
  • New hosted run: https://github.com/block/buzz-app/actions/runs/41864882205 (queued at last inspection). The failed run on f0afac6 is historical, not a result for the corrected commit.

Separate upstream fixture correction — 6c444ce

The second hosted failure is also present on upstream main: https://github.com/block/buzz-app/actions/runs/41865346731. New harnessKit rejection coverage inherited a direct-owner signer for its workflow-shaped message, while the current deliberate fromOwner contract accepts direct-owner messages (see #2399). Explicitly use the existing untrusted mallory signer in this rejected fixture. Preserve the rejection assertion and leave all production authorization code unchanged. The requester explicitly approved including this as a separate commit.

  • Integrated upstream a457243 via a merge (no published history rewritten).
  • Full Vitest on the merged working tree plus this exact correction: 16,533 passed, 21 skipped, 914 files passed / 7 skipped, 438.58s, four workers. This tree was then committed as 6c444ce.
  • Current-head pre-push hooks passed: TypeScript/related unit tests and design checks; remote head verified, worktree clean.
  • Earlier Chromium/WebKit and native human acceptance evidence above applies to the composer implementation; these were not rerun for this test-only fixture correction. No new product behavior is claimed.
  • Draft remains pending current hosted CI and review. Do not interpret older failed runs as results for this head.

Linear-history correction

At the requester's direction, removed the main merge commit and rebased the three authored commits onto upstream 1da5031. Published with an explicit lease for prior remote 6c444ce; no unrelated remote work overwritten. Current commits:

  • c403563: composer setting
  • 1de44dd: asynchronous Select option synchronization
  • 0489997: separately approved untrusted-signer fixture correction

Added/removed patch lines against the corresponding bases are identical before and after rebase. Every commit retains DCO sign-off and co-author credit. Confirmed zero merge commits in the PR and remote head equals local. Current-head push hooks passed; both composer browser journeys passed again in Chromium and WebKit (4/4). Full-suite 16,533-pass evidence above is pre-rebase; broad checks on the new upstream base remain with hosted CI. The prior merge-based run is superseded.

zandt-square and others added 3 commits November 4, 2026 12:04
Co-authored-by: Fizz <fbf1920f313ab37ffa4c517e2437e247fe1423378e077eccc4e29f15625b9918@buzz.block.builderlab.xyz>
Signed-off-by: Zandt <zandt@squareup.com>
Wait for Base UI to expose the option instead of synchronously querying its asynchronous popup.

Co-authored-by: Fizz <fbf1920f313ab37ffa4c517e2437e247fe1423378e077eccc4e29f15625b9918@buzz.block.builderlab.xyz>
Signed-off-by: Zandt <zandt@squareup.com>
The fixture previously inherited the owner pubkey, which fromOwner intentionally accepts. Preserve rejection coverage with an explicit non-owner signer; do not change production admission policy.

Co-authored-by: Fizz <fbf1920f313ab37ffa4c517e2437e247fe1423378e077eccc4e29f15625b9918@buzz.block.builderlab.xyz>
Signed-off-by: Zandt <zandt@squareup.com>
@zandt-square
zandt-square force-pushed the fizz/composer-send-keys branch from 6c444ce to 0489997 Compare November 4, 2026 17:11
@zandt-square
zandt-square marked this pull request as ready for review November 4, 2026 17:41
@zandt-square
zandt-square requested a review from a team as a code owner November 4, 2026 17:41

@kazemek21 kazemek21 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.

🤖 Kyle reviewed this PR and the Nexus review-tracker notes and approved with no comments.

Posted by Codex (gpt-6.1-sol) on behalf of kylez.

@zandt-square

Copy link
Copy Markdown
Author

Fizz (AI agent): Rebased locally onto main at e121e52 and dropped the redundant harness-fixture correction now that #2444 supplies the upstream fix. The local branch is one squashed composer-only commit, d600ed5; the harness test file matches main exactly, and the composer implementation patch is unchanged. Publication is blocked: the full local Vitest run and subsequent pre-push related-test gate stalled/exceeded execution limits; Chromium passed both new journeys, but WebKit did not complete. I have not bypassed hooks or force-pushed an unchecked result. The remote PR still points to 0489997. Stopped my own stalled push process tree. Local worktree is clean at ~/.buzz/REPOS/buzz-app-send-keys; the next step is diagnosing the stalled local test gate, then a lease-protected push. Buzz replies are also currently refused with “not a channel member,” so this comment records the handoff.

@tellaho

tellaho commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

🤖 Correction to my design review at 048999705bc28472be1eb94ebf5bea1a5efe533d: this duplicates an existing capability. I missed #2331, merged November 5, and withdraw the recommendation to move it to an external plugin.

People can already choose Settings → Shortcuts → Sending messages → “Send with ⌘ Enter” (Ctrl+Enter elsewhere). Enabling it makes Enter add a line and the modified Enter send. Current Settings owner; composer behavior.

This PR adds the same choice under Appearance with a separate stored preference. Recommend closing it as a duplicate, as bmo already reported. This replaces my earlier launch-policy assessment.

Source-only comparison against main snapshot 70a8aebdc9656bd808f791d91b283937ec37cec9; no app, tests or rendered/keyboard checks performed.

@mahanti

mahanti commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

🤖 This duplicates the existing send-key preference added in #2331, merged November 5. It is already available under Settings → Shortcuts → Sending messages → Send with ⌘ Enter (Ctrl+Enter on Windows/Linux). Enabling it makes Enter insert a newline and ⌘/Ctrl+Enter send.

The existing implementation lives in src/app/ShortcutSettings.tsx and src/features/messages/send-key-preference.ts, with the shared composer consuming that preference. This PR introduces the same capability under Appearance with a separate preference implementation.

Recommend closing this PR as a duplicate of #2331. The earlier launch-policy assessment should be corrected: this capability is already in core, so treating it as a new setting that must move to an external plugin does not reflect the current implementation.

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.

4 participants