Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(desktop): preserve browser editing shortcuts #10621

Mergedjuliusmarmingemerged 2 commits intomain fromrefs/pull/10621/headmerged by juliusmarminge View on GitHub

juliusmarmingecommented

Paste and other native editing shortcuts stopped working in the embedded browser because tabs and sign-in popups ignored every application-menu accelerator.

Allow standard editing shortcuts through when the browser has focus. Other T3 shortcuts stay blocked, and background browser input cannot enable menu edits in another renderer. Let Electron handle editing after the page has processed the key, preserving custom editor behavior.

Validation:

  • All 89 preview-manager tests pass, including platform-specific editing chords, macOS Paste and Match Style with Option held, focused tabs and sign-in popups, key release, and continued blocking of host shortcuts.
  • Targeted lint and desktop typecheck pass.
  • No layout change. Julius will supply the demo recording; interactive verification was not run by the agent.

Note

Preserve browser editing shortcuts in PreviewManager preview isolation

  • Adds a direct test suite for isPreviewEditingShortcut covering platform-specific native editing chords (primary commands, redo variants, macOS Paste and Match Style) and rejection of conflicting or unrelated modifiers and host shortcuts.
  • Updates the existing shortcut-isolation test so the preview web contents are marked focused, editing keys are excluded from generic non-host cases, and unrelated key events still leave host menu shortcuts ignored.
  • Adds a focused browser editing effect test covering both registered preview tabs and sign-in popups, verifying that focused paste enables native menu fallback, Meta key release does not disable it, a non-editing shortcut restores isolation, and unfocused guests remain isolated.
  • Updates production shortcut routing for preview tabs and sign-in popups. Only focused native editing chords reach the application menu; other shortcuts remain isolated from the host.
Macroscope summarized 493dd24.

Summary by CodeRabbit

  • Bug Fixes
    • Improved editing shortcuts in preview tabs and sign-in popups, including copy, paste, undo, redo, and text selection.
    • Added platform-specific support for macOS “Paste and Match Style” shortcuts.
    • Preserved host shortcut protection while allowing native editing commands in focused inputs.
    • Keeps background browser input from enabling editing shortcuts in another renderer.

Model: GPT-6. Harness: Codex.

    1. Bugbot is paused — on-demand spend limit reached

      Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

      A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    3. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Approved at 493dd24

      Macroscope's review found this PR approvable — This is a contained desktop bug fix that restores native browser editing shortcuts while continuing to suppress unrelated host accelerators and unfocused automation. The production change is limited to preview shortcut routing and is backed by focused cross-platform and popup/tab tests.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    4. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      Review Change Stack

      No actionable comments were generated in the recent review. 🎉

      ℹ️ Recent review info
      ⚙️ Run configuration

      Configuration used: Path: .coderabbit.yaml

      Review profile: CHILL

      Plan: Team

      Run ID: 980de99d-c727-41f3-ba85-6f21186ab549

      📥 Commits

      Reviewing files that changed from the base of the PR and between 3384b72490a58338d1031d52d2a15bf253020c63 and 493dd24630daab9e1e7786dd3cd2ccaeaabcfe45.

      📒 Files selected for processing (2)
      • apps/desktop/src/preview/Manager.test.ts
      • apps/desktop/src/preview/Manager.ts

      Included review availability: 7 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 10 reviews per hour.


      📝 Walkthrough

      Walkthrough

      Preview tabs and sign-in popups now recognize platform-specific native editing shortcuts. Application menu shortcuts change according to focused WebContents, while native editing events remain available.

      Changes

      Preview shortcut handling

      Layer / File(s)Summary
      Native editing shortcut detection
      apps/desktop/src/preview/Manager.ts, apps/desktop/src/preview/Manager.test.ts
      isPreviewEditingShortcut recognizes platform-specific copy, paste, undo, redo, and selection shortcuts. Tests cover valid and invalid modifier combinations.
      Focused preview and popup routing
      apps/desktop/src/preview/Manager.ts, apps/desktop/src/preview/Manager.test.ts
      Preview tabs and sign-in popups enable application menu shortcuts only for focused editing input. Non-editing input keeps host shortcut protection, and unfocused guest input is ignored. Tests cover both window types and event behavior.

      Estimated code review effort: 3 (Moderate) | ~20 minutes

      Merge Risk: ⚪ Minimal · up to 493dd

      This change preserves native editing shortcuts in focused preview and sign-in browser contents while retaining application shortcut isolation. No concrete merge-blocking risk remains.

      Sequence Diagram(s)

      sequenceDiagram
        participant PreviewTab
        participant SignInPopup
        participant ApplicationMenu
        PreviewTab->>ApplicationMenu: enable shortcuts for focused editing input
        SignInPopup->>ApplicationMenu: enable shortcuts for focused editing input
        PreviewTab->>PreviewTab: preserve native editing event
        SignInPopup->>SignInPopup: ignore editing input when unfocused
        PreviewTab->>ApplicationMenu: disable shortcuts for non-editing input

      Suggested reviewers: maria-rcks, t3dotgg

      🚥 Pre-merge checks | ✅ 5
      ✅ Passed checks (5 passed)
      Check nameStatusExplanation
      Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
      Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
      Title check✅ PassedThe title clearly and concisely describes the primary change: preserving browser editing shortcuts in the desktop application.
      Description check✅ PassedThe description explains what changed, why it changed, scope, validation results, UI impact, and remaining verification work. It does not reproduce the checklist headings, but the required information…
      ✨ Finishing Touches
      📝 Generate docstrings
      • Create stacked PR
      • Commit on current branch
      🧪 Generate unit tests (beta)
      • Create PR with unit tests
      • Commit unit tests in branch `fix-browser-keyboard-shortcuts`

      Comment `@coderabbitai help` to get the list of available commands.
    5. Thread transfer impact

      ✅ Thread transfer remains within every enforced ceiling.

      ProviderMetricMain baselineThis PRImpactPR ceiling
      CodexTotal thread wire13.6 KiB13.5 KiB−11 B (−0.1%)15.1 KiB✅
      CodexThread snapshot wire7.0 KiB7.0 KiB−1 B (−0.0%)7.3 KiB✅
      CodexLive turn WebSocket wire6.5 KiB6.5 KiB−10 B (−0.2%)7.8 KiB✅
      CodexLive turn WebSocket decoded57.0 KiB57.0 KiB0 B (0.0%)66.4 KiB✅
      CodexLive turn messages880 (0.0%)21✅
      ClaudeTotal thread wire13.6 KiB13.6 KiB−24 B (−0.2%)15.1 KiB✅
      ClaudeThread snapshot wire7.0 KiB7.1 KiB+4 B (+0.1%)7.3 KiB✅
      ClaudeLive turn WebSocket wire6.5 KiB6.5 KiB−28 B (−0.4%)7.8 KiB✅
      ClaudeLive turn WebSocket decoded57.9 KiB57.8 KiB−44 B (−0.1%)66.4 KiB✅
      ClaudeLive turn messages109−1 (−10.0%)21✅

      Baseline: ea2983a · PR result: 493dd24 · Source CI: success

      Scenario and decoded snapshot size

      10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

      • Codex decoded thread snapshot: 113.9 KiB
      • Claude decoded thread snapshot: 114.6 KiB

      Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

    6. juliusmarminge merged thise0e0bcb

    7. juliusmarminge closed this

Sign in to join this conversation.