Skip to content

fix(client-runtime): stopped image reads no longer show an image preview - #46063

Open
only21mil wants to merge 3 commits into
pingdotgg:mainfrom
only21mil:fix/client-runtime-declined-read-no-image-preview
Open

only21mil wants to merge 3 commits into
pingdotgg:mainfrom
only21mil:fix/client-runtime-declined-read-no-image-preview

Conversation

@only21mil

Copy link
Copy Markdown
Contributor

Problem

When a user stops an in-progress image Read, the strip and expanded row still preview it instead of omitting it. On main (3807f8d47e98), workEntryViewedImagePath skipped "failed"/"inProgress" and workEntriesViewedImages skipped "failed", so "stopped"/"declined" still previewed.

Change

packages/client-runtime/src/work-log/presentation.ts now previews a Read's image only when the Read completed (or has no lifecycle status). The group strip also keeps a running Read as a pending placeholder. Failed Reads stay hidden (#42265) and running Reads keep their placeholder (#42921). Web and mobile both use these helpers, so both get the fix. presentation.test.ts covers stopped and declined Reads in the existing cases.

Scope

Bug fix: a stopped or declined image Read still previews a file the Read never returned. This small, obvious fix extends #42265 and #42921 to the remaining non-completed statuses, so it needs no issue.

Verification

Setup. Linux (Ubuntu 26.04), light theme, 1280x800, an isolated data directory per commit, Browser panel clicks, and a local ACP test agent.

Steps. (Base/head) Run ok.png (done) + stopped.png (running) → wait for loading frame → Stop generation → strip → Read 2 files → Read t3-demo-project/stopped.png → expanded row.

3807f8d47e98 bb5e89016471
Strip: ok.png + stopped.png
Strip: ok.png + stopped.png
Strip: ok.png only
Strip: ok.png only
Row: stopped.png preview
Row: stopped.png preview
Row: path only, no preview
Row: path only, no preview

Not shown.

  • Mobile: shares workEntriesViewedImages (apps/mobile/src/lib/threadActivity.ts) and workEntryViewedImagePath (apps/mobile/src/features/threads/thread-work-log.tsx); not run on iOS/Android.
  • Live "declined": covered in presentation.test.ts. ACP and Claude rejected Reads project as "failed", and Codex image views have no approval step, so no unmodified app run produces a declined image Read.
Automated test, check:changed, and test-delta output

Failing-first on base (3807f8d47e982cea7f667536c507b3e67f7a5d38) with updated presentation.test.ts:

vp test run packages/client-runtime/src/work-log/presentation.test.ts
Test Files  1 failed (1)
     Tests  3 failed | 29 passed (32)
- workEntryViewedImagePath > withholds a Read's image preview until the Read has finished: expected '/repo/out/later3.png' to be null ("stopped")
- workEntriesViewedImages > marks an image pending until a Read of it finishes: /repo/b.png flipped to pending: false; /repo/d.png and /repo/e.png returned
- workEntriesViewedImages > orders the finished images like the strip shows them: returned ["/repo/c.png", "/repo/d.png", "/repo/b.png", "/repo/a.png"] instead of ["/repo/a.png", "/repo/b.png"]

Passing on head (bb5e890164713a5dcf0f87cac6192281667942ca):

vp test run packages/client-runtime/src/work-log/presentation.test.ts
Test Files  1 passed (1)
     Tests  32 passed (32)

vp run check:changed 3807f8d47e982cea7f667536c507b3e67f7a5d38:

check:changed: 2 files since 3807f8d47e98 (3807f8d47e982cea7f667536c507b3e67f7a5d38)
  pass  format
  pass  lint
  pass  knip 1/2
  pass  knip 2/2
  pass  typecheck (7 packages)
  pass  test (1 files)

test-delta.cjs: {"kinds":{"browser":0,"server":0,"unit":0},"net":0,"newBrowserFiles":[]} quiet

Generated with Gemini 4 Neon in T3 Code Nightly

@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Nov 30, 2026
@macroscopeapp

macroscopeapp Bot commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at bb5e890

Macroscope's review found this PR approvable — Stopped and declined image reads no longer display previews in web or mobile work logs; completed previews and running placeholders remain unchanged. The change is limited to presentation and introduces no material data or operational risk.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Viewed-image helpers now exclude Reads with stopped or declined statuses. Tests cover path suppression, pending-image aggregation, and finished-image ordering for these statuses.

Changes: Viewed-image lifecycle filtering

Layer / File(s) Summary
Filter viewed images by lifecycle status
packages/client-runtime/src/work-log/presentation.ts, packages/client-runtime/src/work-log/presentation.test.ts
workEntryViewedImagePath returns null for defined statuses other than completed. workEntriesViewedImages skips defined statuses other than completed and inProgress. Tests cover stopped and declined Reads, including matching paths and finished-image ordering.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

Suggested labels: bugfix

Suggested reviewers: shivamhwp, macroscopeapp, yash-singh1

Merge Risk: Minimal · up to bb5e8

Stopped or declined Reads no longer show an image preview, while running Reads keep their pending placeholder. The change is small and covered by helper tests, so merge risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: stopped image Reads no longer show an image preview. The raw summary confirms that workEntryViewedImagePath now returns null for any non-completed status, and workEntr…
Description check Passed The description covers the Problem, Change, Scope, and Verification sections the template requires. It explains the bug and the fix, links prior related work (#42265, #42921), and gives a bug-fix scop…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: stopped image Reads no longer show an image preview. The raw summary confirms that workEntryViewedImagePath now returns null for any non-completed status, and workEntriesViewedImages skips stopped and declined Reads. The title uses the conventional commit form, and the fix matches the objectives.

Full details: Description check

Explanation

The description covers the Problem, Change, Scope, and Verification sections the template requires. It explains the bug and the fix, links prior related work (#42265, #42921), and gives a bug-fix scope with a reason for no issue. Verification includes a failing-first test run, a passing run on head, check results, and before/after screenshots. It also states what was not checked: mobile on iOS/Android and live declined Reads. The Problem section gives the expected behavior and reproduction steps. The description does not include the agent model line in the required form, though it does say 'Generated with Gemini 4 Neon in T3 Code Nightly' at the end, which fulfills that requirement. The Scope section links no issue, but it gives the reason, as the template allows. The description is mostly complete.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between a58d86f and bb5e890.

Files selected for processing: 2

  • packages/client-runtime/src/work-log/presentation.test.ts
  • packages/client-runtime/src/work-log/presentation.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Nov 30, 2026
juliusmarminge and others added 2 commits November 30, 2026 13:07
…ession

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

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

Labels

size:XS 0-9 changed lines (additions + deletions). takeover:in-progress A takeover lead is working on this PR vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants