Skip to content

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

Merged
juliusmarminge merged 4 commits into
pingdotgg:mainfrom
MatthewFeroz:t3code/improve-snapshot-animation-performance
Oct 18, 2026
Merged

juliusmarminge merged 4 commits into
pingdotgg:mainfrom
MatthewFeroz:t3code/improve-snapshot-animation-performance

Conversation

@MatthewFeroz

@MatthewFeroz MatthewFeroz commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

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

@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Sep 10, 2026
@macroscopeapp

ghost commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

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.

@coderabbitai

ghost commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

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 c77021e and 4090a6f.

📒 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 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
MatthewFeroz marked this pull request as draft September 10, 2026 03:21
@MatthewFeroz MatthewFeroz changed the title fix(desktop): defer snapshot processing until animation lands fix(desktop): ignore snapshot shortcut repeats during flight Sep 10, 2026
@MatthewFeroz
MatthewFeroz marked this pull request as ready for review September 10, 2026 03:38
@github-actions github-actions Bot added size:S 10-29 changed lines (additions + deletions). and removed size:XS 0-9 changed lines (additions + deletions). labels Sep 10, 2026
@cursor

ghost commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

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 juliusmarminge added the macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews label Oct 1, 2026 — with ChatGPT Codex Connector
@MatthewFeroz

ghost commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please review current head 4090a6f. 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.

@coderabbitai

ghost commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor
✅ 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews size:S 10-29 changed lines (additions + deletions). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants