Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(desktop): ignore snapshot shortcut repeats during flight #11037

MergedMatthewFeroz(GitHub profile, opens in a new tab)merged 4 commits intomain fromrefs/pull/11037/headmerged by juliusmarminge View on GitHub

Rapidly repeating the SnapShot shortcut could destroy an in-flight overlay and create another renderer before the previous animation landed. Ignore shortcut repeats while a flight is running, then accept new requests immediately after landing. Repeats are dropped, not queued; accessibility extraction and acknowledgement do not extend the guard. Dismissal, disposal and failure release it.

This replaces the earlier web scheduling experiment. The final diff changes only desktop capture handling and tests.

Measured behavior

Measured animation completion in four rapid shortcut bursts

Chart generated from the recorded measurements. The before/after videos below show the actual desktop runs; the chart summarizes completion counts rather than claiming a visual smoothness or FPS improvement.

Two bursts per variant, each sending 50 requests at 100 ms intervals through the registered shortcut callback in an isolated macOS Electron app:

Combined resultsBeforeAfter
Accepted captures1410
Flights started1310
Flights completed210
Completed-flight compositor FPS120.133120.523
Completed-flight p95 frame interval9.280 ms9.324 ms

The improvement is completion under spam, not increased steady-state FPS. FPS includes only completed flights, so the baseline represents two surviving flights. One baseline capture was interrupted before its flight started. All three separately tested spaced requests completed on the patched app. These callback-driven tests bypass physical both-Shift polling; Windows is covered by unit tests rather than a native benchmark.

Validation

  • 116 focused desktop tests, including bursts on macOS/Windows and release on landing, dismissal and failure.
  • 15 web coordinator tests following removal of the rejected experiment.
  • Desktop typecheck, targeted lint/formatting and desktop build passed.
  • Desktop UI verification in isolated state. No provider, wire-contract, browser/mobile client or Linux native-animation changes. Both-Shift and configurable desktop shortcuts share this guard; direct capture calls remain unchanged.

Before video · After video · Method and limitations · Measurements

BeforeAfter
BeforeAfter

Videos were recorded separately from timing runs. Older assets on the evidence release describe the rejected scheduling experiment; the burst-* assets document this change.

Model: GPT-6. Harness: Codex.

October 4 branch update

Merged upstream main at eac52f0087d9ba5dee5542f24788d1482affae43 into this branch without rewriting its history. Updated head: 4090a6fc8c744ab8c9b3311b6e980480af046723.

  • Focused regression run: Tests 133 passed (133).
  • Scoped typechecks passed for @t3tools/desktop. Targeted lint passed; formatting and whitespace checks passed.
  • The merged source tree matches the locally validated tree. Existing screenshots and recordings document the original affected flow; this branch refresh was checked by command line. Platform-specific skips are preserved, and no new native UI verification is claimed.

Branch update validated with GPT-6.1 Sol through the Codex harness in T3 Code.

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

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

      Approvability

      Verdict: Approved at 4b6826f

      Macroscope's review found this PR approvable — This is a small, focused desktop bug fix that drops shortcut repeats only during an active snapshot animation while preserving direct captures and post-landing requests. Tests cover burst handling and guard release on macOS and Windows, with no product-default or static-analysis changes.

      No code changes detected at c77021e. Prior analysis still applies.

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

      Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

      No actionable comments were generated in the recent review. 🎉

      ℹ️ Recent review info
      ⚙️ Run configuration
      • Configuration used: Repository: pingdotgg/t3code/.coderabbit.yaml
      • Review profile: CHILL
      • Plan: Advanced
      • Run ID: 4724a4c8-ab74-4c50-9ec9-67aec21aa6ba
      📥 Commits

      Reviewing files that changed from the base of the PR and between c77021e9eff52c6894bf3ab631bd34f21bff8904 and 4090a6fc8c744ab8c9b3311b6e980480af046723.

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

      Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.


      📝 Walkthrough

      Walkthrough

      Snapshot transitions expose whether an active flight has landed. Shortcut captures are ignored during animation. Tests cover repeated triggers, post-landing capture, dismissal, and failed transitions.

      Changes

      Snapshot animation shortcut gating

      Layer / File(s)Summary
      Transition landing state
      apps/desktop/src/snapShot/SnapShotTransition.ts
      SnapShotTransition tracks flight landing and exposes isAnimating.
      Shortcut capture gating and validation
      apps/desktop/src/snapShot/DesktopSnapShot.ts, apps/desktop/src/snapShot/DesktopSnapShot.test.ts
      captureFromShortcut ignores triggers during animation. Tests verify repeated-trigger suppression, later capture acceptance, and transition state changes.

      Priority: ⬇️ Low

      Estimated code review effort: 2 (Simple) | ~10 minutes

      Change: Bug fix

      Suggested reviewers: bil0000

      Merge Risk: ⚪ Minimal · up to 4090a

      Repeated snapshot shortcut presses during an in-flight animation are ignored, and capture works again after landing. No merge-blocking risk was found.

      Architecture Summary

      Architecture risk: 🔵 Low · up to 4090a

      The change affects 1 system.

      Changed systems: apps/desktop

      Architecture concerns No architecture-level concerns identified.

      Review details

      Systems and components

      • observed — apps/desktop (service) was modified; 3 changed files map to changed impact.

      Before / after behavior

      • observed — Modified behavior in apps/desktop/src/snapShot/SnapShotTransition.ts: Added the internal landed flag to ActiveTransition for tracking completion of the flight.
      • observed — Modified behavior in apps/desktop/src/snapShot/SnapShotTransition.ts: Added the public isAnimating getter, which returns true only while an active flight exists and has not landed.
      • observed — Modified behavior in apps/desktop/src/snapShot/SnapShotTransition.ts: animateTo now marks the active transition as landed when runFlight resolves or rejects, rather than leaving completion state implicit.
      • observed — Modified behavior in apps/desktop/src/snapShot/DesktopSnapShot.test.ts: Adds a Windows/macOS test that holds the landing flight, verifies 20 shortcut triggers during flight do not start another snapshot or add overlays, then verifies a fresh trigger starts a second capture after landing, before acknowledgment. The test releases held flights and resets fixture state during cleanup.
      🚥 Pre-merge checks | ✅ 4 | ❌ 1

      ❌ Failed checks (1 warning)

      Check nameStatusExplanationResolution
      Docstring Coverage⚠️ WarningDocstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 5 files.Write docstrings for the functions missing them to satisfy the coverage threshold.
      ✅ Passed checks (4 passed)
      Check nameStatusExplanation
      Title check✅ PassedThe title clearly identifies the desktop fix: snapshot shortcut repeats are ignored during an in-flight animation.
      Description check✅ PassedThe description explains the problem, the change, its scope, and focused verification results. It also includes measured results and relevant limitations. It does not explicitly link a triaged issue o…
      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.
      • Fix all pre-merge checks with AI
      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • Create a new PR

      Comment `@coderabbitai help` to get the list of available commands.
    4. 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.

    5. juliusmarminge added labelsmacroscope-review

    6. @coderabbitai review

      Please review current head 4090a6fc8c744ab8c9b3311b6e980480af046723. The current status still says "Review rate limited", so current-head review remains outstanding despite green CI. This is one retry request; no code changes have been made since that head.

    7. coderabbitai[bot](GitHub profile, opens in a new tab)commented
      ✅ Action performed

      Review finished.

      Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

    8. juliusmarminge merged thisd608709

    9. juliusmarminge closed this

Sign in to join this conversation.