Skip to content

F3: process tree pseudo-row ARIA positions and full browser storage check #52

Closed

Description

@DavidVFitzGerald

Delivery phase

Phase 1 — frontend with mocks (F3 follow-up).

Goal

Close two non-blocking QA follow-ups from #16 (PR #50): give the process tree's pseudo rows (Load more, loading, empty, error) consistent ARIA set positions, and make the browser storage check cover localStorage, sessionStorage and IndexedDB before and after re-login.

Context and authority

  • QA on [Task] F3: render the paginated release and nested process tree #16: finding F-3 (pseudo treeitems carry aria-level but no aria-posinset/aria-setsize) and the e2e gap (e2e/process-tree.spec.ts compares localStorage keys only).
  • Spec §6.2 (process tree), §6.8 (keyboard/ARIA accessibility; persist only the listed workspace fields under a UID-scoped key, do not persist temporary expanded tree nodes; clear in-memory data on logout/account change), §9.2 item 17 (per-user storage). AGENTS.md correctness gates (no protected data before verified auth).
  • Code today: apps/frontend/src/components/process-tree/ProcessTree.tsx builds rows in walk(); real nodes get posinset: index + 1 and setsize = child count when the branch's load is complete, else -1; the pseudo() rows get neither. e2e/selection.spec.ts already reads sessionStorage keys (precedent).

