Skip to content

fix(desktop,web): improve in-app browser shortcuts and URL behavior - #4703

Merged
t3dotgg merged 4 commits into
mainfrom
t3code/fix-browser-shortcuts-and-url
Aug 5, 2026
Merged

fix(desktop,web): improve in-app browser shortcuts and URL behavior#4703
t3dotgg merged 4 commits into
mainfrom
t3code/fix-browser-shortcuts-and-url

Conversation

@t3dotgg

@t3dotgg t3dotgg commented Jul 28, 2026

Copy link
Copy Markdown
Member

Summary

  • make Enter attach a browser annotation and Cmd/Ctrl+Enter send it immediately
  • isolate annotation editor key events from the inspected page
  • always show the complete browser URL, including path, query, and fragment
  • route Cmd/Ctrl+R to the focused preview web contents instead of reloading T3 Code

Steering is intentionally out of scope.

Verification

  • vp test run apps/desktop/src/preview/AnnotationKeyboard.test.ts apps/desktop/src/preview/Manager.test.ts apps/web/src/components/preview/PreviewChromeRow.test.tsx apps/web/src/components/preview/PreviewView.test.tsx
  • vp run --filter @t3tools/contracts --filter @t3tools/desktop --filter @t3tools/web typecheck
  • targeted vp lint for changed files

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: pickElement now 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; resolveAnnotationSubmission centralizes that mapping. Editor keydown uses bubble-phase handling with stopImmediatePropagation so the inspected page does not steal shortcuts. Send intent wires through PreviewViewChatView.onSend with 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 / formatPreviewUrl aliasing; 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

  • Adds resolveAnnotationSubmission in AnnotationKeyboard.ts to map keyboard events to submission intent: bare Enter attaches, Cmd/Ctrl+Enter sends, Shift+Enter and IME composition are ignored.
  • Updates pickElement in Manager.ts to return { annotation, submission } instead of a bare annotation payload; screenshot failures no longer abort the pick.
  • Adds isPreviewRefreshShortcut so Cmd/Ctrl+R reloads the preview tab when intercepted at the main process beforeInput stage.
  • Wires the send submission intent through PreviewView.tsx and ChatView.tsx so Cmd/Ctrl+Enter on an annotation immediately triggers a chat send.
  • Removes the displayUrl alias/tooltip from PreviewChromeRow.tsx; the address bar now always shows the full URL.
  • Behavioral Change: DesktopPreviewBridge.pickElement now returns PreviewAnnotationSubmissionResult | null instead of PreviewAnnotationPayload | null, requiring callers to destructure the result.

Macroscope summarized 1cec8c1.

Changes prepared by GPT-5.6 Sol in the Codex harness.

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 06c34672-b552-4814-865d-932433d5a0e4

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch t3code/fix-browser-shortcuts-and-url

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.

❤️ Share

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

@github-actions github-actions Bot added size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Jul 28, 2026
Comment thread apps/desktop/src/preview/PickPreload.ts Outdated
const hoverOutline = createBox(PRIMARY, PRIMARY_FILL);
const marqueeBox = createBox(PRIMARY, PRIMARY_FILL);
root.append(hoverOutline, marqueeBox);
root.addEventListener("keydown", (event) => {

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.

🟡 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.

Comment thread apps/web/src/components/preview/PreviewView.tsx Outdated
Comment thread apps/web/src/components/ChatView.tsx
@macroscopeapp

macroscopeapp Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: 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.

Comment thread apps/desktop/src/preview/PickPreload.ts Outdated
@t3dotgg t3dotgg changed the title Fix in-app browser keyboard and URL behavior fix(desktop,web): improve in-app browser shortcuts and URL behavior Aug 4, 2026
@t3dotgg
t3dotgg force-pushed the t3code/fix-browser-shortcuts-and-url branch from e6173c9 to f7d02b1 Compare August 4, 2026 21:16

@cursor cursor Bot 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.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ 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.

Comment thread apps/web/src/components/ChatView.tsx
@t3dotgg
t3dotgg merged commit 94696b0 into main Aug 5, 2026
17 checks passed
@t3dotgg
t3dotgg deleted the t3code/fix-browser-shortcuts-and-url branch August 5, 2026 00:01
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Aug 5, 2026
## 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
cursor Bot pushed a commit to aaditagrawal/t3code that referenced this pull request Aug 6, 2026
cursor Bot pushed a commit to aaditagrawal/t3code that referenced this pull request Aug 6, 2026
cursor Bot pushed a commit to aaditagrawal/t3code that referenced this pull request Aug 6, 2026
cursor Bot pushed a commit to aaditagrawal/t3code that referenced this pull request Aug 6, 2026
cursor Bot pushed a commit to aaditagrawal/t3code that referenced this pull request Aug 6, 2026
vortechron pushed a commit to vortechron/void that referenced this pull request Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant