fix(desktop,web): improve in-app browser shortcuts and URL behavior - #4703
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| const hoverOutline = createBox(PRIMARY, PRIMARY_FILL); | ||
| const marqueeBox = createBox(PRIMARY, PRIMARY_FILL); | ||
| root.append(hoverOutline, marqueeBox); | ||
| root.addEventListener("keydown", (event) => { |
There was a problem hiding this comment.
🟡 Medium preview/PickPreload.ts:380
The keydown handler on root calls stopPropagation() only in the bubbling phase, so it does not stop capture-phase keydown listeners that the inspected page has already registered on window or document. Those listeners run before this handler and can still react to keystrokes typed in annotation controls (e.g. a page-level Space/Enter binding fires while the comment textarea is focused). Use stopImmediatePropagation() in a capture-phase listener, or attach the listener with { capture: true }, so page-level capture listeners are also isolated.
🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file @apps/desktop/src/preview/PickPreload.ts around line 380:
The `keydown` handler on `root` calls `stopPropagation()` only in the bubbling phase, so it does not stop capture-phase `keydown` listeners that the inspected page has already registered on `window` or `document`. Those listeners run before this handler and can still react to keystrokes typed in annotation controls (e.g. a page-level Space/Enter binding fires while the comment textarea is focused). Use `stopImmediatePropagation()` in a capture-phase listener, or attach the listener with `{ capture: true }`, so page-level capture listeners are also isolated.
ApprovabilityVerdict: Needs human review This PR adds new keyboard shortcut behaviors (Cmd/Ctrl+Enter to send annotations, Cmd/Ctrl+R to refresh) which constitute new user-facing features. Additionally, there's an unresolved review comment about event capture-phase handling that could allow page listeners to still intercept annotation keystrokes. You can customize Macroscope's approvability policy. Learn more. |
e6173c9 to
f7d02b1
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit f7d02b1. Configure here.
## What's Changed * fix(web): better right panel (new diffs styling) by @maria-rcks in pingdotgg/t3code#5260 * fix(server): keep regenerated titles on topic by @t3dotgg in pingdotgg/t3code#5365 * refactor(server): make title prompts plaintext by @t3dotgg in pingdotgg/t3code#5368 * feat(web): configurable fonts and sizes under Settings → Appearance by @StiensWout in pingdotgg/t3code#5103 * feat(sidebar-v2): bring back thread pinning by @t3dotgg in pingdotgg/t3code#5312 * feat(web): make pairing QR codes actually scannable, with endpoint choice by @t3dotgg in pingdotgg/t3code#5360 * fix(desktop,web): improve in-app browser shortcuts and URL behavior by @t3dotgg in pingdotgg/t3code#4703 * fix(web): prevent legacy model picker layout shift by @FllipEis in pingdotgg/t3code#5349 * fix(server): allow remote updates with database migrations by @t3dotgg in pingdotgg/t3code#5374 **Full Changelog**: pingdotgg/t3code@v0.0.32-nightly.20260804.1000...v0.0.32-nightly.20260805.1002 Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.32-nightly.20260805.1002
…ingdotgg#4703) (cherry picked from commit 94696b0)

Summary
Steering is intentionally out of scope.
Verification
Note
Medium Risk
Touches IPC contracts, composer send path, and keyboard interception in guest webviews; behavior changes are user-facing but scoped to preview/annotation flows with new unit tests.
Overview
Improves preview annotation keyboard flow and chrome behavior in the desktop app.
Annotation attach vs send:
pickElementnow returns{ annotation, submission }(attach|send) via new contract types. In the guest overlay, Enter attaches to the composer draft and Cmd/Ctrl+Enter sends immediately;resolveAnnotationSubmissioncentralizes that mapping. Editor keydown uses bubble-phase handling withstopImmediatePropagationso the inspected page does not steal shortcuts. Send intent wires throughPreviewView→ChatView.onSendwith optional screenshot attachment; send still proceeds if screenshot conversion fails.Preview refresh: Cmd/Ctrl+R in the focused preview webview reloads that page (
isPreviewRefreshShortcut) instead of reloading the host app.Address bar: Removes
displayUrl/formatPreviewUrlaliasing; the chrome row shows the full raw URL (path, query, fragment) when unfocused.Reviewed by Cursor Bugbot for commit 1cec8c1. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add Enter/Cmd+Enter annotation submission shortcuts and fix in-app browser URL display
resolveAnnotationSubmissionin AnnotationKeyboard.ts to map keyboard events to submission intent: bare Enter attaches, Cmd/Ctrl+Enter sends, Shift+Enter and IME composition are ignored.pickElementin Manager.ts to return{ annotation, submission }instead of a bare annotation payload; screenshot failures no longer abort the pick.isPreviewRefreshShortcutso Cmd/Ctrl+R reloads the preview tab when intercepted at the main processbeforeInputstage.sendsubmission intent through PreviewView.tsx and ChatView.tsx so Cmd/Ctrl+Enter on an annotation immediately triggers a chat send.displayUrlalias/tooltip from PreviewChromeRow.tsx; the address bar now always shows the full URL.DesktopPreviewBridge.pickElementnow returnsPreviewAnnotationSubmissionResult | nullinstead ofPreviewAnnotationPayload | null, requiring callers to destructure the result.Macroscope summarized 1cec8c1.
Changes prepared by GPT-5.6 Sol in the Codex harness.