Repository navigation
Description
Delivery phase
Phase 1 - frontend with mock services
Goal
Maintain one coherent ordered process selection independently of current search visibility.
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.3, 6.8. Current planning baseline is on docs/agent-workflow, pending review/merge into main; proposed ADRs are not accepted authority. Add app-level ordered selection state/controller and selector checkboxes/selected list, exposed for later Flows/Scores consumers. These application paths are planned until created. Exclude all archive/reference folders.
Requirements and constraints
Individual checkboxes append newly selected IDs in user order with no duplicates or product cap. A collapsible Selected processes (N) list supports removal and clear all. Virtualize long lists. Expose shared state so grid/header removal and both tabs later use the same order. No durable workspace persistence in this slice.
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 - Individual selects append in selection order; repeated selection is idempotent, removal deselects everywhere, and reselect appends at the end.
- AC2 - Selection survives collapsed nodes, paging and filtering; items outside current results remain visible/removable in the selected list.
- AC3 - Selected count, checkbox state and list update coherently; clear all removes every selected ID and leaves search unchanged.
- AC4 - The selected list uses bounded rendering for hundreds of IDs with accessible item labels/removal controls and predictable keyboard focus.
- AC5 - Component/controller tests cover hidden-by-filter items, rapid toggles, duplicate display names, clear and no-process empty state; the state API supports future column reorder/removal without copying selection.
Out of scope and follow-ups
Alphabetically ordered filter-scoped bulk additions are #19; grid drag/header removal is F4; UID-scoped browser persistence is F5. No arbitrary selection limit or confirmation merely for large comparisons.
Verification plan
Inside ./dev shell, run format:check/lint/typecheck/test:unit/build and npm --prefix apps/frontend run test:e2e. Exercise hundreds of synthetic selected IDs, measure bounded mounted list items and check shared selection order after filter/remove/reselect operations.
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 #16. 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
Rechecked 2026-11-14 on main at 4e8126e. #16 is merged (PR #50) and closed; the M1/M2 bootstrap gates were already satisfied for F2/#16. #17 now depends on this issue; it runs next, at the maintainer's request.
Merged interfaces this issue consumes
src/components/process-tree/([Task] F3: render the paginated release and nested process tree #16): the ARIA tree with roving tabindex, lazy branch pages,TreeProcessnodes carryingrelease_id,id,labelandgeography, and virtualized rows (@tanstack/react-virtual3.14.24, fixed 32 px rows).Workspaceinsrc/App.tsxis keyed by verified UID and unmounts on signout, lock or account change.
Decisions
-
D1 Identity. A selection entry is
{release_id, revision_id, id, name, geography}, keyed by(release_id, id).revision_idis the release's current revision when the entry is selected. Name and geography are captured from the tree node as in-memory display data, so entries outside the loaded or visible tree still render. F5 restore will fill them viaheaders. No request is issued by selecting. -
D2 Controller.
src/app/selection.tsxadds aSelectionProviderinsideWorkspaceand auseSelection()hook backed by an external store (useSyncExternalStore) with immutable ordered snapshots. API:entries(ordered);isSelected(key),select(entry)(idempotent append),deselect(key),toggle(entry)andclear();move(key, toIndex)for F4 reorder.
Later Flows/Scores/grid consumers read the same store. Nothing is copied.
-
D3 Tree checkboxes.
- Process treeitems expose
aria-checked(true/false) and a visual,aria-hiddencheckbox. - Space, Enter or a click on a process row toggles it.
- Branch rows stay without
aria-checkedand Space stays unbound on them; branch tri-state and bulk actions belong to [Task] F3: implement filter-scoped bulk selection and tri-state parent checkboxes #19. - The process accessible name is unchanged ("name — geography"); the checked state is conveyed by
aria-checked.
- Process treeitems expose
-
D4 Selected list.
- Placement: below the tree in the process sidebar.
- Header: a disclosure button "Selected processes (N)" with
aria-expanded, expanded by default. - Clear all: a "Clear all" button, disabled when the list is empty. There is no confirmation (spec §6.2 permits that and §6.8 forbids confirmations just for size). A polite live region announces "Cleared N selected processes."
- List:
role="list"labelled "Selected processes", virtualized with fixed rows, each item alistitemwitharia-posinsetandaria-setsize. Each item shows its 1-based position, "name — geography", and the release display name and version as secondary text. - Remove buttons are named "Remove name — geography from selection". To keep duplicate labels distinct, the name gains the release name and version, plus "(item k)" if the label is still duplicated.
-
D5 Keyboard and focus in the list.
- The list has one tab stop (roving tabindex on the remove buttons). ArrowUp/Down, Home and End move focus; Enter or Space removes.
- After a removal, focus moves to the next item, or to the previous item when the last was removed. When the list becomes empty, focus goes to the empty-state text's container (a focusable status with
tabindex=-1). - After Clear all, focus stays on the disabled-state container; focus is never lost to
body.
-
D6 Empty state. "No processes selected. Use the checkboxes in the process tree to add processes." The comparison pane's empty state is unchanged; F4 replaces it.
-
D7 No persistence. Selection is in memory only. It is discarded when
Workspaceunmounts (signout, lock, account change) and is never written to storage. UID-scoped persistence is F5. -
D8 Filtering. Search does not exist until [Task] F3: add reactive AND-tokenized process search with cancellation #17. In this slice, AC2's "filtering" is proven by independence from tree visibility:
- selected entries remain listed, removable and checked after a collapse, after paging and when their branch was never re-expanded;
- deselecting from the list unchecks the tree row when it is next shown.
The search-filter journey is carried to [Task] F3: add reactive AND-tokenized process search with cancellation #17 (its AC3/AC4).
Scope
Change src/app/selection.tsx (new), src/components/process-tree/ProcessTree.tsx, a new src/components/selected-processes/ component and CSS, src/App.tsx, tests and e2e/selection.spec.ts, plus the roadmap F3 row. There is no service, contract or composition change.
Objective verification
- Controller unit tests:
- append order, idempotent select, deselect then reselect appends at the end;
- rapid toggles; clear; move;
- duplicate display names with distinct keys;
- snapshots are immutable, and the snapshot identity changes only on change.
- Component tests:
- tree
aria-checkedand Space/Enter/click toggling; - the list's order, count and checkbox state stay coherent;
- removal from the list unchecks the tree row;
- collapse/paging retention, and an entry whose branch is collapsed stays removable;
- Clear all;
- 500 selected entries keep mounted list items bounded (at most viewport plus overscan plus the active row);
- keyboard roving and focus after removal and clear; the empty state;
- signout clears the list, and re-login is empty with no storage writes.
- tree
- Browser (
e2e/selection.spec.ts, Chromium and Firefox, composed mock):- select Gamma, then Alpha, then Beta by keyboard and click; the list order and count are 3;
- remove Alpha from the list and the tree row is unchecked; reselect Alpha and it appends at the end;
- Clear all;
- signout, then re-login, gives an empty list;
- no requests or console errors.
Verification (container only)
COMPOSE_PROJECT_NAME=lca-diff-f3-selection FRONTEND_PORT=5188 ./dev up && ./dev check
docker compose -p lca-diff-f3-selection exec -T workspace bash -lc 'cd apps/frontend && npm ci --no-audit --no-fund && npm run format:check && npm run lint && npm run typecheck && npm run test:unit && npm run build && npm run test:e2e -- --grep @smoke && npm run test:e2e'Mock evidence does not prove real persistence, authorization or performance.
Activity
DavidVFitzGerald commentedon Nov 13, 2026
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: #16. 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.
DavidVFitzGerald commentedon Nov 14, 2026
PM: READY
Phase 1 (frontend with mock services), milestone F3. Dependency #16 is merged (PR #50,
4e8126e) and closed; the M1/M2 gates were satisfied previously. Spec: §§6.2, 6.3 (selection order and shared removal), 6.8. Decisions D1–D8 are in the issue body's Current readiness section: entry identity and in-memory display data; theuseSelectionexternal-store controller withmovefor F4; treearia-checkedwith Space/Enter/click on process rows only (branch bulk actions in #19); a virtualized selected list with roving remove buttons and defined focus; no confirmation; no persistence (F5); the filter journey carried to #17. #17 is re-sequenced after this issue at the maintainer's request. No ADR is needed; there is no PRD or spec deviation. Next: Software Engineer.DavidVFitzGerald commentedon Nov 14, 2026
Engineering: READY FOR QA
feat/f3-selection, delivered SHAb61dbe5(commits e55f3b7, 58557a6, b61dbe5); PR F3: ordered process selection and virtualized selected list (#18) #53 (Refs #18, no closing keyword).lca-diff-f3-selection):./dev checkPASS; frozennpm ciPASS (no dependency changes); format/lint/typecheck/build PASS; test:unit 200/200 in 13 files (3 consecutive runs); e2e @smoke 10 PASS; full e2e 30 PASS (Chromium and Firefox).docs/engineering/f3-selection-verification.md.src/services/mock/test-harness.ts.b61dbe5.DavidVFitzGerald commentedon Nov 14, 2026
Hosted CI at
b61dbe5: PRqualityPASS (https://github.com/DavidVFitzGerald/LCA-diff/actions/runs/43611822313); full-suite dispatch PASS (https://github.com/DavidVFitzGerald/LCA-diff/actions/runs/43611828473). Independent QA in progress.DavidVFitzGerald commentedon Nov 14, 2026
QA: FAIL at
b61dbe5Independent QA of #18 (F3 ordered selection and virtualized selected list) at delivered SHA
b61dbe508d7ea91ccd505d66bee9119c63c0dd7a(branchfeat/f3-selection, PR #53). Phase 1, mock mode only. This does not prove real persistence, authorization or performance. Hosted CI is left to the coordinator.Environment
/tmp/lca-diff-qa18atb61dbe5.lca-diff-qa18,FRONTEND_PORT=5189.Commands and results
docker compose -p lca-diff-qa18 exec -T workspace,cd apps/frontend)COMPOSE_PROJECT_NAME=lca-diff-qa18 FRONTEND_PORT=5189 ./dev up && ./dev checknpm ci --no-audit --no-fundgit diff main b61dbe5 -- apps/frontend/package.json apps/frontend/package-lock.json package.json uv.locknpm run format:check/lint/typechecknpm run test:unit×4npm run buildnpm run test:e2e -- --grep @smokenpm run test:e2eFindings
F-1 (Medium, blocking: D5 and AC4) — Clear all while the section is collapsed loses focus to
body.apps/frontend/src/components/selected-processes/SelectedProcesses.tsx:123-126with:90and:171.clearAll()setsfocusEmpty, and the effect then callsemptyRef.current?.focus(). When the disclosure is collapsed, the empty-state<p>is inside<div id="selected-body" hidden>, so it cannot take focus. The Clear all button has just become disabled, so focus falls tobody.[email protected].aria-expanded=false).body."document.activeElementisBODYin both Chromium and Firefox. The next Tab lands on the "Flows" tab, so the keyboard position in the sidebar is lost.Per-criterion verdicts
store.selectappends only when the key is absent (selection.ts), and the key is(release_id, id).deselectis global through the shared store, so the tree readsaria-checkedfrom the same snapshot.aria-checked, list order andaria-posinset/aria-setsizestay coherent.body" guarantee fails on the collapsed path.moveclamping, clear, no cap (5,000).move(key, toIndex)reorders the shared store in place, so F4 can reorder and remove without copying the selection.D1–D8
{release_id, revision_id, id, name, geography}.revision_idcomes from the release, and no request is made on select.src/app/selection.tsrather than.tsx, usingcreateElement.useSyncExternalStoreexternal store with frozen snapshots.useSelection()returns{entries, store}rather than spreading the methods. This is functionally equivalent.aria-checkedand anaria-hiddenvisual box; branches have noaria-checked.process-tree.test.tsx:130).aria-expandedand is expanded by default.role=listwithlistitemrows carrying posinset/setsize, the position, "name — geography" and the release as secondary text.Workspace key={auth.user.uid}(App.tsx:198-199).Boundary and other checks
SelectedProcesses/ProcessTreeuse onlyuseServiceQueriesandapp/selection. The grep hits arefetchNextPage/refetchfrom TanStack Query.test-harness.tsis test-only underservices/mock. The [Task] F3: render the paginated release and nested process tree #16 coverage is intact:process-tree.test.tsxstill has 15itcases (15 onmain), with the same assertions, now usinggeometry.tree.e2e/f2-gate.spec.ts: the update is correct. Focus passes through "Selected processes (0)", the disabled Clear all is skipped, and the heading match is exact.Non-blocking follow-ups
removeNames/releaseNamerecompute for every entry on every render: O(N·releases). This is fine at MVP scale; consider memoizing for very large selections.Next action
FAIL returns to the Software Engineer to fix F-1 with a regression test. Then QA rechecks the new SHA: the unit, e2e selection/f2-gate and full gates.
fix: keep focus on the selection toggle when clearing a collapsed lis…
DavidVFitzGerald commentedon Nov 14, 2026
Engineering: QA F-1 fixed — READY FOR QA re-check at
71630cd(PR #53).body. With the section expanded, focus still goes to the empty-state text.selection.test.tsx› keeps focus on the section toggle when Clear all runs with the list collapsed. It fails without the fix and passes with it.DavidVFitzGerald commentedon Nov 14, 2026
QA: PASS at
71630cdQA re-check of #18 after fixing F-1. Delivered SHA:
71630cda5a57a8701751760eaf08e99156ecdbad(feat/f3-selection, PR #53).Environment
/tmp/lca-diff-qa18at71630cd.lca-diff-qa18withFRONTEND_PORT=5189.Change reviewed (
b61dbe5..71630cd)SelectedProcesses.tsx:openwas added to the effect deps.selection.test.tsx:The verification doc was also updated. There are no other source changes, and no dependency or lockfile changes against
main.Commands and results
Inside
docker compose -p lca-diff-qa18 exec -T workspace, inapps/frontend:COMPOSE_PROJECT_NAME=lca-diff-qa18 FRONTEND_PORT=5189 ./dev up && ./dev checknpm ci --no-audit --no-fundnpm run format:check,lint,typechecknpm run test:unit×3npm run buildnpm run test:e2e -- --grep @smokenpm run test:e2eF-1 re-check
The QA spec ran in both browsers and gave identical results.
Collapsed section — fixed:
BUTTON "Selected processes (0)", notbody.tabindex=-1and Clear all is disabled. This matches the f2-gate order.Expanded section — unchanged:
Per-criterion verdicts
b61dbe5review. Only the focus target and the announcement text changed.Findings
None blocking. The remaining non-blocking follow-ups from the previous review still stand:
removeNamesfor very large selections.Next action
PASS goes to the coordinator for hosted CI and maintainer review/merge. Do not close #18 before the merge is approved.
DavidVFitzGerald commentedon Nov 14, 2026
Coordinator: QA re-check PASS at
71630cd(issuecomment-6880208586), after the earlier FAIL atb61dbe5was fixed. Hosted CI PASS at71630cd: PRqualityhttps://github.com/DavidVFitzGerald/LCA-diff/actions/runs/43612779671; full dispatch https://github.com/DavidVFitzGerald/LCA-diff/actions/runs/43612806838. State: ready for review; PR #53 awaits maintainer merge. Non-blocking notes: the bounded test uses 300 entries (meets "hundreds"); removal-name memoization is possible for very large selections. After merge, #17 is rechecked next.feat: add ordered process selection with tree checkboxes and selected…
test: cover selection order, bounded list, focus and session discard …
docs: record #18 selection evidence and F3 sequencing (Refs #18)
fix: keep focus on the selection toggle when clearing a collapsed lis…
DavidVFitzGerald commentedon Nov 14, 2026
Closed by coordinator: PR #53 merged by the maintainer after QA PASS (re-check at
71630cd) and hosted CI PASS.fix: lay the process sidebar out as a flex column instead of a fixed …