Skip to content

feat(composer): click a draft image attachment to view it full-size - #4690

Merged
yomgui merged 3 commits into
devfrom
feat/attachment-image-lightbox
Sep 9, 2026
Merged

yomgui merged 3 commits into
devfrom
feat/attachment-image-lightbox

Conversation

@yomgui

@yomgui yomgui commented Sep 9, 2026 •

Copy link
Copy Markdown
Member

Summary

Image attachments added to the prompt only ever rendered as 40px thumbnails, with no way to inspect them before sending (sent and queued images already had a lightbox).

  • The image chip in the prompt editor is now an Expand button that opens the same full-size lightbox used for sent/queued images; Escape (or the close button) returns to the draft with nothing changed.
  • Extract the shared dialog into ImageLightbox so the badge and the composer use one viewer (the lightbox mounts as a sibling of the composer root so Escape cannot arm stop-agent).

Journey spec

evals/specs/attachment-upload-loading-state.e2e.test.ts (extended, both entry points):

  • new step: click the draft thumbnail → lightbox image is >4× the chip width and shares its src → Escape → lightbox gone, chip and draft intact.
  • This spec landed in fix(composer): wait for image readiness before showing sent text #4652 with its e2e run explicitly deferred and had never run green; making it runnable required two world fixes and one spec fix, all pre-existing on dev (confirmed with a clean origin/dev control that failed identically):
    • the standalone approval server read the host's ~/.config/openwork/runtime.sqlite, so a persisted managed policy turned every write into an instant 403 policy_unavailable → runtime DB is now isolated per run;
    • the upload gate matched /inbox?…chat-attachments in the URL, but the client posts to /workspace/<id>/inbox with path as a form field → gate now inspects the actual request;
    • the sidebar control was renamed "New task" → "New session" in Fix split-view sending and prioritize New session #4491.

Verification — Passed

