Skip to content

fix: pasted chat images keep the wrong aspect ratio until remount - #185154

Merged
roboclaw-bot merged 5 commits into
mainfrom
openclaw/glow-crab-2
Oct 27, 2026
Merged

roboclaw-bot merged 5 commits into
mainfrom
openclaw/glow-crab-2

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

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

  • Reproduced the native clipboard paste/send problem against an isolated real Gateway: the 1200 × 563 image remained in a 3:2 frame before the fix.
  • Replayed native ClipboardItem paste → send → upload receipt → Settings/back → reload. The patched surface stayed 400 × 187.65625 pixels at every stage. Only model inference used a synthetic loopback provider; clipboard, Gateway, media materialization, history, and browser rendering were real.
  • 30 Chromium image-geometry cases, 55 image consumer tests, and 6 browser/Gateway end-to-end cases passed. UI build, TypeScript, targeted lint/format, stylesheet lint, and controller guards passed.
  • Independent Codex P0–P2 review: no actionable findings. Its review covered the supplied patch, not executed tests; the live evidence above is from the implementation session.
  • Previous-head CI run 40419236001 completed with one inherited failure: Gateway status with native account identity > keeps shared chat usable without polling operator-only surfaces expected no operator-only requests but received board.get at gateway-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, including security-fast, passed or were skipped. That attribution does not establish CI success for the review-repair head; its current checks are evaluated separately.

Before

Before: pasted image has a padded 3:2 frame

After

After: pasted image immediately uses its actual aspect ratio

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-wide tsc invocation 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

Before: short-panorama menu overlaps the next preview

After

After: outer layout reserves the menu footprint

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 185154 selected 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 in chat-outbox-capacity.e2e.test.ts failed with reversed attachment bytes. That same focused test fails on the actual CI main parent f27bfa85c993fc64964cb19220d55f0934d7dd3e (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. Canonical pnpm tsgo:ui, three-file type-aware lint, formatting and git diff --check pass. 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.json passes and all 28 attachment tests pass through pnpm test again. 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

roboclaw-bot and others added 2 commits October 26, 2026 23:15
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
@clawsweeper

clawsweeper Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui size: M labels Oct 26, 2026
@roboclaw-bot
roboclaw-bot marked this pull request as ready for review October 26, 2026 23:21
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 26, 2026
@clawsweeper

clawsweeper Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Chat image previews update their aspect ratio from uploaded or decoded dimensions without requiring a remount.

Example: Paste and send a 1200 × 563 image.

  • Before: The mounted preview retains a padded 400 × 267 frame.
  • After: The preview uses approximately 400 × 188 pixels and retains that ratio after navigation or reload.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused, visually demonstrated repair with the prior finding resolved and no remaining correctness or security finding; pending CI does not establish a failure.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected before/after screenshots show the corrected image ratio through the shipped Control UI; the recorded isolated-Gateway clipboard scenario covers send, upload receipt, Settings return, and reload, while separate production-component screenshots show the repaired panorama spacing.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A pasted image keeps visible padding until the conversation remounts.
Reason: This maintainer-authored repair addresses a demonstrated user-visible defect without adding settings, persistence, or another resource owner.

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
Reviewed head: 846d09c8207c4fecd8d0dfb9a5514f4637fe2e99

Before merge

None.

Findings

None.

Agent review details

How this fits together

The 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]
Loading

Technical review

Best 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

  • Mounted image geometry changes intended behavior with a stated reason (85feffe: Reserve stable image space through loading and upload handoff, including legacy images without dimensions.)
  • Image file actions and unavailable cards keeps the original intent (310cc29: Keep usable file actions within previews and hide unusable actions after confirmed source denial.)
  • Solid image presentation ownership keeps the original intent (4e3818b: Preserve transcript identities and media behavior while moving rendering into Solid.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

PR surface

Source +45, Tests +89, Docs 0, Other -1. Total +133 across 8 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 4 160 115 +45
Tests 2 110 21 +89
Docs 1 1 1 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 0 1 -1
Total 8 271 138 +133

Review metrics

Metric Value Why it matters
Production versus test growth Production +160/−115 (net +45); tests +110/−21 (net +89) The frame is moved rather than duplicated; remaining growth implements decoded sizing, extreme-ratio action placement, and distinct geometry regressions.

Labels

Label changes:

  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: Incorrect image framing is a bounded visual defect with an existing remount workaround.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

Rating scale

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

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-26T23:37:55.244Z sha b29173d :: needs changes before merge. :: [P2] Reserve space for the menu on short image previews

Reviewed October 26, 2026, 8:01 PM ET / October 27, 2026, 00:01 UTC (Revision 2).

@roboclaw-bot
roboclaw-bot enabled auto-merge (squash) October 26, 2026 23:50
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Oct 26, 2026
@clawsweeper clawsweeper Bot removed the clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. label Oct 27, 2026
@roboclaw-bot
roboclaw-bot disabled auto-merge October 27, 2026 00:59
roboclaw-bot and others added 2 commits October 27, 2026 01:03
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]>
@roboclaw-bot
roboclaw-bot merged commit b0503cc into main Oct 27, 2026
95 of 96 checks passed
@roboclaw-bot
roboclaw-bot deleted the openclaw/glow-crab-2 branch October 27, 2026 01:29
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 27, 2026
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant