fix(web): keep large image previews from stalling composer typing - #11324
fix(web): keep large image previews from stalling composer typing#11324shivamhwp wants to merge 1 commit into
Conversation
Bugbot is paused — on-demand spend limit reachedBugbot 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. |
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a narrowly scoped composer performance fix that replaces expensive full-resolution tile rendering with cached 256px thumbnails while preserving existing attachment behavior. The production changes are isolated to preview rendering and the supporting image utility, with targeted tests and no default, schema, deployment, or sensitive-area changes. You can add or adjust custom eligibility rules. Learn more. |
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: unavailable · PR result: Scenario and decoded snapshot size10 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.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
Attaching a very tall image can stall typing because the composer renders the full-resolution image in a tiny preview. Cache a centered thumbnail up to 256 × 256 pixels for both composer layouts, and retain the original file for sending and expanded viewing. Animated images use a static composer thumbnail.
Refs #10361. The original base64 draft persistence still incurs storage writes, so this addresses the preview cost only. Stacked on #11298.
Validation: 29 focused tests and web typecheck pass. Scoped lint matches all 35 existing base warnings. In an isolated Electron client, a 2304 × 32766 PNG produced 28 typing long tasks before the change and zero after thumbnail readiness. Median beforeinput-to-second-animation-frame time fell from 33.8 ms to 17.6 ms; this is not native key-to-paint latency. Reload preserved the original file's SHA-256 and regenerated the thumbnail; expanded viewing retained the original dimensions. Storage writes still reached 29 ms. Web and desktop share this composer; mobile, providers and wire contracts are unchanged.
Captured before/after images and typing video. Uploading these assets to GitHub remains pending because the background browser connection is unavailable.
Model: GPT-6. Harness: Codex.