Lane: Daytona (placement: daytona (--daytona), OPENWORK_EVAL_REF=feat/attachment-image-lightbox, checkout resolved 97a00a4686fd = PR head).

  • OPENWORK_EVAL_REF=feat/attachment-image-lightbox infisical run --silent -- pnpm evals:e2e attachment-upload-loading-state --daytona — exit 0; 2 passed, 0 failed, 0 skipped. Evidence for both journeys at this head is in the comments below (sticky + companion).
  • pnpm --filter @openwork/app typecheck — exit 0.
  • pnpm evals:typecheck reports the same 363 pre-existing errors with and without this branch; none in touched files.
  • apps/app/tests/composer-focus-continuity.test.tsx fails identically on a clean origin/dev worktree ("Platform context is missing", since feat(desktop): use native right-click menus #4650); not caused here.

Known pre-existing flake (not addressed here)

The new task variant of this spec fails roughly every other run after user.reload() with Session snapshot owner changed before the local read completed. and an empty thread. Bisected on Daytona at this head: it fails and passes both with and without the new lightbox step (and on origin/dev), so it is independent of this change. The snapshot owner includes the draft scope, which flips when the cloud session hydrates after reload, and the loopback snapshot query has retry: false with an owner-less key — worth its own PR.

Note: evals/specs/streamed-markdown-answer.e2e.test.ts:32 still targets the old "New task" label; left untouched here.

@vercel

vercel Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
openwork-app Ready Ready Preview Sep 9, 2026 6:41pm UTC
3 Skipped Deployments
Project Deployment Actions Updated
openwork-den Skipped Skipped Sep 9, 2026 6:41pm UTC
openwork-diagnostics Skipped Skipped Sep 9, 2026 6:41pm UTC
openwork-landing Skipped Skipped v0 Sep 9, 2026 6:41pm UTC

Image chips in the prompt editor were 40px thumbnails with no way to
inspect them before sending. The chip is now an Expand button that opens
the same lightbox used for sent and queued images. Extract the dialog
into ImageLightbox so the badge and composer share one viewer.

Extend attachment-upload-loading-state with the click-to-expand step.
- Isolate the standalone approval server's runtime DB so a host machine's
  persisted managed policy cannot short-circuit writes with 403.
- Target the sidebar control by its current label (renamed in #4491).
The client posts multipart to /workspace/<id>/inbox with the path as a
form field, so the previous /inbox? + URL substring match never fired.
@yomgui
yomgui force-pushed the feat/attachment-image-lightbox branch from cdc718c to 97a00a4 Compare September 9, 2026 18:53

@diff-warden diff-warden Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (97a00a4686fdac6ba2b3bf8d67d0436f662af81e). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run

@yomgui

yomgui commented Sep 9, 2026

Copy link
Copy Markdown
Member Author

Test evidence — sending an image in existing chat immediately moves it into the thread while upload is pending — ✅ passed

SHA 97a00a4 · engine v1

✅ 0/3 screenshots passed · 0 expectations passed · 0 failed · 0 pending

[world] mock(mcp) · den(daytona) · desktop(as admin) · workspace(/tmp/openwork-attachment-upload-1788983203842) · [seed:raw] evalIn() ×3 · session("New task")
[user] type(composer, "Describe the attached image.")
[seed:raw] [seed:raw] evalIn()
[user] screenshot
[probe] dom("[data-attachment-id] img")
[user] label=Expand big-photo.png · click(label=Expand big-photo.png)
[probe] dom("[data-image-lightbox] img") · eventually(draft image lightbox)
[probe:raw] [probe:raw] eval()
[user] screenshot · press(Escape)
[probe] dom("[data-image-lightbox]") · eventually(draft image lightbox closed) · dom("[data-attachment-id]")
[user] see(composer, text=/Describe the attached image./)
[seed:raw] [seed:raw] evalIn()
[user] see(text=pasted-recording.mp4)
[seed:raw] [seed:raw] evalIn()
[user] Run task · click(Run task)
[probe:raw] [probe:raw] eval() ×4
[probe] eventually(one decoded thread preview and cleared composer while upload is held)
[user] see(composer, text="")
[probe] dom("[data-message-role="user"]") · dom("[data-message-role="user"] img")
[user] see(text=pasted-recording.mp4) · type(composer, "Continue after upload.") · press(Enter) · press(Meta+Enter) · see(composer, text="Continue after upload.")
[probe] dom("[data-message-role="user"]")
[user] notSee(text=/1 queued/) · see(text=attachment upload loading proof) · see(composer, text="Continue after upload.")
[probe] dom("[data-message-role="user"]")
[user] notSee(text=/1 queued/)
[probe] hash
[probe:raw] [probe:raw] eval()
[user] see(text=pasted-recording.mp4) · see(text=attachment upload loading proof) · notSee(text=/Cannot read binary file|UnsupportedFunctionalityError/) · reload · see(text=pasted-recording.mp4)
[probe:raw] [probe:raw] eval()
[user] screenshot
steps 1 ✅ manual approval exempts only chat-attachment inbox uploads (0.0s) · 2 ✅ clicking the draft image thumbnail opens it full-size and Escape returns to the draft (0.9s) · 3 ✅ paste a video alongside the image (0.1s) · 4 ✅ Send moves the attachments immediately and preserves the next draft (3.3s) · 5 ✅ sent video remains visible without a binary model error (3.1s)
verdict passed · 16 user observations (screenshot ×3, see ×10, notSee ×3) · 19 probes · steps 5/5

⚪ UNVALIDATED — 1. sending an image in existing chat immediately moves it into the thread while upload is pending artifact 1

  • ⚪ UNVALIDATED — no visual expectations recorded.

sending an image in existing chat immediately moves it into the thread while upload is pending artifact 1

⚪ UNVALIDATED — 2. sending an image in existing chat immediately moves it into the thread while upload is pending artifact 2

  • ⚪ UNVALIDATED — no visual expectations recorded.

sending an image in existing chat immediately moves it into the thread while upload is pending artifact 2

⚪ UNVALIDATED — 3. sending an image in existing chat immediately moves it into the thread while upload is pending artifact 3

  • ⚪ UNVALIDATED — no visual expectations recorded.

sending an image in existing chat immediately moves it into the thread while upload is pending artifact 3


Test run created 2026-09-09T19:42:52.678Z · Source: evals/results/test-runs/2026-09-09T19-42-52-677Z-sending-an-image-in-existing-chat-immediately-moves-it-into-the-thread-while-upl/test-run.json · Repro: pnpm --dir evals artifacts:publish -- --pr 4690 --test-run 2026-09-09T19-42-52-677Z-sending-an-image-in-existing-chat-immediately-moves-it-into-the-thread-while-upl

@yomgui

yomgui commented Sep 9, 2026

Copy link
Copy Markdown
Member Author

Test evidence — sending an image in new task immediately moves it into the thread while upload is pending — ✅ passed

SHA 97a00a4 · engine v1

✅ 0/3 screenshots passed · 0 expectations passed · 0 failed · 0 pending

Companion section for the second journey at the same head 97a00a4686fd (the sticky comment holds the first). Posted separately because the composed review publisher is blocked by a blob-store access mismatch (Cannot use private access on a public store), not by the tests. Supersedes the earlier companion comment for the pre-rebase head.

[world] mock(mcp) · den(daytona) · desktop(as admin) · workspace(/tmp/openwork-attachment-upload-1788983473408) · [seed:raw] evalIn() ×3 · session("New task")
[user] label=New session · click(label=New session) · type(composer, "Describe the attached image.")
[seed:raw] [seed:raw] evalIn()
[user] screenshot
[probe] dom("[data-attachment-id] img")
[user] label=Expand big-photo.png · click(label=Expand big-photo.png)
[probe] dom("[data-image-lightbox] img") · eventually(draft image lightbox)
[probe:raw] [probe:raw] eval()
[user] screenshot · press(Escape)
[probe] dom("[data-image-lightbox]") · eventually(draft image lightbox closed) · dom("[data-attachment-id]")
[user] see(composer, text=/Describe the attached image./)
[seed:raw] [seed:raw] evalIn()
[user] see(text=pasted-recording.mp4)
[seed:raw] [seed:raw] evalIn()
[user] Run task · click(Run task)
[probe:raw] [probe:raw] eval() ×8
[probe] eventually(one decoded thread preview and cleared composer while upload is held)
[user] see(composer, text="")
[probe] dom("[data-message-role="user"]") · dom("[data-message-role="user"] img")
[user] see(text=pasted-recording.mp4) · type(composer, "Continue after upload.") · press(Enter) · press(Meta+Enter) · see(composer, text="Continue after upload.")
[probe] dom("[data-message-role="user"]")
[user] notSee(text=/1 queued/) · see(text=attachment upload loading proof) · see(composer, text="Continue after upload.")
[probe] dom("[data-message-role="user"]")
[user] notSee(text=/1 queued/)
[probe] hash
[probe:raw] [probe:raw] eval()
[user] see(text=pasted-recording.mp4) · see(text=attachment upload loading proof) · notSee(text=/Cannot read binary file|UnsupportedFunctionalityError/) · reload · see(text=pasted-recording.mp4)
[probe:raw] [probe:raw] eval()
[user] screenshot
steps 1 ✅ manual approval exempts only chat-attachment inbox uploads (0.0s) · 2 ✅ clicking the draft image thumbnail opens it full-size and Escape returns to the draft (0.8s) · 3 ✅ paste a video alongside the image (0.0s) · 4 ✅ Send moves the attachments immediately and preserves the next draft (3.3s) · 5 ✅ sent video remains visible without a binary model error (3.0s)
verdict passed · 16 user observations (screenshot ×3, see ×10, notSee ×3) · 23 probes · steps 5/5

⚪ UNVALIDATED — 1. sending an image in new task immediately moves it into the thread while upload is pending artifact 1

  • ⚪ UNVALIDATED — no visual expectations recorded.

artifact 1

⚪ UNVALIDATED — 2. sending an image in new task immediately moves it into the thread while upload is pending artifact 2

  • ⚪ UNVALIDATED — no visual expectations recorded.

artifact 2

⚪ UNVALIDATED — 3. sending an image in new task immediately moves it into the thread while upload is pending artifact 3

  • ⚪ UNVALIDATED — no visual expectations recorded.

artifact 3


Test run created 2026-09-09T19:47:12.877Z · Source: evals/results/test-runs/2026-09-09T19-47-12-877Z-sending-an-image-in-new-task-immediately-moves-it-into-the-thread-while-upload-i/test-run.json · Repro: pnpm --dir evals artifacts:publish -- --pr 4690 --test-run 2026-09-09T19-47-12-877Z-sending-an-image-in-new-task-immediately-moves-it-into-the-thread-while-upload-i

@yomgui
yomgui merged commit df3b167 into dev Sep 9, 2026
23 checks passed
@yomgui
yomgui deleted the feat/attachment-image-lightbox branch September 9, 2026 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant