Description
Summary and impact
Follow-up from #23 QA round 4 (D5, Low). If a row page fails while the Flows grid is holding the previous comparison after a selection change, Retry does not restore the view to the flow the user was reading. The view lands about 110 flows away, which is the #23 D2 symptom, and the user has to scroll to find their place again. The fix also closes the anchoring test gaps from the same QA round (O10).
Delivery phase
Phase 1, frontend with mocks (F4).
Steps to reproduce
- Use jsdom with 30 ms latency, or
/?mock-scenario=large. - Select processes 0–109 and scroll to row 1150 (flow 001036 at −20 px).
- Select the other 110 processes, with the third row page of the new comparison failing with
TEMPORARILY_UNAVAILABLE. - The alert and Retry button appear. Click Retry.
Expected behavior and authority
After Retry, flow 001036 is back at −20 px (row 1260), as it is without an error. Authority: spec §6.4, §6.8 and §9.1, and the #23 view-anchoring contract in apps/frontend/src/services/README.md.
Actual behavior
Flow 000925 is at −28 px (row 1149). The cause (line numbers verified on main at deb4f29):
useFlowGrid.ts:116-123:seekingrequires!isError, so the error ends the hold.useFlowGrid.ts:136-137: the new, partial comparison is committed.useFlowGrid.ts:230-232: unloaded keyslocatetonull(absent) onceisErroris set, soComparisonGrid.tsx:251-267may treat the pins as gone and re-anchor on what is in view. This is a likely contributor; the engineer confirms it.- After Retry, pages load only to the viewport plus
ROW_LOOKAHEAD, so the anchor flow is never loaded.
If the first page fails instead, Retry does restore the anchor.
Environment and version
Found on feat/f4-virtual-grid at 3976241 (PR #68). The same code is now on main (deb4f29). Workspace container, mock adapter.
Context and dependencies
- [Task] F4 — Virtualize comparison rows and columns with sticky alignment #23 (PR F4: windowed comparison grid with the Flows mount and large mock workload (#23) #68,
e88733a) and [Task] F4 — Assemble the Flows comparison with exact missingness and cell warnings #24 (PR F4: assemble the Flows comparison with exact missingness and cell warnings (#24) #71,deb4f29) are merged and closed. M1 ([Task] M1: complete container runtime verification and the bootstrap lock #2) and bootstrap/M2 ([Task] M2: activate issue forms and publish the F1–F5 execution backlog #3) are closed. - Raised in [Task] F4 — Virtualize comparison rows and columns with sticky alignment #23 (comment)
- Sequenced before [Task] F4 — Add shared column drag, keyboard reorder and global removal #25, which reuses this hold path for header × removal and shares
ComparisonGrid.tsx, the Flows grid tests and the README. [Task] F4 — Verify large Flows comparisons and record the milestone gate #26 (F4 gate) follows both.
Acceptance criteria
-
AC1: a row-page error during the hold (any page after the first) does not commit the partial new comparison. While the error is shown:
- The previous comparison's rows stay rendered.
- The alert with a keyboard-reachable Retry is shown.
- No summary or cell reads are issued.
- The status does not say "Updating the comparison…".
- Unloaded flows are not reported as absent because of the error.
After a successful Retry, the hold resumes until an anchor flow is loaded or no pages remain. The anchor flow is then restored at its pre-change offset (±1 px); in the repro, 001036 ends at −20 px at row 1260. A further selection change while errored starts a new hold from the still-shown previous comparison. A repeated failure keeps the same guarantees.
-
AC2: a first-page error still shows the error with Retry (0 rows) and recovers (O12, unchanged). Covered by a regression test.
-
AC3: a row-page error with an unchanged selection (deep scrolling) still shows the alert, keeps the loaded rows, and Retry continues paging. Covered by a regression test.
-
AC4: tests catch each O10 mutant from [Task] F4 — Virtualize comparison rows and columns with sticky alignment #23 QA:
- N5: the ComparisonGrid focus clause for a node that now shows another flow or process (the O9 fix).
- N6: only the first pin considered.
- N7: no re-anchor when every pin is gone.
The [Task] F4 — Virtualize comparison rows and columns with sticky alignment #23 D4 test's old-anchor offset check is unconditional. The handoff records each mutant, the test that kills it, and its revert.
-
AC5:
services/README.md"View anchoring" documents how errors interact with the hold: paused with previous rows on error, resumed by Retry; a first-page error shows no rows; errors outside a hold keep the loaded rows. It also records thearia-busystate while errored.
Regression and verification plan
- jsdom tests in
services/mock/flows-grid.test.tsxcover AC1–AC4. Inject the page failure through the test'sflowRowsspy wrapper, becausescenario.failuresis per operation, not per call. Do not add a URL fault scenario. - Rerun the full Chromium e2e suite, including
flows-grid.spec.ts. A browser-level error repro is not required. - Required container checks (workspace container, via
docker compose --project-directory . -f compose.yaml exec -T workspace bash -lc 'cd /workspaces/lca-diff && npm --prefix apps/frontend run <script>'):format:check,lint,typecheck,test:unit,buildandtest:e2e -- --project=chromium. - The handoff records the exact commands, results and delivered SHA. Independent QA verifies at that SHA.
Out of scope and follow-ups
These product questions are not part of this fix. The PM decisions are in the PM: READY comment:
- O11: when every anchor flow is removed, the hold reads all row pages (18 pages, about 2.5 s at 100 ms mock latency). [Task] F4 — Verify large Flows comparisons and record the milestone gate #26 records the measured duration in its large-scenario evidence. Bounding the hold is a maintainer UX question. If adopted, or if [Task] F4 — Verify large Flows comparisons and record the milestone gate #26 shows unresponsive controls, it gets its own issue; real-API cost belongs to I1/R2.
- O13: at scrollTop 0, adding processes whose rows sort above the view keeps the previously visible flow, hiding the new top rows. Whether to stay at the top instead is a maintainer UX question. If adopted, it gets its own task.
- Column drag, removal and headers are [Task] F4 — Add shared column drag, keyboard reorder and global removal #25. The F4 gate is [Task] F4 — Verify large Flows comparisons and record the milestone gate #26.
Activity
DavidVFitzGerald commentedon Nov 15, 2026
PM: READY
Rechecked using
docs/team/product-manager.mdagainstmainatdeb4f29. Phase 1, frontend with mock services; F4 bug follow-up from #23 QA round 4 (D5, Low) plus the O10 test gaps.Authority: spec §6.4 (union rows; scrolling usable with thousands of rows), §6.8 (loading states, keep controls responsive, keyboard-accessible controls), §9.1 ("avoid scroll-jump when rows arrive asynchronously"; cancel stale requests) and §9.2 behaviours 17 and 18, under accepted ADRs 0001–0003. ADRs 0004 and 0005 are still Proposed and grant nothing here. The anchoring contract is the "View anchoring" and "Selection changes" bullets of
apps/frontend/src/services/README.md("Windowed comparison grid (#23)"). This fix restores existing contracted behaviour on an error path. It changes no PRD, spec or scientific meaning, so no ADR is needed. If the engineer finds a criterion can only be met by changing product meaning, stop and raise a blocker.Dependency check
main(e88733a), closedmain(deb4f29), closedSequencing decision: #69 before #25
#69 goes first and #25 waits for it to merge.
store.deselect. That changes the canonical process set, so it goes through the same placeholder/hold/anchor path inuseFlowGridas a sidebar deselect. [Task] F4 — Add shared column drag, keyboard reorder and global removal #25's removal-while-deep tests should be written against the corrected hold.useFlowGrid.ts, possibly the pins inComparisonGrid.tsx,flows-grid.test.tsxandservices/README.md. [Task] F4 — Add shared column drag, keyboard reorder and global removal #25 needsComparisonGrid.tsxfor focus and edge scrolling,flows-grid.test.tsxfor reorder/removal reads, and the README. Only one writer may touch a file at a time.Branch:
fix/f4-hold-retryfrommainatdeb4f29, in an isolated worktree. The PR targetsmainwithRefs #69(no closing keyword).Current code (verified on
main, same line numbers as at3976241)useFlowGrid.ts:116–123:seekingrequires!isError, so a row-page error ends the hold.:136–137:setPrevious(fresh)then commits the partial new comparison.:141–150: after that, pages are fetched only up to the viewport plusROW_LOOKAHEAD(:22), and never whileisError.:230–232:locatereturnsnull(absent) for unloaded keys onceisErroris true.ComparisonGrid.pin(:251–267) therefore treats the pins as gone rather than pending (:253) and re-anchors on what is in view (:267). This is a likely contributor; the engineer confirms it.:240–244:retryrefetches the row pages, summaries and cells. Nothing resumes the hold afterwards.Delivered vs remaining, per criterion
AC1: error during the hold, then Retry (remaining, the main fix)
FlowsGrid.tsx:221–228).busyReadsmust stay empty).aria-busystays set while errored is the engineer's choice; document it in the README.locatereturns unknown, notnull, for keys that may be on unfetched pages, so the pins survive the error.AC2: first-page error (O12), unchanged
AC3: errors outside a hold, unchanged
AC4: O10 anchoring test gaps
flows-grid.test.tsx(or the e2e spec where jsdom cannot observe the behaviour) that fail under each [Task] F4 — Virtualize comparison rows and columns with sticky alignment #23 QA mutant:ComparisonGrid.tsx:319–325). Covers O9: focused column removed while the grid owns focus. DOM focus must end on the single tab stop showing the same flow.:267). When all recorded flows are removed, the view keeps its position and then stays stable while heights correct.flows-grid.test.tsx:544–545,if (old)). The test must ensure that row is mounted, or assert its offset another way.AC5: README
services/README.md"View anchoring" states how errors interact with the hold. A row-page error pauses the hold with the previous comparison shown. Retry resumes it. A first-page error shows the error with no rows. Errors outside a hold keep the loaded rows. Also record thearia-busychoice.Constraints
flows-gridunit and e2e tests passing unchanged in intent. Update an assertion only where this fix changes the specified behaviour, and say so in the handoff.src/test/service-boundary.test.tsmust still pass.scenario.failuresis per operation, not per call. Fail the N-th row page of the new comparison through the test's existingflowRowsspy wrapper, returning{ ok: false, error: { code: "TEMPORARILY_UNAVAILABLE", … } }. Extending the mock scenario is allowed only if documented in the README, and no URL scenario is added.Container verification plan
These are existing F1 scripts, run inside the workspace container. Nothing is installed on the host:
The worktree's container project, ports and volumes must be distinct from any other active checkout.
Test evidence expected:
flows-grid.test.tsx):Out of scope, with decisions
Issue body updated: dependency state, the refined criteria and verification plan, and the O11/O13 decisions.
frontendlabel added.Next role: Software Engineer, on
fix/f4-hold-retryfrommainatdeb4f29.🤖 Generated with Claude Code
DavidVFitzGerald commentedon Nov 15, 2026
Coordinator: state → implementing. Software Engineer assigned on
fix/f4-hold-retryfromdeb4f29, in an isolated worktree.🤖 Generated with Claude Code
DavidVFitzGerald commentedon Nov 15, 2026
Engineering: READY FOR QA
fix/f4-hold-retry(isolated worktree, frommainatdeb4f29)0c053c6Refs #69, no closing keyword, not merged)25a190bfix,82247dctests,0c053c6READMERoot cause
useFlowGrid.tsrequired!isErrorforseeking. A row-page error therefore ended the hold, and the partial new comparison was committed.After Retry, pages loaded only to the viewport plus
ROW_LOOKAHEAD. The anchor, about 110 rows further down, was never loaded.The suspected
locatecause is refuted for the repro. I probed four variants of the issue repro (jsdom, 30 ms latency, page 2 fails, then Retry):mainmain+locatechange onlylocate)In the repro, no loaded row of the partial comparison was in view, so
record()kept the pins despite thenulls. Thelocatechange is kept because AC1 requires it, and it closes the latent case where loaded partial rows are in view.Change
useFlowGridnow separatesholding(the hold conditions without!isError) fromseeking(holding && !isError).busy(placeholder or holding) decides which comparison is shown, when the shown comparison is committed, and gates the summary and cell reads.updating(the "Updating…" status) stays placeholder or seeking.aria-busyusesbusy, so the grid stays busy while paused; the README records this choice.locatenow returnskeyIndex.get(key) ?? (busy || hasNextPage ? undefined : null).Criteria
flows-grid-anchoring.test.tsxunless noted)expectPaused, MutationObserver: only the anchor flow is ever at the top)locateunknown for unfetched keys during the errorflows-grid.test.tsxD4 test:expect(old).toBeDefined()and then the offset assertionservices/README.md: the "Errors and the hold (#69)" bullet and the evidence listBug-first evidence. On the
deb4f29useFlowGrid.tsandFlowsGrid.tsx, the three AC1 tests fail (expected 2225 to be 2115: the partial comparison was committed). The AC2, AC3 and O8/O9 tests pass there, as expected for regression and mutant-killing tests.Mutants. Each was a scratch edit to
ComparisonGrid.tsx, run against the O8/O9 tests, then restored withcpfrom a saved copy. None is committed.lost= body/null only)pins.current.slice(0, 1)if (!pending) record();removedSupporting change. The shared harness moved to
services/mock/flows-grid-harness.ts, and the new tests live in a second file.main, measured with--logHeapUsage). One file of 20 tests hit the 2.2 GB worker heap limit and crashed with an OOM.Commands (workspace container, Compose project
lca-diff-f4-hold-retry,FRONTEND_PORT=5196)docker compose --project-directory . -f compose.yaml -p lca-diff-f4-hold-retry exec -T workspace bash -lc 'cd /workspaces/lca-diff && npm --prefix apps/frontend run <script>', afternpm --prefix apps/frontend ciin the container:0c053c6format:check,lint,typecheck,buildtest:unittest:e2e -- --project=chromiumflows-grid.spec.tsand every@smoketestLimitations and blockers
Next role: QA. Verify independently at
0c053c6.🤖 Generated with Claude Code
DavidVFitzGerald commentedon Nov 15, 2026
QA: PASS
0c053c6bdbebc422404d748c04d0479c54a10b5f(PR F4: keep the hold through row-page errors and restore the anchor on Retry (#69) #73,fix/f4-hold-retry→mainatdeb4f29). It holds exactly the 3 handed-off commits (25a190b,82247dc,0c053c6). The working tree was clean before and after review./tmp/lca-diff-f4-hold-retry-qa, not the engineer's. It ran in its own rootless workspace container: Compose projectlca-diff-f4-hold-retry-qa,FRONTEND_PORT=5197, no volumes../dev checkpassed,npm ciran in the container, and the container was taken down afterwards.git checkout, and the scratch probe directory was deleted before the final runs.services/README.md"View anchoring" contract, under accepted ADRs 0001–0003. ADRs 0004 and 0005 are Proposed and were not applied. No archive or reference folder was used.Commands and results
All were run in the QA container at
0c053c6, with the probe files removed:src/test/service-boundary.test.tspasses. The e2e specs are unchanged by this PR.Per-criterion results
AC1, error during the hold, then Retry: PASS.
aria-rowcount2225. This is identical to the run without an error (row 1260 at −20, 2225 rows).deb4f29'suseFlowGrid.tsandFlowsGrid.tsx, the same probe has no loaded row at the top during the error. After Retry it shows flow000924at −68 px at row 1149, and the anchor is not mounted. This reproduces the bug.000924in my old-code run.deb4f29'suseFlowGrid.tsandFlowsGrid.tsxswapped into the QA worktree,flows-grid-anchoring.test.tsxgives 3 failed and 5 passed. The 3 failures are the AC1 tests (the repro, the repeated failure, and the selection change during the error), each withexpected 2225 to be 2115. AC2, AC3, O8 and O9 pass there, as expected for regression and mutant-killing tests. At0c053c6, all 8 pass.expectPausedchecks, over a 300 ms window:flowSummaries,flowCellsorflowRowscalls;aria-rowcount(2115);aria-busy="true".The alert text is asserted, and Retry is a native
<button>that receivesfocus().busyReads.aria-busyafter Retry.expectRestoredthen asserts the anchor at ±1 px, emptybusyReads(no summary or cell reads while busy), and no alert. A MutationObserver confirms that the anchor is the only flow ever seen at the top, before, during and after the error.view.countscontains exactly the previous and the new row counts, so the failed comparison was never shown. The last page read is for 210 processes.pageReads. The alert reappears with the same paused guarantees, and the second Retry restores the anchor.locate. Code inspection: it returnsundefined(unknown) whilebusy || hasNextPageand returnsnullonly when no pages remain. A failed page therefore no longer makes unloaded keys absent. The test coverage of this is covered in O1.AC2, first-page error (O12): PASS. "shows no rows after a first-page error and restores the anchor on Retry" asserts
aria-rowcount0 with the alert, then the anchor restored at ±1 px and emptybusyReadsafter Retry. Code check: with no fresh pages,hasNextPageis false, soholdingis false and the error shows with no rows, as specified.AC3, error outside a hold: PASS.
aria-busy, thataria-rowcountis unchanged, that the last loaded row is still loaded, and that the row after the page boundary is pending.AC4, O10 mutants and D4: PASS. See the mutation table. N5, N6 and N7 are each killed by exactly one test.
expect(old).toBeDefined()before the offset check, so the check is unconditional, and it passes.flows-grid.test.tsxwith the new harness. Lines without an exact match are explained by:flowRowswrapper, which gained fault injection and is a pass-through otherwise;topRownow also returningindex;faultsandpageReads;grid;AC5, README: PASS.
aria-busychoice and its reason.Harness split (task item 3): accepted
flows-grid-harness.tsis imported only byflows-grid.test.tsxandflows-grid-anchoring.test.tsx;grep -rnoversrcfinds no other importer.vitest, which no production module does.stubGridLayout,watchView,cursorPage,faults.pushorvitest. Vite bundles only whatindex.htmlreaches.services/mock/test-harness.ts, which sits in the same folder, is also test-only, and is allowed by the ESLint boundary.aria-busywhile paused (task item 4): consistentaria-busy. §6.8 requires loading states, responsive controls and keyboard access, and §9.1 requires no scroll-jump.aria-busy="true"signals that the grid's rows are not the current selection's, and this is documented.role="alert"paragraph sits outside the grid.updating(placeholder or seeking, where seeking requires!isError), not bybusy. This is confirmed by test and by mutant Q3.Mutation table
Each mutant was a scratch edit in the QA worktree, run with
npx vitest runon the files named. Each was reverted withgit checkout -- apps/frontend/src/components/comparison/, and none is committed.ComparisonGrid:lostonly fornull/body(focus clause removed)tabindexassertion)ComparisonGrid:pins.current.slice(0, 1)52px, more than 1)ComparisonGrid:if (!pending) record();removeduseFlowGrid:seeking = holding(ignoresisError)FlowsGrid:busy={data.updating}aria-busymissing while paused)useFlowGrid: summaries gated onupdating, notbusyuseFlowGrid: cell tiles gated onupdating, notbusyuseFlowGrid:locatereverted todeb4f29'supdating || (hasNextPage && !isError)useFlowGrid:locatewithbusyonly (nohasNextPage)Timings for #26 (full parallel
test:unit, 88.0 s in total)None is near its budget. The O9 test (16.5 s) is the slowest new one. The e2e suite took 1.0 m on 1 worker.
Defects
None.
Observations (non-blocking)
locatechange is not covered by any test.locatereturns a number. Outside a hold, pins are loaded rows.busygating.updating(Q2, Q5) reads nothing either.expectPaused, in [Task] F4 — Add shared column drag, keyboard reorder and global removal #25 or [Task] F4 — Verify large Flows comparisons and record the milestone gate #26. It is low cost, since the 300 ms window already exists.flows-grid-anchoring.test.tsxsays "see flows-grid-harness.tsx", but the file is.ts.aria-busystaystruewhile nothing is in flight. This differs slightly from ARIA's "being updated" sense. It is an explicit, documented choice that the PM left to the engineer, the alert remains outside the busy region, and some AT may defer reading the grid while busy. Reconsider in [Task] F5 — Complete comparison loading, recovery and accessibility states #33's async-state audit if needed.Next role
Coordinator / maintainer review of PR #73. PASS returns it to review and merge. No merge is authorized by this report. #25 can start once #73 merges. O1 and O2 are candidate follow-ups for #25 or #26.
🤖 Generated with Claude Code
DavidVFitzGerald commentedon Nov 15, 2026
Coordinator: QA PASS at
0c053c6(#69 (comment)). Hostedqualitycheck passes. State → ready for maintainer review of PR #73. #69 closes after the maintainer merges PR #73.QA observations carried forward:
locatechange untested; no scroll-during-pause read check) are noted on [Task] F4 — Add shared column drag, keyboard reorder and global removal #25.aria-busystays set while paused) is for [Task] F5 — Complete comparison loading, recovery and accessibility states #33.🤖 Generated with Claude Code
fix: pause the Flows hold on a row-page error and resume it on Retry …
test: cover hold errors, Retry and the O8/O9 anchoring cases (Refs #69)
docs: describe how errors interact with the Flows hold (Refs #69)
DavidVFitzGerald commentedon Nov 15, 2026
Coordinator: closed. QA PASS at
0c053c6. The maintainer merged PR #73 tomain. Next: #25 gets its post-merge readiness recheck.🤖 Generated with Claude Code
test: cover column operations on the large grid and in Chromium (Refs #…