fix(desktop): ignore snapshot shortcut repeats during flight #11037
main fromrefs/pull/11037/head·merged by juliusmarminge View on GitHubRapidly 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#

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 results | Before | After |
|---|---|---|
| Accepted captures | 14 | 10 |
| Flights started | 13 | 10 |
| Flights completed | 2 | 10 |
| Completed-flight compositor FPS | 120.133 | 120.523 |
| Completed-flight p95 frame interval | 9.280 ms | 9.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
| Before | After |
|---|---|
![]() | ![]() |
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
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XS
Approvability#
Verdict: Approved at
4b6826fMacroscope'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
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).c77021e. Prior analysis still applies.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.tsapps/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.tsSnapShotTransitiontracks flight landing and exposesisAnimating.Shortcut capture gating and validation
apps/desktop/src/snapShot/DesktopSnapShot.ts,apps/desktop/src/snapShot/DesktopSnapShot.test.tscaptureFromShortcutignores 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:
bil0000Merge Risk: ⚪ Minimal · up to
4090aRepeated 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
4090aThe change affects 1 system.
Changed systems:
apps/desktopArchitecture 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
landedflag toActiveTransitionfor tracking completion of the flight. - observed — Modified behavior in apps/desktop/src/snapShot/SnapShotTransition.ts: Added the public
isAnimatinggetter, which returns true only while an active flight exists and has not landed. - observed — Modified behavior in apps/desktop/src/snapShot/SnapShotTransition.ts:
animateTonow marks the active transition as landed whenrunFlightresolves 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 name Status Explanation Resolution Docstring Coverage ⚠️ Warning Docstring 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 name Status Explanation Title check ✅ Passed The title clearly identifies the desktop fix: snapshot shortcut repeats are ignored during an in-flight animation. Description check ✅ Passed The 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 ✅ Passed Check skipped because no linked issues were found for this pull request. Out of Scope Changes check ✅ Passed Check 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.MatthewFeroz(GitHub profile, opens in a new tab) changed the title
github-actions[bot](GitHub profile, opens in a new tab) removed labelssize:XS
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:S
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.
juliusmarminge added labelsmacroscope-review
@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.
✅ 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.
juliusmarminge merged thisd608709
juliusmarminge closed this
Sign in to join this conversation.


macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes