Skip to content

fix(screenshots): assert the phone's refused queue instead of a control it lost - #1618

Merged
huichen merged 1 commit into
mainfrom
pr/huichen
Nov 15, 2026
Merged

huichen merged 1 commit into
mainfrom
pr/huichen

Conversation

@huichen

@huichen huichen commented Nov 15, 2026

Copy link
Copy Markdown
Collaborator

What and why

The mobile screenshot scenario send-queue-refused-edit was still asserting the refused queue the phone no longer draws: a panel offering a retry control, with the refused row opened for editing inside it. The phone's queue surface is a header line over the conversation, and rows appear only after the reader opens it, so the scenario failed on a control the UI deliberately dropped and the capture it exists for could not be taken at all.

This rewrites it against what the phone actually does: two rows already waiting behind the running turn (collapsed header, no rows drawn), a new sentence handed over with the queue action while the host refuses it, then one tap to expand the header and one to open the first waiting row into its editor.

Commits

  • fix(screenshots): assert the phone's refused queue instead of a control it lost

Verification

  • python3 scripts/tests/test-screenshot-scenario-fragments.py -> ok: scenario fragments merge, override and fail loudly
  • the fragment loads through capture.load_scenarios: 22 steps, URL carries queueFail=1&queue=2, one shot
  • real capture on the mobile harness (:8099) against the real mobile UI from this tree at a62cad80e: capture-mobile send-queue-refused-edit -> 1/1 captured, every one of the 22 steps returned its expected value, m-send-queue-refused-edit.png written
  • falsified once so the new assertions are known to be able to fail: with queueFail=1 dropped from the scenario URL the hand-over succeeds and the step reports the refused sentence was dropped: "" (0/1 captured). The URL was restored afterwards and the file hashes identical to the committed blob.
  • no Rust or TypeScript source changed (one JSON scenario file), so no cargo / tsc / jest lane applies

Notes

  • Scenarios under scripts/screenshots/scenarios.d/ merge into the shared scenarios.json per platform; this fragment overrides only its own mobile entry.
  • The screenshot harness is not part of CI, which is why the stale scenario went unnoticed: the capture has to be run by hand.
  • The scenario now ends by clearing localStorage, so the next capture starts on the conversation list instead of inside the thread.

User-visible changes

none: a screenshot scenario only. No product code, no default value, setting, migration or wire change.

…ol it lost

`send-queue-refused-edit` still asserted a `重试` control inside the phone's queue
panel. That control went away with #1485, when the queue became the session's own
list rather than something this phone held and retried, so the scenario could not
fail: it was guarding a state the product no longer has.

Rewritten against what the phone does now. The fixture seats two waiting rows
(`?queue=2`), so the panel is there as its header line — `2 条等待中` and
`当前回复结束后合并成一条发送` — and draws no rows until that line is tapped. A
hand-over refused by the host (`?queueFail=1` → `session_busy`) must leave the
sentence in the field, add no row and stop no run. Then one tap opens the queue and
the first waiting row opens into a field holding its own words, with `保存`/`取消`
beside it and its bin still on the row.

That refusal sentence itself goes through `Alert.alert`, which react-native-web
does not draw, so the capture asserts the state the refusal leaves behind rather
than its copy — said plainly in the scenario's note, so nobody reads the missing
sentence as a bug.

Falsified twice, both red on the harness: putting the old `重试` assertion back
fails with "the panel offers no retry", and dropping the header tap fails with
"one tap did not open the queue: 0". Green: `capture-mobile` captures 1/1, and the
same run together with `send-queue-choice` captures 2/2.
@huichen
huichen enabled auto-merge (squash) November 15, 2026 07:20
@huichen
huichen merged commit 304d5a9 into main Nov 15, 2026
10 checks passed
@huichen
huichen deleted the pr/huichen branch November 15, 2026 07:22
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