Repository navigation
fix(web): Mod+B toggles bold at a collapsed cursor when the sidebar toggle is remapped - #29445
Conversation
Rewrites the Mod+B composer test to expect standard Tiptap behaviour: with a collapsed cursor and no app shortcut on Mod+B, the next typed text is bold. Fails on main because ComposerBoldSelectionOnlyExtension swallows collapsed Mod+B. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s remapped The composer swallowed collapsed Mod+B so it would never bold by accident, even when no app shortcut was bound to it. The sidebar's capture-phase listener already keeps the chord for the toggle unless text is selected, so drop the editor-side guard and let the keybinding layer decide. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — Enables bold-at-cursor when the sidebar shortcut is remapped and adjusts formatting at Markdown marker boundaries. Default sidebar shortcut behavior remains unchanged, and the effects are limited to interactive composer formatting. Notes:
No code changes detected at You can add or adjust custom eligibility rules. Learn more. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
# Conflicts: # apps/web/src/components/ComposerPromptEditorTiptap.input.browser.test.tsx # apps/web/src/components/ComposerPromptEditorTiptap.tsx
…rkdown source The Markdown-source shortcuts only handled a non-empty selection, so a collapsed toggle inside shown markers fell through to Tiptap and typed text landed inside the source (`**now **done****`). Parse the source first for collapsed carets too, as the selection path already does. AI-assisted; verified with the tests and tools listed above. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Only a collapsed caret next to shown markers goes through the source toggle; elsewhere Tiptap's own toggle nests the style as before, instead of the re-reveal dropping the stored mark. AI-assisted; verified with the tests and tools listed above. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Only turning a style off just inside its own shown markers goes through the source toggle. Adding a style at a marker boundary falls back to Tiptap's toggle, as before, instead of the re-reveal dropping the stored mark. AI-assisted; verified with the tests and tools listed above. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
commented
Nov 11, 2026
|
The automated pipeline stopped on this pull request and will not merge it: someone else pushed to fix/issue-29426 (head is now 1ba5ee5); the pipeline does not build on commits it did not review It stays open for a person to finish or close. |
Dismissing prior approval to re-evaluate 238091e
AI-assisted; verified with the tests and tools listed above. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Dismissing prior approval to re-evaluate 7e5d328
commented
Nov 11, 2026
Thread transfer impact
This comment will update automatically after the next completed run. |
commented
Nov 11, 2026
EvidenceLinux Chromium, 1280×800, light theme, fresh synthetic data on both commits. With Rich text composer enabled, remap sidebar.toggle to Alt+B, then type
Recordings show the same scripted interactions at half speed. Detail images are enlarged crops of the full captures. Scenario/driver. AI-assisted; verified with the tests and tools listed above. Not shown:
|
commented
Nov 12, 2026
EvidenceEnvironment for every capture: Linux Chromium 156, real web dev app, 1280×800, light theme, fresh isolated synthetic project, replay provider. Enable Rich text composer. Remap Sidebar: Toggle to Alt+B. In an empty composer type x, Ctrl+B, y, Ctrl+B, z. Select all and Ctrl+B. Clear formatting and the draft, restore the default Ctrl+B sidebar binding, repeat the typing sequence, then select all and Ctrl+B. Proven: scenarios:prove exited 0. Base left xyz plain; head bolded only y and left the sidebar open. With the default binding, Ctrl+B toggled the sidebar and typing stayed plain. Selection bolding worked with either binding on both commits.
AI-assisted; verified with the tests and tools listed above. Not shown:
|
















Problem
After moving
sidebar.toggleoff Mod+B, pressing Mod+B in the rich-text composer with nothing selected still does nothing. It should toggle bold for the next typed text, as Tiptap normally does. Reproduction on main: remapsidebar.toggletoalt+b, typex, press Ctrl+B (Cmd+B on macOS), typey. The result is<p>xy</p>, with no bold.Change
This removes
ComposerBoldSelectionOnlyExtension, the editor-level guard that swallowed Mod+B whenever the selection was empty, whatever the keybinding. The guard is only needed while Mod+B toggles the sidebar, and in that case the capture-phase listener inAppSidebarLayoutalready takes collapsed Mod+B (preventDefault+stopPropagation) before Tiptap sees it. It lets the chord through only when text is selected. With the guard gone, the keybinding layer alone decides:The
isRichTextBoldShortcutcomment is reworded to match.Scope and approval
Fixes #29426
Triaged via the automated issue flow.
Verification
ComposerPromptEditorTiptap.input.browser.test.tsx› "bolds with Mod+B at a collapsed cursor and over a selection". This rewrites the old "only when text is selected" test, which mounted the editor alone and asserted the buggy behavior.expected [] to deeply equal [' now']. With the fix it passes.vp run check:changed: format, lint, knip, typecheck (2 packages), tests (4 files) and react compiler all pass.vp run devon a fresh database, Chromium on Linux (Mod = Ctrl), viewport 1280x800, light theme. Keys were sent as trusted key presses; the composer HTML was read from the editor.alt+b(remapped)<p>xyz</p>, no bold<p>x<strong>y</strong>z</p>, sidebar unchangedmod+b(default)<p>plain after</p>, sidebar collapses<p>xy</p>, sidebar collapses (unchanged)alt+b: "plain after" boldedmod+b: "xy" boldedComposer with
sidebar.toggleonalt+b, after x, Ctrl+B, y, Ctrl+B, z. Same dev server and data on both sides; the before side served main's sources.The diff is 180 px at threshold 0 and 129 px at 10% fuzz. Besides the bold
y, it shows the text caret (visible only in the before frame, which caught a blink), the sidebar thread's relative time ("14m" before vs "10m" after, because the before frame was taken later), and a few anti-aliased pixels on the send button.Not checked: macOS (Cmd) and the desktop shell. Both use the same key handling, and the desktop menu has no Mod+B accelerator.
Model and harness: Claude Opus 5.5 (lead, test, fix, review B) and GPT-6.1 Sol (review A), in T3 Code via the Claude Code and Codex harnesses.
🤖 Generated with Claude Code