You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(desktop): land prompt-rail jumps at the top and fence the e2e sends (#4577)
Desktop e2e sends failed intermittently with `element(s) not found` right after Enter. The specs pressed Enter on an intermediate signal — a mounted composer, a cleared draft, an updated model label — none of which means the shell will accept a submission; moving Desktop e2e to 4 workers on one runner cut each worker's CPU share and removed the margin that had been hiding it. One exported `awaitSendReady` now waits on the single signal that covers the whole admission chain (发送 enabled), and the assertions that observe the resulting Turn carry an explicit 20s.
Fencing those sends left three failures that were not sends, all chased to their cause here rather than deferred.
The product one: clicking a prompt-rail tick for an unloaded prompt aims that turn at the top of the scrollport, while the shell answers the same click's load request by publishing the search reveal, which centres the turn with the app's scroll motion. Two writers, two answers, and the animated one walked the prompt 68px back off the top. The reveal is not redundant — it also records the reading position a session switch restores from — so only its alignment conflicts. `ChatView`, which both aims the turn and consumes the reveal, reconciles them: a reveal for the turn the rail is holding is instant and top-aligned, every other one stays centred and animated. The rail's claim belongs to the one navigation its click asked for, so it binds to the first target that arrives for that turn and is spent on anything else — a later search for the same turn keeps its own contract.
The other two are test-side. `promptRailWorker` and `promptRailMotionWindow` named no locale, so their renderers took the host's: Chinese on a developer's desktop, English on the CI runner, and every label-addressed control a coin flip. And the skip-link walk re-parks and retries, because the composer's one-shot draft-caret restore uses `getSelection().addRange(...)`, which focuses a `contenteditable` and so takes focus once per cold start with no `focus()` call to fence on. That focus theft is a real accessibility defect on main; it is fixed separately, and that change removes this retry as part of its own diff.
No e2e test is added — the diff under `apps/desktop/e2e` adds zero `test(` blocks and only changes what existing tests wait on.
An earlier revision also made the shell block sends until the readiness probe resolved. CI disproved it: `pending` reaches the composer through `sendBlocked`, and `sendCurrent` discards a submission on `sendBlocked` rather than waiting, so the gate silently dropped an Enter pressed during the probe window instead of letting it through. Giving a dropped submission feedback comes first (#4573, item 3), then the button can tighten.
No migration or compatibility impact.
Closes#4573
Generated-by: Claude Code
0 commit comments