Repository navigation
fix: pasted chat images keep the wrong aspect ratio until remount - #185154
Conversation
Update mounted previews from decoded and uploaded dimensions without letterboxing. Preserve bounded extreme-ratio images and reachable file actions. Co-authored-by: steipete <[email protected]>
Worked on by: - @steipete Co-authored-by: steipete <[email protected]> OpenClaw-Publication: 8203623d-14db-4e6a-ab2c-54ea797ce538
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesChat image previews update their aspect ratio from uploaded or decoded dimensions without requiring a remount. Example: Paste and send a 1200 × 563 image.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a current preview-sizing defect, resolves the previous menu-overlap finding, and has no remaining actionable findings; exact-head CI is still pending. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Control UI image presentation owner combines image metadata and decoded pixels into a mounted preview, while existing resource and viewer owners handle downloads and opening. flowchart LR
A[Clipboard or saved image] --> B[Existing image presentation owner]
C[Uploaded dimensions] --> B
D[Decoded image dimensions] --> B
B --> E[Reactive image frame]
E --> F[Preview and file actions]
Technical reviewBest possible solution: Use the existing image presentation owner to update mounted geometry while reserving enough outer space for extreme-ratio file actions. Do we have a high-confidence way to reproduce the issue? Current-main source freezes the initial fallback ratio, matching the supplied real-Gateway before screenshot; no target code was executed during this read-only review. Is this the best way to solve the issue? The patch fixes the frozen derivation at its existing owner, preserves the image resource lifecycle, and removes the superseded renderer and untrack allowance. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 50b9e88fd3c3. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +45, Tests +89, Docs 0, Other -1. Total +133 across 8 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 26, 2026, 8:01 PM ET / October 27, 2026, 00:01 UTC (Revision 2). |
Co-authored-by: steipete <[email protected]>
Read live composer membership before reconciling completed reads. Keep exact-byte E2E assertions compact instead of logging multi-megabyte payload diffs. Co-authored-by: steipete <[email protected]>
Co-authored-by: steipete <[email protected]>
|
Merged via squash.
|
…enclaw#185154) * fix: pasted chat images keep the wrong aspect ratio until remount Update mounted previews from decoded and uploaded dimensions without letterboxing. Preserve bounded extreme-ratio images and reachable file actions. Co-authored-by: steipete <[email protected]> * fix: pasted chat images keep the wrong aspect ratio until remount Worked on by: - @steipete Co-authored-by: steipete <[email protected]> OpenClaw-Publication: 8203623d-14db-4e6a-ab2c-54ea797ce538 * fix(ui): reserve short image action footprints Co-authored-by: steipete <[email protected]> * fix(ui): preserve attachment order across stale preview renders Read live composer membership before reconciling completed reads. Keep exact-byte E2E assertions compact instead of logging multi-megabyte payload diffs. Co-authored-by: steipete <[email protected]> * test(ui): return void from attachment cleanup Co-authored-by: steipete <[email protected]> --------- Co-authored-by: steipete <[email protected]>
What Problem This Solves
Fixes: pasted chat images keep a padded 3:2 frame until the conversation is remounted, even after their actual dimensions are available.
User Impact
Single-image previews immediately use the image's aspect ratio and retain it after returning from Settings or reloading. Very wide and tall previews remain bounded without distortion, and their file actions remain reachable. No configuration changes or migration are required.
Why This Change Was Made
The mounted frame deliberately froze its initial dimensions. It now derives geometry from the existing image presentation owner, using decoded dimensions only when durable upload dimensions are absent. The frame has one dedicated Solid component; no new cache or state owner is introduced. The obsolete untrack allowance and minimum-height letterboxing are removed.
The simplification pass retained the existing resource owner and moved its frame rather than introducing a parallel renderer. Production changes add 47 net lines for reactive geometry and reachable extreme-ratio actions; regression tests add 125 net lines.
Evidence
Gateway status with native account identity > keeps shared chat usable without polling operator-only surfacesexpected no operator-only requests but receivedboard.getatgateway-status.e2e.test.ts:63. The same test and assertion fail in scheduled main 40413333913, job 121889752226; PR failure is job 121909881637. Shard numbers differ. This is not an image-rendering flow. All other non-aggregate CI jobs, includingsecurity-fast, passed or were skipped. That attribution does not establish CI success for the review-repair head; its current checks are evaluated separately.Before
After
Review repair: short panoramas
ClawSweeper identified a real action-layout regression: a 1200 × 30 image retained a natural-ratio surface shorter than its 44px menu, allowing the menu to cover the following preview. The outer frame now reserves the menu footprint only when those file actions exist; the image surface keeps its ratio. The new browser regression fails on the reviewed head (next preview top 23.6875 < menu bottom 44) and passes with this repair. All 30 geometry cases and the 5 image-loading E2E cases pass again; canonical production UI typecheck (
pnpm tsgo:ui), targeted lint/format, stylesheet and controller checks pass. An extra editor/test-widetscinvocation reported untouched native-desktop bridge and quota-reset declaration errors; it is not reported as passing. These screenshots show the actual production-component browser fixture, not the real-Gateway clipboard capture above.Before
After
Prior-head CI investigation
Run 40422570301 ended cancelled: checks-ui-e2e (3/7) exceeded its 25-minute job deadline; 63 jobs completed successfully or skipped; the downstream CI gate failed. The job annotation confirms the timeout, but its logs are absent from both the job endpoint (BlobNotFound) and full run archive, and no timeout diagnostic artifact was uploaded.
pnpm test:ci-failed 185154selected no Vitest failure. This is not green CI and its cause remains unproven.Replayed the exact CI checkout
056271de0e84b393c07e1940a6d71bc114d2a783, include set, 3/6 Vitest shard, and four workers in an isolated local checkout with locked dependencies: 53 files/222 tests passed; the two-large-PNG case inchat-outbox-capacity.e2e.test.tsfailed with reversed attachment bytes. That same focused test fails on the actual CI main parentf27bfa85c993fc64964cb19220d55f0934d7dd3e(two other cases pass), establishing a pre-existing local ordering defect—not the cause of the logless CI timeout. Local execution also reported file-watcher EMFILE warnings, so it is not claimed as CI-equivalent passing proof. Original image-ratio and panorama checks remain passing.CI repair: attachment ordering
The reproduced two-large-PNG failure is now repaired. Native browser tracing showed the preview reconciling read membership from a stale attachment prop: after the first read completed, its ready slot was removed and later appended behind the second slot. The preview now uses the existing live composer accessor before reconciliation; no new state or order owner is added.
The focused regression fails before the repair with
[second.png, first.png]and passes afterward. All 28 attachment consumer tests pass (1.61s file duration; 8.46s wrapper wall), as do all 20 mocked-Gateway E2E cases across capacity and read-lifecycle files (83.10s including UI build). The three capacity cases preserve exact ordered durable, transport and displayed bytes; large byte comparisons now emit bounded boolean failures instead of multi-megabyte Base64 diffs. Canonicalpnpm tsgo:ui, three-file type-aware lint, formatting andgit diff --checkpass. Independent Codex P0–P2 review of this repair reports no actionable findings. The prior logless CI timeout is not retrospectively attributed to this bug; the repaired head has a fresh CI run.A subsequent hosted test-type check caught the new cleanup callback returning Vitest utilities instead of void. The callback now discards that return value explicitly;
node scripts/run-tsgo.mjs --noEmit -p test/tsconfig/tsconfig.core.test.ui-chat.jsonpasses and all 28 attachment tests pass throughpnpm testagain. A direct, non-wrapper Vitest invocation also passed 28 tests but reported an Undici teardown exception; its run is not counted as passing, and the supported wrapper replay had no unhandled errors. This mechanical test-only correction does not change production behavior.Thanks to @steipete for reporting the issue and requesting the fix.
Worked on by
Work sessions