Skip to content

[Task] F3: render the paginated release and nested process tree #16

Closed

Description

@DavidVFitzGerald

Delivery phase

Phase 1 - frontend with mock services

Goal

Let a verified mock user browse releases and nested category paths without losing hierarchy or loading the whole catalog into the DOM.

Context and authority

Milestone F3; read AGENTS.md, docs/team/product-manager.md, docs/product/LCA_diff_PRD.md, docs/engineering/roadmap.md, and docs/engineering/LCA_diff_Implementation_Specification.md §§6.2, 6.8, 7.1. Current planning baseline is on docs/agent-workflow, pending review/merge into main; proposed ADRs are not accepted authority. Implement process-selector tree components/hooks using discovery services; add synthetic deep-tree and paginated fixtures/tests. These application paths are planned until created. Exclude all archive/reference folders.

Requirements and constraints

Render release → category → subcategory segments → process/geography. Respect provider path segments and preserve source strings; display versions as separately expandable roots. Fetch through the service boundary and support cursor continuation, cancellation and safe loading/error/empty states. Establish accessible disclosure/tree navigation; checkbox selection is added separately.

One session-sized task/PR including verification and handoff. Run all development, installation and checks in containers; install nothing on the host. No real backend, Firebase project, cloud credentials or proprietary inputs. If the current PRD/spec must change, prepare an ADR and updates to both current documents in the same PR.

Acceptance criteria

  • AC1 - The mock release tree shows nested path segments and process geography with stable node identities; separate release roots remain distinct.
  • AC2 - Paging/window continuation reveals descendants beyond the first page without replacing or duplicating already loaded tree nodes.
  • AC3 - Disclosure controls are keyboard-operable with appropriate labels/expanded state; tree item focus remains usable as nodes load/unmount.
  • AC4 - Loading, empty catalog, retryable error and cancellation scenarios are visible and do not leak protected data after logout.
  • AC5 - Tests exercise deep paths, duplicate display labels with distinct identities, pagination and service-driven retry; no component reads fixtures directly.

Out of scope and follow-ups

Reactive search is #17; individual selection/selected list is #18; scoped bulk checkboxes are #19. No real API or database.

Verification plan

Inside ./dev shell, run format:check/lint/typecheck/test:unit/build and npm --prefix apps/frontend run test:e2e. Browse a paginated synthetic tree by keyboard, trigger a failed/retried page and confirm protected reads stop when auth is revoked.

Engineer records branch/SHA and exact results, leaves issue open, and hands off to QA. QA verifies every criterion at that SHA and reports PASS/FAIL/BLOCKED; mock evidence is not proof of real security/integration.

Dependencies and readiness

Blocked by #15, #7. No implementation until dependencies and the M1 environment runtime gate are satisfied. This body is groomed planning material, not PM READY while blockers remain. Coordinator/PM rechecks merged dependencies and session-sized scope before starting.

Current readiness — supersedes historical planning baseline/blockers above

PM: READY for Phase 1/F3 on merged main at 1f8277439cc4a74d23126c87267505944a06fd92.

Dependencies.

The merged documents, contracts and code on main replace the historical planning-branch statements above. AC1–AC5 are unchanged; the decisions below make them objective.

No ADR or specification change. The work uses the existing DataService.releases/search contracts unchanged. Adding an app-layer infinite-query factory and a pinned virtualization dependency are ordinary implementation choices within §3 ("appropriate virtual-grid primitives") and the provisional-DTO latitude. If implementation finds that the contract cannot express a requirement, stop and report it. Do not widen DTOs silently.

Merged interfaces this issue consumes (do not change behavior)

  • src/services/contracts.ts:
    • releases() returns a terminal Page<Release>: next_cursor: null, with the active revision_snapshot.
    • search(SearchRequest) takes fields, an optional exact-segment branch_path, limit, cursor and revision_snapshot, and returns Page<SearchNode>.
    • Branch nodes carry id, release_id, label, path and matching_descendant_count. Process nodes carry id, release_id, label, geography and path.
    • Node IDs are opaque.
  • src/services/mock/discovery.ts:
    • Each page bounds process leaves (limit ≤ window_limit, default 100; more gives REQUEST_WINDOW_TOO_LARGE). Leaves are sorted by case-insensitive name, then geography, then ID.
    • Each page repeats each returned leaf's full ancestor chain from the release root (path: []).
    • total_count counts matching processes.
    • Cursors are bound to operation, fields, branch and snapshot. Replaying a cursor with other inputs gives INVALID_FILTER.
    • branch_path-scoped paging with a single-release snapshot is supported.
    • matching_descendant_count counts over the request's whole match set. It is therefore exact for nodes at or below the requested branch_path and partial for ancestors above it.
    • scenario.latency_ms may be a number or (operation, sequence) => ms. scenario.failures is a static per-instance map.
    • createDiscoveryCatalog(n) only generates more leaves on the fixture's paths.
  • src/app/queries.ts: useServiceQueries() gives plain queryOptions keyed ["lca-services", 1, namespace, uid, operation, dto], enabled only for a verified UID. No infinite or cursor query exists yet.
  • src/App.tsx: the Workspace #process-sidebar holds the placeholder text "Choose processes here…" under the heading "Processes", and Workspace is keyed by UID. Sign-out locks the session and clears the QueryClient (service-context.ts).
  • Default composed demo catalog: one release, "Synthetic precision fixture", version "fixture v1", active revision two. It has three processes:
    • transport systems › road › operations › Synthetic road service Alpha — CH
    • transport systems › road › operations › Synthetic road service Gamma — CH
    • transport systems › road › operations › infrastructure › Synthetic road service Beta — DE