Requirements and constraints

  • Pattern (default): a pseudo row is the last member of its branch's child set: aria-posinset = rendered real children + 1; aria-setsize = -1 while the branch's load is incomplete (same as its siblings), otherwise real children + 1 (so an empty branch's row is 1 of 1). Real nodes' values stay unchanged. Another WAI-ARIA 1.2-valid pattern is allowed only if justified in the PR and applied to all four kinds.
  • No other tree behaviour changes (keyboard navigation, focus, selection, paging, search, roving tab stop).
  • The storage check reads storage in the page; no product storage code is added.
  • Does not touch files of concurrent [Task] F5 — Add the indicator tree and source-ordered selection state #27/PR F5: add independent indicator tree and selection (#27) #88 (App.tsx, session.test.tsx, services/mock/test-harness.ts, indicator tree). If a test-harness change is unavoidable, merge origin/main after F5: add independent indicator tree and selection (#27) #88 lands first.

Acceptance criteria

  • AC1 Each pseudo kind renders aria-level, aria-posinset and aria-setsize per the pattern.
  • AC2 Component tests in src/services/mock/process-tree.test.tsx assert exact level/posinset/setsize for: loading (first page pending), more (hasNext), error on the first page, error on a later page (nextFailed), and empty; and that the real siblings' values are unchanged in each case.
  • AC3 e2e/process-tree.spec.ts records, before sign-out and after re-sign-in (after expanding branches): localStorage keys and values, sessionStorage keys, and indexedDB.databases() names. It asserts the localStorage and sessionStorage key sets and the IndexedDB database names are identical before and after (the sessionStorage and IndexedDB lists are expected to be empty; record what was observed), and no localStorage value contains tree expansion state (expanded branch path segments such as transport systems, or tree node keys). It fails, not skips, if indexedDB.databases is unavailable in a project.
  • AC4 It passes in Chromium and Firefox; existing process-tree, selection, bulk-selection and search unit/e2e tests pass unchanged.
  • AC5 Container gates pass: frozen npm ci, format:check, lint, typecheck, test:unit, build, full test:e2e; hosted quality passes on the PR.

Out of scope and follow-ups

Any tree behaviour change beyond these attributes and checks; F-5 (observation only); unit-suite budgets (#76/#87); AuthDialog flake (#51 — if it appears in a run, rerun and cite #51, do not fix here).

Verification plan

git -C /home/david/projects/LCA-diff fetch origin
git -C /home/david/projects/LCA-diff worktree add -b fix/52-tree-aria-storage /tmp/lca-diff-tree52 origin/main
cd /tmp/lca-diff-tree52
ss -ltn | grep ':5223 ' && echo 'port 5223 busy - pick another and record it'
COMPOSE_PROJECT_NAME=lca-diff-tree52 FRONTEND_PORT=5223 ./dev up
COMPOSE_PROJECT_NAME=lca-diff-tree52 FRONTEND_PORT=5223 ./dev check
docker compose -p lca-diff-tree52 exec -T workspace bash -lc 'cd apps/frontend && npm ci --no-audit --no-fund && npm run format:check && npm run lint && npm run typecheck && npx vitest run src/services/mock/process-tree.test.tsx && npm run test:unit && npm run build'
docker compose -p lca-diff-tree52 exec -T workspace bash -lc 'cd apps/frontend && npm run test:e2e -- e2e/process-tree.spec.ts --reporter=list && npm run test:e2e'
COMPOSE_PROJECT_NAME=lca-diff-tree52 ./dev down

Host rule: at most two container suites at once; do not run the full unit or e2e suite while #76's gate runs are in progress (coordinator confirms). Show AC2/AC3 tests failing before the change (record) and passing after.

Dependencies and readiness

Dependencies met: #16 merged (PR #50); F3 complete. Groomed READY 2026-11-15; runs in parallel with #76/#87. Likely files: apps/frontend/src/components/process-tree/ProcessTree.tsx, apps/frontend/src/services/mock/process-tree.test.tsx, apps/frontend/e2e/process-tree.spec.ts. No conflict with PR #88's file list or #76/#87's likely files.

Activity

  1. added
    task
    frontend
    on Nov 14, 2026
  2. DavidVFitzGerald commented on Nov 15, 2026

    @DavidVFitzGerald
    OwnerAuthor

    PM: READY

    Hand-off: Software Engineer, then QA.

    🤖 Generated with Claude Code

  3. DavidVFitzGerald commented on Nov 15, 2026

    @DavidVFitzGerald
    OwnerAuthor

    Coordinator: state → implementing. Software Engineer assigned on fix/52-tree-aria-storage from af5317d, worktree /tmp/lca-diff-tree52, Compose project lca-diff-tree52, port 5223. Runs alongside #76/#87.

    🤖 Generated with Claude Code

  4. DavidVFitzGerald commented on Nov 15, 2026

    @DavidVFitzGerald
    OwnerAuthor

    Engineering: READY FOR QA

    Criteria

    • AC1 done. In ProcessTree.tsx, every pseudo row (loading, more, error, empty) has aria-posinset = real children + 1. aria-setsize is -1 while the branch is incomplete, otherwise real children + 1. All three attributes are rendered from TreeRow's shared props, and real nodes keep their old values. This is the PM's default pattern.

    • AC2 done. The new describe block "process tree pseudo-row ARIA positions (F3: process tree pseudo-row ARIA positions and full browser storage check #52)" checks exact [level, posinset, setsize] values:

      Case Pseudo row Real rows checked
      loading [2,1,-1] roots [1,1,2] / [1,2,2]
      more t's row [3,51,-1]; root's row [2,2,-1] leaves [3,1,-1] / [3,50,-1]; t [2,1,-1]; root [1,1,1]
      first-page error [2,1,-1] roots [1,1,2] / [1,2,2]
      later-page error (nextFailed) [3,51,-1] leaves [3,1,-1] / [3,50,-1]; t [2,1,-1]
      empty [2,1,1] root [1,1,1]
      • Before the change all 5 failed: the level matched, but posinset and setsize were null.
      • After the change all 20 tests in the file pass.
    • AC3 done.

      • The storage() helper reads localStorage keys and values, sessionStorage keys and indexedDB.databases() names. It runs after five branches are expanded and before sign-out, and again after re-sign-in.
      • The test asserts:
        • identical localStorage and sessionStorage key sets and IndexedDB database names before and after;
        • empty sessionStorage and IndexedDB;
        • no stored value containing transport systems, operations, infrastructure, or any expanded row's data-row-key.
      • If indexedDB.databases is missing, the helper throws, so the test fails instead of skipping.
      • Observed in Chromium and Firefox, before and after: localStorage holds only lca-diff:mock-session:v1, which is the mock auth session (uid, email, verified flag). sessionStorage was [] and IndexedDB [].
      • Negative controls (temporary spec copies, not committed) failed in both browsers as expected:
        • Deleting IDBFactory.prototype.databases failed with "indexedDB.databases() is unavailable in this browser".
        • Writing transport systems into localStorage failed the not.toMatch check.
    • AC4 done. The existing process-tree, selection, bulk-selection and search unit and e2e tests pass unchanged in Chromium and Firefox.

    • AC5 done. All container gates passed (below), and hosted quality passed, as did api-quality, backend-quality and etl-quality.

    Commands

    All commands ran in Compose project lca-diff-tree52 on port 5223, from apps/frontend (docker compose -p lca-diff-tree52 exec -T workspace bash -lc '…').

    Command Result
    ./dev up, ./dev check PASS
    npm ci --no-audit --no-fund ok (236 packages)
    npm run format:check ok
    npm run lint ok
    npm run typecheck ok
    npx vitest run src/services/mock/process-tree.test.tsx 20/20
    npm run test:unit 32 files, 410/410
    npm run build ok
    npm run test:e2e -- e2e/process-tree.spec.ts --reporter=list 2/2
    npm run test:e2e 66 passed
    ./dev down done

    Limitations and notes

    • In Firefox, Playwright's locator.evaluateAll crashed the page ("Page crashed") twice in a row at the expanded-rows read. The spec reads each row with locator.all() and getAttribute instead. This changes only how the test reads the rows, not what it asserts.
    • This is mock-build evidence only. Real Firebase/IndexedDB persistence is checked in Phase 2 integration.
    • Files changed: apps/frontend/src/components/process-tree/ProcessTree.tsx, apps/frontend/src/services/mock/process-tree.test.tsx and apps/frontend/e2e/process-tree.spec.ts. None of [Task] F5 — Add the indicator tree and source-ordered selection state #27's files were touched.

    Next: QA verifies the delivered SHA 9633d77.

    🤖 Generated with Claude Code

  5. DavidVFitzGerald commented on Nov 15, 2026

    @DavidVFitzGerald
    OwnerAuthor

    Coordinator: state → QA. Engineering READY FOR QA at 9633d77 (PR #90). Independent QA assigned in detached worktree /tmp/lca-diff-tree52-qa. QA to check whether the Firefox evaluateAll page crash is the same Playwright 1.65.1 defect as #75 and, if so, link it to #85.

    🤖 Generated with Claude Code

  6. DavidVFitzGerald commented on Nov 16, 2026

    @DavidVFitzGerald
    OwnerAuthor

    QA: PASS

    • Reviewed SHA: 9633d77ab4cc7c6fab2502f41b21f1db0f951633 (PR F3: pseudo-row ARIA positions and full browser storage check (#52) #90 head, fix/52-tree-aria-storage), based on main af5317d. Commits 7baf84c (ARIA and unit tests) and 9633d77 (e2e storage check).
    • Mode: Phase 1 mock build only. This is not evidence of real Firebase or IndexedDB persistence.
    • Environment: detached QA worktree /tmp/lca-diff-tree52-qa, Compose project lca-diff-tree52-qa, port 5227, rootless workspace container. Playwright 1.65.1 with its Chromium and Firefox builds. Compose was brought down afterwards and the worktree is clean at the SHA.
    • Host coordination: heavy runs started only when docker stats showed lca-diff-headroom and lca-diff-headroom-qa idle. See the note on the first unit run below.

    Criteria

    AC Verdict Evidence
    AC1 PASS In buildRows, each pseudo row gets posinset = children.length + 1. Its setsize is -1 unless complete(load), and then it is children.length + 1. TreeRow renders all three attributes from the shared common props for every kind. The real-row computation (index + 1, the branch setsize) is unchanged in the diff. The only change is that aria-posinset and aria-setsize moved into common, with the same values. This is the PM pattern. It is also valid under WAI-ARIA 1.2: aria-setsize="-1" is the required value when the set size is unknown, and posinset ≥ 1 and ≤ setsize when the size is known. Loading, more and error rows can only appear while the branch is incomplete, so they are always -1. An empty branch is complete, so its row is 1 of 1. Filtered derived branches render no pseudo rows, which is unchanged.
    AC2 PASS 5 new tests, listed in the table below. Against af5317d's ProcessTree.tsx with the new test file, 5/5 failed (expected ['2', null, null] to deeply equal ['2','1','-1'], and so on), while the other 15 passed. With the PR component, 20/20 pass. Mutation check: forcing pseudo setsize = children + 1 regardless of completeness fails 4 of the 5 tests. Only the empty case passes, as expected. Each test also asserts the real siblings' level, posinset and setsize.
    AC3 PASS storage() runs page.evaluate in the page. It reads localStorage keys and values, sessionStorage keys and the indexedDB.databases() names. It is called after the 5 branches are expanded (before sign-out) and again after re-sign-in. The test asserts identical localStorage and sessionStorage key sets and identical IndexedDB names. It asserts that no key or value matches the expanded path segments or any expanded row's data-row-key, and that session and IndexedDB are []. Observed in both browsers, before and after: localStorage {"lca-diff:mock-session:v1": <mock uid, email, email_verified, verificationRequested>}, sessionStorage [], IndexedDB []. QA's mutation copies (temporary and deleted, not committed) all failed in both projects (12/12): (1) a localStorage value ["transport systems"]: not.toMatch; (2) a localStorage value holding an expanded row key: not.toMatch; (3) a sessionStorage key added after re-login: session equality; (4) an IndexedDB database opened after re-login: IndexedDB equality; (5) IDBFactory.prototype.databases deleted by an init script: fails with indexedDB.databases() is unavailable in this browser, so the test fails and does not skip; (6) a localStorage key present before and removed after: key-set equality.
    AC4 PASS process-tree.spec.ts --repeat-each=3: 6/6 (3 Chromium, 3 Firefox). Full e2e: 66 passed in both projects. Full unit suite: 410/410. The PR touches only ProcessTree.tsx, process-tree.test.tsx (additions only) and process-tree.spec.ts. The selection, bulk-selection and search tests are unchanged and pass.
    AC5 PASS Container gates: npm ci (236 packages), format:check, lint, typecheck and build passed, along with test:unit 410/410 and test:e2e 66 passed. Hosted checks at 9633d77 all passed: quality (run 43771987124, including test:unit and the critical browser smoke in both projects), api-quality, backend-quality and etl-quality.

    AC2 tests

    Case Pseudo row [level, posinset, setsize]
    loading [2,1,-1]
    more [3,51,-1], plus the root's own [2,2,-1]
    first-page error [2,1,-1]
    later-page error (nextFailed) [3,51,-1]
    empty [2,1,1]

    The Firefox evaluateAll crash is the #75 defect

    QA reproduced it with temporary spec copies (not committed), Firefox, --repeat-each=2:

    • expandedRows.evaluateAll(...), where expandedRows = page.getByRole("tree", { name: "Processes" }).locator('[role="treeitem"][aria-expanded="true"]'), failed 2/2 with locator.evaluateAll: Page crashed.
    • The identical evaluateAll scoped by CSS, page.locator("[role=tree]").locator(...), passed 2/2.

    The tree's name comes from aria-labelledby (ProcessTree.tsx, aria-labelledby={labelledBy}). A named role query whose name comes from aria-labelledby, combined with a main-world read, is the trigger recorded in #75: Playwright 1.65.1's firefox-1572, upstream microsoft/playwright#43967, Mozilla bug 2090055.

    The replacement keeps the same assertions:

    • locator.all() + getAttribute("data-row-key") collects the same keys.
    • toHaveCount(5) and every expect are unchanged.
    • Only how the keys are read changed.

    For #85: this spec now also depends on the workaround. When Playwright is upgraded, #85 should also confirm that evaluateAll through the named tree locator is stable in process-tree.spec.ts. Restoring it is optional, because the current loop is behaviourally equivalent. Unlike the other workarounds, this one has no #75/upstream comment in the spec. Adding one (in #85 or later) would make it findable.

    Commands

    All of these ran via docker compose -p lca-diff-tree52-qa exec -T workspace bash -lc 'cd apps/frontend && …', after COMPOSE_PROJECT_NAME=lca-diff-tree52-qa FRONTEND_PORT=5227 ./dev up and ./dev check (PASS).

    Command Result
    npm ci --no-audit --no-fund && npm run format:check && npm run lint && npm run typecheck ok
    npx vitest run src/services/mock/process-tree.test.tsx 20/20; with af5317d's component, 5 failed / 15 passed
    npx playwright test e2e/process-tree.spec.ts --repeat-each=3 --reporter=list 6 passed
    mutation and crash specs (temporary) as described above
    npm run test:unit 410/410 on a quiet host
    npm run build ok
    npm run test:e2e -- --reporter=list 66 passed (3.2 min)
    ./dev down done

    Note on the unit runs: two earlier test:unit runs were invalid because other suites started on the host mid-run. In one, lca-diff-headroom and lca-diff-f5-indicators were at 130–160 % CPU and the load average reached 7.8. In the other, lca-diff-headroom-qa was at 163 %. Those runs failed 3/410 and then 2/410. The failures were the #76 budget-sensitive tests: the 300-selection test, deep scroll and the #69 hold. They are in files this PR does not touch, and both files pass 21/21 in isolation. The run on a quiet host passed 410/410. This is consistent with #76/#87, not a #52 regression. No #51 AuthDialog flake appeared.

    • Not run: no real-backend or auth checks (Phase 2).
    • ADR/doc reconciliation: not needed. The PR implements the PM default pattern with no PRD/spec deviation.

    Next: hand to the maintainer for review and merge of PR #90. #85 owner: note the extra dependency on the workaround described above.

    🤖 Generated with Claude Code

  7. DavidVFitzGerald commented on Nov 16, 2026

    @DavidVFitzGerald
    OwnerAuthor

    Coordinator state: ready for review.

    🤖 Generated with Claude Code

  8. DavidVFitzGerald commented on Nov 16, 2026

    @DavidVFitzGerald
    OwnerAuthor

    Coordinator: closed. PR #90 merged at ca68126 after QA PASS and green hosted checks.

    🤖 Generated with Claude Code

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

    frontendtask

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions