fix(web): send mod-enter drafts in the foreground#14443

closed1
main
GitHub fork: fix/draft-mod-enter-foreground
openedSep 30, 2026byMmdshzb04
View on GitHubTwo-way sync enabledPR last imported 11d ago

Fixes #14429

What Changed

composerSubmissionIntentForEnter returns background for Mod+Enter on a draft only when Enter itself sends. When the send shortcut is mod-enter, or mod-enter-multiline and the draft has a newline, Mod+Enter sends in the foreground. Mod+Shift+Enter starts that draft in the background.

Why

With ⌘ + Enter always, the last line still treated any modifier on a draft as a background start, so the send key never sent the first message. After the first message the thread is no longer a draft, which is why the same shortcut worked on later turns. Maintainer triage on #14429 points at that line. Mod+Shift+Enter is unused on a draft (it only overrides follow-up while a turn is running), so background start keeps a shortcut in those modes.

The keybindings doc said Mod+Enter always starts a new thread in the background. That is only true when Enter sends.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Checks

19 successful · 6 skipped
All checks passed
37ea301

Added 1 commit

  • fix(web): send mod-enter drafts in the foreground37ea301
Synced from GitHub

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: pingdotgg/t3code/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 51b9ac82-a18d-4b17-b44b-ab95a2a09365

📥 Commits

Reviewing files that changed from the base of the PR and between c2fa9fc911daeac97df4760f95fc57dca42b84c8 and 37ea301e50a37629e8a2ec9ec4b774ff606364c3.

📒 Files selected for processing (3)
  • apps/web/src/composer-logic.test.ts
  • apps/web/src/composer-logic.ts
  • docs/user/keybindings.md

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

Draft-thread submission intent now distinguishes the configured send shortcut and Shift state. Parameterized tests cover shortcut, prompt-length, and Shift combinations. The keybinding documentation describes when new threads start in the background.

Changes

Draft thread submission

Layer / File(s)Summary
Draft thread submission intent
apps/web/src/composer-logic.ts, apps/web/src/composer-logic.test.ts, docs/user/keybindings.md
The submission logic accounts for the modifier and Shift state when deciding draft-thread intent. Tests cover shortcut and prompt-length combinations. Documentation describes the conditional background shortcut.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Low

Suggested reviewers: juliusmarminge

Merge Risk: ⚪ Minimal · up to 37ea3

The change makes modifier-based sending start new threads in the foreground while preserving the configured background shortcuts. No merge-blocking issue is established; merge after normal checks pass.

Architecture Summary

Architecture risk: 🔵 Low · up to 37ea3

The change affects 2 systems.

Changed systems: apps/web, docs

Architecture concerns No architecture-level concerns identified.

Review details

Systems and components

  • observed — apps/web (ui) was modified; 2 changed files map to changed impact.
  • observed — docs (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in apps/web/src/composer-logic.test.ts: Added draft-thread cases to composerSubmissionIntentForEnter tests, specifying expected intents for shortcut, prompt length, and Shift-key combinations.
  • observed — Modified behavior in apps/web/src/composer-logic.ts: Shift now suppresses submission unless the required modifier is pressed and the thread is running or a draft; previously, only running threads could satisfy this exception.
  • observed — Modified behavior in apps/web/src/composer-logic.ts: Draft threads with the modifier now select "background" when no modifier is required or Shift is pressed. Other cases now return "foreground" directly; previously the background choice depended only on the modifier and draft-thread state.
  • observed — Modified behavior in docs/user/keybindings.md: The new-thread background shortcut is now documented conditionally: mod+Enter applies when Enter sends, and mod+Shift+Enter applies when sending requires mod+Enter. The previous unconditional statement that mod+Enter starts a new thread in the background is removed.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check nameStatusExplanationResolution
Docstring Coverage⚠️ WarningDocstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. (1 skipped: 1 …Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check nameStatusExplanation
Linked Issues check✅ PassedIssue #14429 requires Cmd+Enter on a new draft thread to start in the foreground when the setting requires the modifier, including multiline prompts. composerSubmissionIntentForEnter returns `"foreg…
Out of Scope Changes check✅ PassedThe changed source logic, parameterized tests, and keybindings documentation all support issue #14429. The documentation clarifies the preserved background behavior when Enter sends and the new backgr…
Title check✅ PassedThe title clearly and concisely describes the main change: Mod+Enter sends draft messages in the foreground.
Description check✅ PassedThe description explains what changed, why it changed, and the affected send-shortcut modes. The unchecked screenshot and video items are appropriate because the changes do not add visual UI changes o…
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Comment @coderabbitai help to get the list of available commands.

Synced from GitHub

Approvability

Verdict: Approved at 37ea301

Macroscope's review found this PR approvable — This is a small, self-contained composer bug fix with targeted coverage and documentation, preserving the existing default setting while correcting behavior for explicitly selected modifier-based send modes. No schema, security, infrastructure, or static-analysis configuration changes are involved.

You can add or adjust custom eligibility rules. Learn more.

Note

This comment is posted by Julius' dot

The change follows #14429's direction, and CI shows all 91 composer-logic tests passing. The verification rule also requires evidence of the changed interaction. Please attach a short before/after recording showing the first send for Mod+Enter and multiline modes, plus Mod+Shift+Enter background start. The issue's reproduction shows the original problem, not the corrected behavior. Request reconsideration once that evidence is attached.