Decisions

D1 — Loading model: lazy per-branch loading, cursor-paged.

  • Roots come from the shared queries.releases() options. Reuse that exact key so the existing session.test.tsx read counts stay valid.
  • Every release is a separate root, labelled from display_name plus version verbatim. Roots start collapsed, and nothing is searched until the user expands a node.
  • Expanding a release root or branch issues search({ fields: {}, branch_path: node.path, revision_snapshot: [that release's {release_id, revision_id}], limit: TREE_PAGE_LIMIT }). Continuation passes that query's next_cursor.
  • TREE_PAGE_LIMIT is an exported module constant of 50 with no runtime configuration. Tests size their catalogs against it.
  • There is no single whole-catalog walk and no per-node child-listing endpoint.

D2 — App-layer query factory and no service change.

  • Add an infinite-query factory (for example searchPages(input)) to createServiceQueries.
  • It uses the same auth guard and capture, and a distinct key segment so it never collides with the plain search key: ["lca-services", 1, namespace, uid, "searchPages", dtoWithoutCursor].
  • Use initialPageParam: undefined and getNextPageParam: (last) => last.next_cursor ?? undefined.
  • Do not change src/services/** behavior, contracts or the mock runner.
  • For retry, tests wrap the injected DataService locally, for example to fail on the first call and then delegate. The static failures map cannot express fail-then-succeed, and it is not to be extended here.

D3 — Merge rules (pure, unit-tested model).

  • Build the visible tree as a pure function of the loaded pages in the query cache. Do not keep a separate long-lived store of protected data.
  • Parent linkage comes from release_id plus a path prefix: a branch's parent has path.slice(0, -1), and a process's parent branch has path equal to the process path.
  • Never parse or construct service node IDs. The branch at path: [] is that release's root.
  • Deduplicate by (release_id, id) across all scoped queries. A node keeps its React key and identity when later pages arrive.
  • Accept matching_descendant_count for a node only from queries whose branch_path is a prefix of, or equal to, that node's path. Ignore counts reported for ancestors of a deeper scope.
  • Order siblings deterministically, independent of load order:
    • sub-branches first, ordered by lower-cased label (code-unit compare) and then ID;
    • then processes, in the service order (lower-cased name, geography, ID).
  • Render labels, segments and geography verbatim: no trimming, case change or re-splitting.
  • Pages for a release are bound to the snapshot used by its root. A different snapshot creates different keys and never mixes with earlier pages.

D4 — Accessible pattern: ARIA tree with roving tabindex. Use role="tree", named "Processes", containing flat, virtualized role="treeitem" rows.

D5 — Focus through loading and unmounting. The active item is tracked by node identity, not index.

  • The active row is always kept mounted (for example with a virtualizer rangeExtractor) and scrolled into view on keyboard moves. DOM focus never falls to body during scrolling or loading.
  • After a continuation load, focus stays on the continuation row if more pages remain. Otherwise it moves to the first newly revealed item.
  • Collapsing an ancestor of the focused item moves focus to that ancestor.
  • A failed load leaves focus on the branch or its retry row.

D6 — Virtualization: introduce @tanstack/react-virtual here.

  • Add it as an exact-pinned runtime dependency (no range). Use the latest 3.x release published at least 14 days before installation and compatible with the React 19.3.1 peer. Record the version and publish date in the PR.
  • Install only inside the container (npm --prefix apps/frontend install --save-exact @tanstack/react-virtual@<x.y.z>). Commit the package.json and package-lock.json diff, limited to that package. npm ci must pass.
  • Use fixed-height rows with modest overscan. F4/[Task] F4 — Virtualize comparison rows and columns with sticky alignment #23 reuses the same primitive for variable rows and columns, so do not add a second library later.
  • Fetch subscriptions belong to expanded branches whose ancestors are all expanded, never to mounted virtual rows. Scrolling therefore never aborts or refetches a page.

D7 — States.

  • Loading releases shows a polite loading status.
  • An empty catalog (zero releases) shows "No published releases are available." without an error.
  • A root or branch with zero matches shows an explicit empty row.
  • A failed releases load or page load shows a safe message from ServiceError, without request details beyond the message. A Retry control appears only when retryable is true. Retry re-requests only the failed page, and loaded nodes remain.
  • Non-retryable errors (for example STALE_SNAPSHOT) show the message without automatic retries.
  • Session-loss codes keep the existing guard behavior: lock the session and clear the cache.
  • Announce page-load completion and failure through one polite live region outside the tree.

D8 — Cancellation.

  • Collapsing a branch, or an ancestor of it, while its page is in flight aborts that request through the TanStack signal. No error is shown, already loaded pages stay cached, and re-expanding starts the request again.
  • Signing out during an in-flight page aborts the request or discards its result through the guard epoch. No tree data or error is rendered afterwards.
  • Expanded state is in-memory React state only. Per §6.8 it is never written to browser storage, and it resets on account change.

D9 — Scenario controls: component-level injection; no shipped scenario switch.

  • Add no query parameters, window globals, environment or build flags, or UI to select latency, failure, empty or large catalogs in the composed app. createApplication("mock") stays as is.
  • Latency, failure/retry, empty, large, deep, duplicate-label, multi-release, pagination and cancellation scenarios are covered with Vitest/RTL. Those tests inject createMockDiscovery({ catalog, window_limit, scenario }) (wrapped where needed) through ApplicationProviders with mode: "test".
  • Test catalogs are plain DiscoveryCatalog objects built in test files, or in a test-only helper that no production module imports. Keep the ESLint service boundary unchanged; do not weaken any rule.
  • Browser tests use the composed default demo catalog. That catalog is too small to page with a 50-leaf limit, so the browser does not prove continuation, latency or large-catalog DOM bounds.
  • Record these as component-level evidence, not browser PASS. The browser-reachable large synthetic scenario decision is carried to F4 #23, whose 200×2,000 Chromium workload needs the same mechanism, and to the F3 gate in [Task] F3: implement filter-scoped bulk selection and tri-state parent checkboxes #19 AC6. If added there, it must be explicit, validated, mock-mode-only, visibly identified as demo, and never a fallback.

D10 — Existing tests.

  • The verified workspace now issues only releases() on mount, and no search until the user expands a node.
  • Deliberately update src/App.test.tsx assertions that expected zero data calls in verified states. The two verified cases currently call expectNoDataCalls. Change them to "only releases" and give their harness unprotected discovery data so that a mock AUTH_REQUIRED does not lock the session.
  • Keep every pre-verification zero-call assertion. Update the e2e/component tests that referenced the "Choose processes…" placeholder; keep the "Processes" heading.

D11 — Roadmap: include the status update in this PR. The #16 PR includes a small supporting-documentation commit to docs/engineering/roadmap.md:

The #15 closure comment deferred this to "the next roadmap-touching PR", and no separate issue exists. This is a status correction tied to work already closed, so the issue-first rule is kept. Make no other roadmap changes beyond the D9 carry-forward note, which is optional, at most one line in F3 and F4.

Scope

Objective verification (maps to AC1–AC5)

Model unit tests (model.test.ts):

  • (AC1) Paths of six or more segments, including segments with mixed case and /, & and surrounding spaces, render verbatim. Two releases with identical paths stay distinct.
  • (AC5) Duplicate labels produce distinct nodes:
    • an "operations" branch under two different parents;
    • two same-name, same-geography processes with different IDs.
  • (AC2) Merging a second page and a deeper-scoped query deduplicates and does not change existing node identity or order. Ancestor counts from deeper scopes are ignored. Sibling order is the same in every load order.

Component tests (ProcessTree.test.tsx plus App/session integration, with injected createMockDiscovery):

  • (AC1) The release roots render collapsed with display_name/version. Expanding issues a single-release, branch_path-scoped search with limit 50 (spy on the DTO).
  • (AC2) A branch with at least 120 leaves shows "Load more"; continuation reveals leaves 51–100 and then 101–120. Previously rendered treeitem elements remain the same DOM nodes, every key is unique, and the continuation disappears when the branch is exhausted.
  • (AC3) Each key in D4 moves focus and toggles aria-expanded. The tests check aria-level, aria-setsize (including -1), aria-posinset, accessible names, and a single tabindex=0. Focus follows D5 through load, collapse and continuation completion. Space does not toggle expansion.
  • (AC3/§9.1) With at least 2,000 loaded leaves and mocked element sizes in jsdom, the mounted treeitem count stays at or below the viewport rows plus overscan plus the pinned active row. Keyboard navigation to an off-screen item scrolls it in and focuses it.
  • (AC4) The following are covered:
    • the loading status under latency;
    • an empty catalog;
    • a zero-match branch;
    • a releases failure and a page failure, TEMPORARILY_UNAVAILABLE then success through the wrapper, where Retry recovers and the loaded nodes remain;
    • a non-retryable error with no Retry control;
    • collapse during an in-flight page, where the spied signal.aborted is true, no error is shown, and re-expanding refetches;
    • sign-out during an in-flight page and after load, where no tree text remains and the QueryClient holds no lca-services entries;
    • signing in again as the same or a different UID, where roots are collapsed and expansion state is not in storage.
  • (AC5) The existing lint boundary test still passes. No component imports services/mock/**.

Browser (e2e/process-tree.spec.ts, Chromium and Firefox, composed mock; not @smoke):

  1. Sign in as [email protected].
  2. Tab once into the tree and confirm the visible focus ring.
  3. Use the keyboard to expand the root, then transport systems › road › operations, and assert:
    • the infrastructure branch;
    • "Synthetic road service Alpha — CH" and "Synthetic road service Gamma — CH";
    • aria-level 1 (root) to 5 (infrastructure and the operations processes) with matching aria-expanded;
    • after expanding infrastructure, "Synthetic road service Beta — DE" at level 6;
    • ArrowLeft returns to the parent;
    • branch counts (root 3, operations 3, infrastructure 1).
  4. Assert no fetch/XHR or external requests and no console errors.
  5. Sign out and assert that no tree text remains.
  6. Sign in again and assert the root is collapsed and no tree or expansion storage key was written.

Record pagination, latency and large-DOM checks as component-level only (D9).

Verification (container only; nothing installed on the host)

COMPOSE_PROJECT_NAME=lca-diff-f3-tree FRONTEND_PORT=<free port> ./dev up
COMPOSE_PROJECT_NAME=lca-diff-f3-tree FRONTEND_PORT=<free port> ./dev check
docker compose -p lca-diff-f3-tree exec -T workspace bash -lc 'npm --prefix apps/frontend install --save-exact @tanstack/react-virtual@<x.y.z> --no-audit --no-fund'   # once, D6
docker compose -p lca-diff-f3-tree exec -T workspace bash -lc 'npm --prefix apps/frontend ci --no-audit --no-fund'
docker compose -p lca-diff-f3-tree exec -T workspace bash -lc 'cd apps/frontend && npm run format:check && npm run lint && npm run typecheck && npm run test:unit && npm run build'
docker compose -p lca-diff-f3-tree exec -T workspace bash -lc 'cd apps/frontend && npm run test:e2e -- --grep @smoke'
docker compose -p lca-diff-f3-tree exec -T workspace bash -lc 'cd apps/frontend && npm run test:e2e'

Expected evidence:

  • Chromium and Firefox pass both the smoke subset and the full suite, with counts recorded.
  • The lockfile diff is limited to @tanstack/react-virtual.
  • Hosted PR quality passes at the delivered SHA. The full-suite workflow_dispatch run is recorded, or marked NOT RUN with the reason.

Handoff. The engineer hands off the branch/SHA, the PR (Refs #16, no closing keyword), the D9 component-only evidence list and its limitations to independent QA, which verifies at that SHA. Mock evidence does not prove real authentication, authorization, data security or real search performance.

Activity

  1. added
    task
    frontend
    blocked
    on Nov 13, 2026
  2. DavidVFitzGerald commented on Nov 13, 2026

    @DavidVFitzGerald
    OwnerAuthor

    PM: BLOCKED

    Groomed using docs/team/product-manager.md for F3, Phase 1 — frontend with mock services. Documentation review: PASS for scope, required sections, specification coverage and acyclic dependency links; this is not application QA or implementation readiness.

    Blocking predecessor issues: #15, #7. The M1 runtime gate (#2) and merged bootstrap/M2 configuration (#3) also remain required. PM must recheck merged dependencies and current interfaces before changing this to READY.

    Engineer implements one issue, commits regularly and hands the delivered SHA plus exact container checks to independent QA; do not close before QA, review and approved merge. No backend/Firebase/cloud credentials or host installations are required for Phase 1.

  3. DavidVFitzGerald commented on Nov 14, 2026

    @DavidVFitzGerald
    OwnerAuthor

    PM: READY — Phase 1/F3, AC1–AC5 unchanged, on main 1f82774. Dependencies: #15 is closed with independent QA PASS, hosted quality and full-suite SUCCESS, and a maintainer merge of PR #49 (1f82774); all F2 tasks #11–#15 are closed. #7 is closed, merged by PR #41 as af4aa98. M1 (#2) and M2 (#3) are closed. Spec §§6.2, 6.8, 7.1, 7.3 and 9.1. No ADR and no contract, service or spec change.

    Decisions (full detail in the appended body section):

    • D1: lazy per-branch loading with search({fields:{}, branch_path, single-release snapshot, limit 50}) and explicit cursor continuation. Roots come from the shared releases() key and start collapsed.
    • D2: an app-layer searchPages infinite-query factory with a distinct key. Retry is tested through test-local wrappers.
    • D3: a pure merge model that dedupes by release+ID and does not parse IDs. Counts are accepted only from in-scope queries, sibling order is deterministic, and labels are verbatim.
    • D4: an ARIA tree with roving tabindex, level/setsize/posinset, Space reserved for [Task] F3: manage individual selection order and a virtualized selected-process list #18/[Task] F3: implement filter-scoped bulk selection and tri-state parent checkboxes #19 aria-checked.
    • D5: the focused node stays mounted across loads, collapses and scrolling.
    • D6: add @tanstack/react-virtual as an exact-pinned 3.x dependency (at least 14 days old), installed in the container. Fetch subscriptions belong to expanded branches, not to mounted rows.
    • D7/D8: loading, empty, zero-match and retryable/non-retryable error states; aborting on collapse and sign-out; expansion state is never stored.
    • D9: no shipped scenario switch. Latency, failure, large, empty and paging scenarios are component-level with an injected createMockDiscovery. The browser covers the default demo catalog only. The browser-reachable large-scenario decision is carried to [Task] F4 — Virtualize comparison rows and columns with sticky alignment #23 and [Task] F3: implement filter-scoped bulk selection and tri-state parent checkboxes #19 AC6.
    • D10: update the verified-state zero-data-call assertions to "releases only".
    • D11: this PR also marks F2 complete in roadmap.md, a supporting status correction with no separate issue.

    Out of scope: #17 (search), #18 (selection), #19 (bulk), F4 and F5. Exact files, tests and container commands are in the body. Handoff to the Software Engineer, then independent QA at the delivered SHA.

  4. DavidVFitzGerald commented on Nov 14, 2026

    @DavidVFitzGerald
    OwnerAuthor

    Engineering: READY FOR QA

  5. DavidVFitzGerald commented on Nov 14, 2026

    @DavidVFitzGerald
    OwnerAuthor

    QA: PASS

    QA: PASS at SHA f8d537053633979ef9a0457bc3103c1ee7acdb6a (f8d5370, branch feat/f3-process-tree, PR #50). Phase 1, mock mode only. This does not prove real authentication, authorization, data security or real search performance.

    Environment. Independent detached worktree /tmp/lca-diff-qa16 at f8d5370, rootless compose project lca-diff-qa16 (FRONTEND_PORT=5187). Every install, check and test ran in the workspace container, and nothing was installed on the host. I removed the worktree and compose project (down -v) afterwards. No application code was changed or committed; the temporary QA scratch test was deleted and git status was clean.

    Commands and results

    Command (in container unless noted) Result
    ./dev up, ./dev check PASS (rootless preflight with 8 scenarios, restricted capabilities, frozen lock)
    npm --prefix apps/frontend ci --no-audit --no-fund PASS, 232 packages
    npm run format:check / lint (--max-warnings 0) / typecheck PASS / PASS / PASS
    npm run test:unit PASS 185/185, then 6 further consecutive runs all 185/185 (no flakiness)
    npm run build PASS (JS 342.74 kB, 105.12 kB gzip)
    npm run test:e2e -- --grep @smoke PASS 10/10 (Chromium and Firefox)
    npm run test:e2e PASS 28/28 (Chromium and Firefox), including process-tree.spec.ts in both
    host git diff main...HEAD -- package.json package-lock.json Only @tanstack/react-virtual 3.14.24 (exact, no range) and its dependency @tanstack/virtual-core 3.19.9 were added. npm ls confirms the tree
    npm view … time 3.14.24 was published 2026-10-29. 3.14.25 (11-01) and 3.14.26 (11-03) are under 14 days old, so 3.14.24 is the correct latest-eligible version. Its peer range includes React 19
    Hosted PR quality pass at f8d5370. Full dispatch run 43605436596 success, headSha f8d5370

    Adversarial checks (temporary component tests with injected createMockDiscovery, deleted afterwards)

    • Collapsing during an in-flight continuation (page 2) aborts its signal (aborted: true) and shows no error. On re-expand, the cached first page ("50 of 120") comes back without a refetch. PASS
    • A direct account change A→B (no sign-out) on an expanded tree leaves the roots collapsed and no transport rows. The query cache holds only account-b keys, and sessionStorage is empty. PASS
    • AUTH_REQUIRED on a page read locks the session and leaves no tree text. PASS
    • Space on a collapsed root does not expand it. PASS
    • Focus after leaving the tree to a non-focusable area: finding F-1 below.

    Per-criterion verdicts

    • AC1: PASS. Release roots use the shared releases() key and are labelled display_name + version verbatim. They start collapsed (ProcessTree.tsx:205-217) and nothing is searched until a node is expanded. Expanding issues search({fields:{}, branch_path, single-release snapshot, limit: TREE_PAGE_LIMIT=50}) (ProcessTree.tsx:96-105, model.ts:9). Node keys are JSON of (kind, release, id), or release+path for linkage, and IDs are never parsed (model.ts:49-58). Model tests cover six-segment verbatim paths and two releases with identical paths. The e2e checks levels 1–6 and the counts 3/3/3/1.
    • AC2: PASS. Explicit "Load more" uses next_cursor. The paging test keeps the same DOM node for leaf 0000 across pages 1–3, all keys are unique, 120 leaf rows end up rendered, and the continuation disappears when the branch is exhausted. The merge deduplicates by (release, id), and sibling order is independent of load order (model.ts:142-174). Ancestor counts from deeper scopes are ignored (model.ts:117). Pages from another revision are ignored.
    • AC3: PASS. role=tree labelled by the "Processes" heading, with one tabindex=0 (roving). Arrow, Home, End and Enter follow D4, and Space is unbound (ProcessTree.tsx:383-420). Each row carries aria-level/posinset/setsize (-1 while next_cursor remains), aria-expanded and aria-busy. Accessible names follow D4, and the focus ring is a 3px solid outline (e2e). The active row is pinned through rangeExtractor (ProcessTree.tsx:332-337), and the focus fallbacks follow D5 (:298-321). With 2,000 leaves, mounted rows stay within viewport + overscan + pinned row, and keyboard focus scrolls into view (component-level, jsdom geometry stubs).
    • AC4: PASS. Covered states: loading status under latency, an empty catalog ("No published releases are available."), a zero-match/empty branch row, and a releases failure plus a page failure with Retry that recovers while loaded nodes remain. A non-retryable STALE_SNAPSHOT shows no Retry. Collapsing aborts the request without an error. Sign-out during and after loading aborts and leaves no tree text and no lca-services cache entries. Re-login as the same or another UID starts collapsed, with nothing in storage. Expansion state is useState only, with no storage access in src/components. In the browser, sign-out leaves no tree text, and re-login has a collapsed root and an unchanged localStorage key set.
    • AC5: PASS. Tests cover deep paths, duplicate labels (an "operations" branch under two parents, and same-name same-geography processes with different IDs), pagination, and retry through a test-local wrapper. grep finds no services/mock, fetch(, XHR, Firebase or storage use in src/components, queries.ts or App.tsx, and the lint boundary is unchanged and passing. No scenario switch ships (no query parameters, globals or new env flags; composition.ts is not in the diff).
    • D1–D11: All verified, as above. D2: the searchPages key is ["lca-services",1,ns,uid,"searchPages",dto] without the cursor, behind the same enabled/auth guard (queries.ts:76-102), and src/services/** behavior is unchanged. D10: App.test.tsx now asserts "only releases", and the pre-verification zero-call assertions are kept. D11: the roadmap marks F2 Complete (F2: verify complete mock authentication and accessible shell journeys #49 / 1f82774) and F3 "[Task] F3: render the paginated release and nested process tree #16 in progress". Accepted deviations: the scenario tests are in src/services/mock/process-tree.test.tsx because of the lint boundary, and the e2e reaches the tree tab stop by focusing the root, then Shift+Tab and Tab, rather than one Tab from page load. Both are acceptable. No PRD or spec deviation, so no ADR is required.
    • D9 limitation (unchanged): continuation, latency, failures and large-DOM bounds are component-level evidence only. The browser covers just the three-process demo catalog. The browser-reachable large scenario is carried to [Task] F4 — Virtualize comparison rows and columns with sticky alignment #23 and [Task] F3: implement filter-scoped bulk selection and tri-state parent checkboxes #19 AC6.

    Findings (none blocking)

    • F-1 (Medium, accessibility; component-level reproduction). The tree can steal focus back after the user has left it. ProcessTree.tsx:465-469 clears treeFocused only when relatedTarget is a Node outside the tree. Clicking a non-focusable area (header text, the "Processes" heading) or element.blur() gives relatedTarget === null, so the flag stays true. The effect at :355-356 then calls element.focus() when rows change, for example when a pending page arrives.
      • Repro (RTL): use search latency of 150 ms, focus the tree, press ArrowRight, then document.activeElement.blur() (activeElement is now body). Wait for "transport" to appear.
      • Expected: focus stays on body. Actual: a treeitem receives focus.
      • In the composed demo this is hard to hit, because clicking main moves focus to a focusable element and there is no latency. It becomes realistic with Phase 2 latency.
      • Suggested fix: treat a null relatedTarget as leaving the tree, or check document.activeElement inside the tree before calling focus(), and add a regression test. Recommend fixing in this PR or in a linked Bug before [Task] F3: manage individual selection order and a virtualized selected-process list #18 builds on the tree.
    • F-2 (Low). The roving active state is updated only by keyboard moves and onClick, not onFocus (ProcessTree.tsx:462-464, 489-492). If focus reaches a tabindex=-1 row by programmatic or assistive-technology focus, Enter acts on the previously active row, not the focused one. Suggest syncing active from a row's focus event.
    • F-3 (Low, ARIA polish). The pseudo rows (Load more, loading, empty, error) are treeitems at the child level without aria-posinset/aria-setsize, so the reported set size excludes them (ProcessTree.tsx:565-607). This is acceptable for now; revisit with [Task] F3: manage individual selection order and a virtualized selected-process list #18/[Task] F3: implement filter-scoped bulk selection and tri-state parent checkboxes #19 aria-checked work.
    • F-4 (Low, documentation). D6 asks for the dependency's publish date to be recorded in the PR. It is in neither the PR body nor f3-process-tree-verification.md. QA confirmed the date independently (2026-10-29).
    • F-5 (Observation). For the component's lifetime, a collapsed branch's pages are kept in React state as well as in the query cache (ProcessTree.tsx:249-259), for stable names and counts. D3 discourages a separate long-lived store. Here the state is bounded by the UID-keyed Workspace and verified cleared on sign-out and account change, so this is not a leak. Note it for [Task] F3: add reactive AND-tokenized process search with cancellation #17/[Task] F3: implement filter-scoped bulk selection and tri-state parent checkboxes #19, so cache eviction does not diverge from the rendered data.
    • e2e gap (Low): the browser storage assertion compares localStorage keys only. sessionStorage/IndexedDB are not checked in the browser, although the code has no storage access and the component test checks sessionStorage.

    Next action

    PASS goes to the coordinator and maintainer review/merge of PR #50. I recommend Engineering address F-1 (and optionally F-2) before merge or in a linked Bug issue, with QA re-checking any fix SHA. QA has not closed the issue.

  6. DavidVFitzGerald commented on Nov 14, 2026

    @DavidVFitzGerald
    OwnerAuthor

    Engineering: QA findings addressed — READY FOR QA re-check at dbc5ff0 (PR #50).

    • F-1 fixed: onBlur with no next target clears the focus flag when the blurred row is still mounted (user left to a non-focusable area); unmounted focused rows (collapse/virtualization) still restore focus per D5. Regression test: blur during a 60 ms page load leaves focus on body.
    • F-2 fixed: tree onFocus makes the focused row active. Regression test: script focus on root, Enter expands it, not the previous active row.
    • F-4: publish date 2026-10-29 recorded in docs/engineering/f3-process-tree-verification.md.
    • F-3 (pseudo-row posinset/setsize) and the browser sessionStorage/IndexedDB check remain non-blocking follow-ups.
    • Container: both new tests fail without the fix and pass with it; lint/typecheck/format/build PASS; test:unit 187/187 ×3; full e2e 28/28.
  7. DavidVFitzGerald commented on Nov 14, 2026

    @DavidVFitzGerald
    OwnerAuthor

    QA: PASS

    QA re-check: PASS at SHA dbc5ff087541340c56b48d4c56ad60e1006b2ed3 (dbc5ff0, branch feat/f3-process-tree, PR #50). Phase 1, mock mode only. This does not prove real authentication, authorization, data security or real search performance. Hosted CI for dbc5ff0 is tracked by the coordinator and is not covered here.

    Environment. Fresh detached worktree /tmp/lca-diff-qa16 at dbc5ff0, rootless compose project lca-diff-qa16 (FRONTEND_PORT=5187). All tooling ran in the container. Nothing was installed on the host and no application code was changed. The temporary QA scratch tests were deleted, git status was clean, and the compose project (down -v) and the worktree were removed.

    Change reviewed (git diff f8d5370 dbc5ff0): ProcessTree.tsx onFocus/onBlur (+21/-3), two new regression tests in src/services/mock/process-tree.test.tsx, and the verification record. No dependency, service, contract or composition changes. Against main, the lockfile diff is still only @tanstack/react-virtual 3.14.24 + @tanstack/virtual-core 3.19.9.

    Gates (container)

    Command Result
    ./dev up, ./dev check PASS
    frozen npm ci PASS, 232 packages
    format:check, lint, typecheck PASS
    test:unit (vitest run) repeated 187/187 in 59 of 60 runs. The one failure (1/60) is a pre-existing flake in src/auth/AuthDialog.test.tsx:248, unrelated to #16; see F-6
    build PASS
    test:e2e --grep @smoke PASS 10/10 (Chromium + Firefox)
    test:e2e full PASS 28/28 (Chromium + Firefox)

    Re-verification of the findings

    • F-1: FIXED.
      • My original reproduction now passes, repeated 3×: search latency 150 ms, focus the tree, ArrowRight, document.activeElement.blur(), wait for the "transport" rows. Focus stays on body; at f8d5370 it was reclaimed.
      • Re-entering the tree still works: focusing the tab stop and pressing ArrowDown moves to "transport".
      • Variant: blurring from a non-root row while its branch loads (latency 100 ms) also leaves focus on body.
      • Engineering's regression test does not take focus back after the user leaves the tree to a non-focusable area passes.
      • Review of the mechanism. A null relatedTarget clears the flag only when, in a microtask, the blurred row is still connected and focus is outside the tree. When the focused row unmounts (exhausted continuation, error→row, collapse), the flag is kept, so D5 restoration still applies.
      • A window or tab switch keeps document.activeElement on the row, so the flag is correctly kept in that case too.
    • F-2: FIXED. The tree's onFocus makes the focused row active. Scratch test: focus "Alpha catalog 2026 v2" by script, press Enter, and v2 expands (v1 does not). v2 is then the only tabindex=0. Engineering's regression test also passes.
    • F-4: FIXED. f3-process-tree-verification.md records the publish date 2026-10-29, and the note that newer releases were under 14 days old. That matches QA's earlier npm view check.
    • D5 still holds (component-level, scratch tests):
      • The existing test moves focus to a collapsed ancestor and keeps focus out of the body passes.
      • Pointer-collapsing the root while focus is on a level-3 row leaves focus on the root, which is collapsed and the single tabindex=0.
      • Pressing Enter on a focused "Load more in t" row: when the branch is exhausted, focus moves to the first newly revealed leaf ("Leaf 0050 — CH"), not to body.
      • For an exhausted root-level continuation whose new leaves sit under a collapsed child, no direct child is new, so focus correctly falls back to the branch itself ("Big v, 60 processes"), not body.
      • Browser e2e (ArrowLeft to parent, single tab stop, f2-gate tab order) passes in Chromium and Firefox.

    Per-criterion verdicts

    AC1–AC5 all PASS, as recorded in the first QA pass at f8d5370. Nothing in this fix changes data loading, merging, paging, cancellation or the session-clearing paths, and the gates above confirm this. D1–D11 are still satisfied. The D9 limitation is unchanged: continuation, latency, failure and large-DOM evidence is component-level only.

    Remaining findings (non-blocking)

    • F-3 (Low, open): the pseudo rows (Load more, loading, empty, error) lack aria-posinset/aria-setsize. Revisit with [Task] F3: manage individual selection order and a virtualized selected-process list #18/[Task] F3: implement filter-scoped bulk selection and tri-state parent checkboxes #19.
    • F-5 (Observation): loaded pages of collapsed branches stay in component state for the tree's lifetime. They are verified cleared on sign-out and account change.
    • e2e gap (Low, open): the browser test checks localStorage only, not sessionStorage/IndexedDB.
    • F-6 (Low, pre-existing, not [Task] F3: render the paginated release and nested process tree #16): AuthDialog.test.tsx › "resets a known account, reports unknown ones and returns to sign-in" intermittently fails at :248 (expect(back).toHaveFocus()) under the full parallel suite.
      • At dbc5ff0 it failed once in 60 runs. It also reproduces on main 1f82774 (failed on run 19 of a 40-run loop). The test renders the anonymous shell, where the tree is not mounted, and src/auth/** is untouched by this PR.
      • Reproduce: for i in $(seq 1 40); do npx vitest run || break; done in apps/frontend.
      • I recommend the coordinator open a separate Bug (F2 auth dialog focus timing) using docs/issue_templates/bug.yml. It is not filed by QA.

    Next action

    PASS goes to the coordinator: record hosted CI for dbc5ff0, then maintainer review and merge of PR #50. QA has not closed the issue.

  8. DavidVFitzGerald commented on Nov 14, 2026

    @DavidVFitzGerald
    OwnerAuthor

    Coordinator: QA re-check PASS at dbc5ff0 (issuecomment-6879186783); hosted CI PASS at dbc5ff0 (quality run 43606493535, full dispatch 43606547785). State: ready for review — PR #50 awaits maintainer merge. Follow-ups filed: #51 (pre-existing flaky AuthDialog focus test, F-6), #52 (pseudo-row ARIA positions F-3 and sessionStorage/IndexedDB browser check). F-5 is an observation; no action needed.

  9. DavidVFitzGerald commented on Nov 14, 2026

    @DavidVFitzGerald
    OwnerAuthor

    Closed by coordinator: PR #50 merged by the maintainer after QA PASS (re-check at dbc5ff0) and hosted CI PASS. Follow-ups: #51, #52.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    blockedfrontendtask

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions