Skip to content

fork: Mod+L cites selected assistant text - #19

Merged
3mdistal merged 1 commit into
fork/mainfrom
fork/cite-shortcut
Nov 4, 2026
Merged

3mdistal merged 1 commit into
fork/mainfrom
fork/cite-shortcut

Conversation

@3mdistal

@3mdistal 3mdistal commented Oct 29, 2026 •

Copy link
Copy Markdown
Owner

Selecting text in an assistant reply shows upstream's floating Cite button, which puts the selection into the composer as a citation. Alice wants the Cursor habit: highlight, press Cmd+L.

Change: while the Cite button shows, Cmd+L on a Mac (Ctrl+L on Windows and Linux) presses it. The button now reads "Cite ⌘L" (or "Cite Ctrl+L") and carries aria-keyshortcuts. It works in a side chat too: there the side chat's button shows, so Mod+L cites into the side chat, as a click does. (Upstream's Tab-to-focus stays with the foreground chat.)

  • apps/web/src/components/chat/citeSelectionShortcut.ts (new): the shortcut, built on the shared matchesKeybindingShortcut, so it follows the L key on other layouts and skips IME composition.
  • AssistantSelectionToolbar.tsx: one more capture-phase keydown listener next to upstream's Tab handler. It calls the button's click(), so the shortcut does exactly what a click does, and a too-long selection (disabled button) ignores it.
  • FORK.md: a new patch entry.

Rebased onto fork/main after the v0.1.6-alice.8 sync, and again on Nov 4 when only FORK.md conflicted. Upstream had meanwhile made the toolbar skip its Tab listener in background threads (BackgroundThreadContext); the shortcut listener sits beside it and stays on everywhere.

Why not a keybinding command: a new default rule gets written into the user's keybindings.json at startup, and stock T3 would then flag it as an invalid entry, which breaks the fork's rollback rule. So the shortcut can't be rebound, and it only takes Mod+L while the Cite button shows. The preview's Mod+L (preview.focusUrl) is untouched. No window-level handler claims Ctrl+L first: type-to-focus skips modifier chords and the desktop menu doesn't bind it.

Checks

  • citeSelectionShortcut.fork.test.ts: Cmd+L on a Mac and Ctrl+L elsewhere; the other platform's modifier, Mod+Shift+L, key-ups and composition don't match; labels.
  • AssistantSelectionToolbar.fork.browser.test.tsx (Chromium): Mod+L on a real selection cites it and clears it; with nothing selected the key isn't swallowed; a too-long selection isn't cited.
  • vp fmt, vp lint and the web typecheck pass, rerun after the rebase.
  • Real app, on an isolated dev server on the PC: drag-selected part of a Codex reply, saw "Cite Ctrl+L", pressed Ctrl+L. The chip landed in the composer and upstream's optional-comment box opened, the same as clicking Cite. A bare Ctrl+L with nothing selected changed nothing.

Not tried on a Mac build; the unit test covers the ⌘ label and Meta matching.

🤖 Generated with Claude Code

@3mdistal
3mdistal force-pushed the fork/main branch 2 times, most recently from 975ea73 to 653a852 Compare November 1, 2026 04:28
Selecting text in an assistant reply shows upstream's Cite button. Cmd+L on
a Mac, or Ctrl+L elsewhere, now presses it while it shows, and the button
shows the shortcut. The shortcut lives in the toolbar, not the keybindings
config, so stock T3 never sees an unknown command in keybindings.json.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@3mdistal

3mdistal commented Nov 4, 2026

Copy link
Copy Markdown
Owner Author

Alice's yes to land, from her Task Priorities row (Implement response annotations in the T3 Code fork). She switched the row to Agent at Nov 4, 6:03 PM ET with no new comment, accepting the suggested answer.

Land the Cmd+L cite shortcut into your T3 Code fork so it ships in the next fork release?

Suggested answer:

Land it now.

Landing at 6618453, rebased on fork/main 7b38b35, with Fork CI green on that head.

@3mdistal
3mdistal merged commit 87ec3f4 into fork/main Nov 4, 2026
32 of 34 checks passed
@3mdistal
3mdistal deleted the fork/cite-shortcut branch November 5, 2026 00:06
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.

1 participant