Skip to content

fix(web): keep large image previews from stalling composer typing - #11324

Open
shivamhwp wants to merge 1 commit into
fix/client-device-ticket-http-groupfrom
fix/web-bounded-composer-thumbnails
Open

fix(web): keep large image previews from stalling composer typing#11324
shivamhwp wants to merge 1 commit into
fix/client-device-ticket-http-groupfrom
fix/web-bounded-composer-thumbnails

Conversation

@shivamhwp

@shivamhwp shivamhwp commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

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.

@cursor

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

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Sep 11, 2026
@macroscopeapp

macroscopeapp Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 3790689

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.

@github-actions

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

ℹ️ No successful main baseline artifact is available yet. This run establishes the initial measurement.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 13.6 KiB 15.1 KiB
Codex Thread snapshot wire 7.1 KiB 7.3 KiB
Codex Live turn WebSocket wire 6.6 KiB 7.8 KiB
Codex Live turn WebSocket decoded 57.1 KiB 66.4 KiB
Codex Live turn messages 10 21
Claude Total thread wire 13.6 KiB 15.1 KiB
Claude Thread snapshot wire 7.1 KiB 7.3 KiB
Claude Live turn WebSocket wire 6.5 KiB 7.8 KiB
Claude Live turn WebSocket decoded 57.8 KiB 66.4 KiB
Claude Live turn messages 9 21

Baseline: unavailable · PR result: 3790689 · 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.

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

Labels

size:M 30-99 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant