Repository navigation
Description
Delivery phase
Phase 1 - frontend with mock services
Goal
Filter the existing tree predictably while preserving user selections and avoiding stale search results.
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, 7.1, 7.4. Current planning baseline is on docs/agent-workflow, pending review/merge into main; proposed ADRs are not accepted authority. Extend selector search UI/hooks and tests using the existing mock search service; keep search state separate from selected IDs. These application paths are planned until created. Exclude all archive/reference folders.
Requirements and constraints
Primary process-name field plus clear ×; advanced fields Process Name, Geography, Category, Subcategory and Reference Flow Name. Every token/field combines with AND, case-insensitive literal substring. Use short documented debounce and AbortSignal; no fuzzy/regex/Boolean semantics. Preserve matching ancestors and expand matching paths.
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 - Default view exposes process-name search; advanced fields have accessible labels and combine populated tokens/fields exactly as specified.
- AC2 - Debounced changes cancel obsolete work; a slower earlier response cannot overwrite a newer query result.
- AC3 - Only matching leaves and their ancestors appear, with ancestors expanded; explicit no-results and loading/error/retry states keep existing selections intact.
- AC4 - Clear resets all search fields and restores the full tree without clearing selected IDs; filters are not written to persistent workspace storage.
- AC5 - Unit/browser cases cover whitespace, mixed case, multiword/field AND, literal punctuation, cancellation races and no matches.
Out of scope and follow-ups
Selection storage/control is #18, filter-scoped bulk actions are #19. No approximate search, server search engine or persistence of filters.
Verification plan
Inside ./dev shell, run format:check/lint/typecheck/test:unit/build and npm --prefix apps/frontend run test:e2e. Use deterministic delayed mock responses and selected IDs to demonstrate query race rejection and clear-search selection retention.
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, #18. 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 a7b529b. #16 (PR #50) and #18 (PR #53) are merged and closed; the M1/M2 gates were satisfied previously.
Merged interfaces this issue consumes
queries.searchPagesand theSearchFields/SearchRequestcontract, with no contract change. The mock search already trims, lowercases and whitespace-tokenizes each field. It ANDs tokens and fields as literal substrings, and it returns ancestor chains with exact in-scopematching_descendant_count.ProcessTree([Task] F3: render the paginated release and nested process tree #16), which uses lazy per-branch pages, anduseSelection([Task] F3: manage individual selection order and a virtualized selected-process list #18).
Decisions
- D1 Fields.
- At the top of the Processes sidebar is a text input labelled Process Name, the default and only active field, with a one-click Clear search × button. The button shows whenever any field has text.
- An Advanced search disclosure button (
aria-expanded, collapsed by default) reveals labelled Geography, Category, Subcategory and Reference Flow Name inputs. - Process Name stays the primary field and is not duplicated in the panel, so there is one control per field.
- Each input has
maxLength256.
- D2 Normalization.
- Each field value is trimmed and has internal whitespace collapsed before sending. Fields that become empty are omitted.
- All fields empty means no filter, so the full lazy tree shows.
- Input text is never rewritten in the field, and stored names are untouched.
- There is no regex, Boolean, fuzzy or stemming syntax; punctuation is literal. Matching is the service's job (spec §6.2.1–2).
- D3 Debounce and cancellation.
SEARCH_DEBOUNCE_MS = 200. Clear applies immediately.- Each normalized field set is its own query key. Changing it unsubscribes the old query, and TanStack aborts its consumed
AbortSignal. - A late response for an old key never renders, because results are read only for the current key.
- D4 Filtered tree.
- While a filter is active, each release root issues one root-scoped search (
fields, single-release snapshot, nobranch_path,limit50), continued by that release's "Load more" row. - Only matching leaves and their ancestor branches render. Roots and every branch with loaded matches are expanded by default; the user may collapse them, and those collapses reset when the filter changes.
- Counts are the exact matching counts. Nested branches show no continuation rows of their own.
- Unfiltered expansion state and loaded pages are kept and return after Clear.
- While a filter is active, each release root issues one root-scoped search (
- D5 States.
- Loading and error rows, and Retry when retryable, reuse [Task] F3: render the paginated release and nested process tree #16 per release.
- A release with zero matches shows "No matching processes in ".
- When every release has finished with zero matches, an explicit "No processes match your search." message shows.
- A polite live region announces the match count once results load.
- Selections are never changed by searching, failing, retrying or clearing.
- D6 State and persistence. Search fields live in component state inside the UID-keyed
Workspace. They are never written to storage and are discarded on signout or account change. - D7 Focus. Typing never moves focus. Filtering never steals focus from the inputs. Clear returns focus to the Process Name input.
Scope
Change a new src/components/process-search/ (component, normalizeFields, CSS), ProcessTree.tsx (add a fields prop and the filtered mode) and App.tsx. Add tests (unit, component under src/services/mock/) and e2e/process-search.spec.ts, and update the roadmap F3 row. There is no service, contract or composition change. Filter-scoped bulk selection and tri-state controls are #19.
Objective verification
- Unit (
normalizeFields):- whitespace (leading, trailing, internal, tabs);
- empty field omission;
- mixed case preserved for sending;
- punctuation preserved, including
.*,a(b,OR.
- Component (mock injected):
- AC1: labels and disclosure; the DTO contains only populated, normalized fields, and multiword AND across fields gives the expected leaves.
- AC2: a burst of changes within 200 ms issues one search. A slow earlier query is aborted (
signal.aborted), and a slower earlier response never replaces newer results. - AC3: only matching leaves and ancestors show, expanded, with exact counts. The no-results message appears, zero-match release rows appear, and error then Retry recovers. Selections are intact in every case.
- AC4: Clear resets every field, restores the prior full tree and keeps the selection; nothing is stored.
- AC5: mixed case, literal punctuation, field AND with no match, and whitespace-only input means no filter.
- Browser (
e2e/process-search.spec.ts, Chromium and Firefox, composed mock):- search "gamma" shows only Gamma with its ancestors expanded; select it;
- Advanced Geography "de" plus Process Name "road" gives only Beta;
- "zzz" shows the no-results message;
- Clear restores the tree with Gamma still selected;
- no requests or console errors, and no new storage keys.
Verification (container only)
COMPOSE_PROJECT_NAME=lca-diff-f3-search FRONTEND_PORT=5190 ./dev up && ./dev check
docker compose -p lca-diff-f3-search 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 search performance or server-side matching parity (I1).
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, #18. 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
Coordinator: re-sequenced by the maintainer — #18 is implemented first (now PM READY); #17 is rechecked after #18 merges.
DavidVFitzGerald commentedon Nov 14, 2026
PM: READY
Phase 1 (frontend with mock services), milestone F3. Dependencies #16 (PR #50) and #18 (PR #53) are merged and closed. Spec references: §§6.2 (search rules 1–4, 7), 6.8, 7.1. Decisions D1–D7 are in the issue body's Current readiness section:
There is no contract change and no ADR (no PRD or spec deviation). Bulk and tri-state controls are #19. Next: Software Engineer.
DavidVFitzGerald commentedon Nov 14, 2026
Engineering: READY FOR QA
feat/f3-search, delivered SHAbcc5181(commits 1049b9c, 76df306, bcc5181); PR F3: reactive AND-tokenized process search with cancellation (#17) #54 (Refs #17, no closing keyword).lca-diff-f3-search):./dev checkPASS; frozennpm ciPASS (no dependency changes); format, lint, typecheck and build PASS; test:unit 212/212 in 15 files (3 consecutive runs); e2e @smoke 10 PASS; full e2e 32 PASS (Chromium and Firefox).docs/engineering/f3-search-verification.md.bcc5181.DavidVFitzGerald commentedon Nov 14, 2026
QA: FAIL
Reviewed SHA
bcc5181(branchfeat/f3-search, PR #54). Phase 1, mock mode only. Rootless compose projectlca-diff-qa17in a detached worktree atbcc5181. This is not evidence of real search, auth or server-side matching parity (I1).Commands and results (container only)
COMPOSE_PROJECT_NAME=lca-diff-qa17 FRONTEND_PORT=5191 ./dev up && ./dev check: PASS (8 preflight scenarios; rootless, restricted caps, frozen lock).git diff --stat main...bcc5181: 14 files. Nopackage.jsonor lockfile changes.docker compose -p lca-diff-qa17 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 x4) && npm run build && npm run test:e2e -- --grep @smoke && npm run test:e2e': exit 0.npm ci(frozen): 232 packages.--max-warnings 0) and typecheck: PASS.@smoke: 10 passed.npx playwright test e2e/qa17-probe.spec.ts --project=chromium. 2 failed and 1 passed (details below).Findings
F1, High (blocks AC2/AC3, D3/D4): re-applying a recently used filter leaves the release stuck on "Loading…" indefinitely.
[email protected]):gammain Process Name. Gamma shows correctly.beta.gammaagain.["Synthetic precision fixture fixture v1", "Loading Synthetic precision fixture…"]after more than 6.5 s. The live summary never appears and Gamma cannot be reached or selected. Both probe variants (clear then retype, and A → B → A) failed the same way.filterRef.currentis updated in the parentProcessTreeuseEffect(apps/frontend/src/components/process-tree/ProcessTree.tsx:306-308).BranchLoader's report effect (ProcessTree.tsx:132-144) is a child effect, so it runs first in the same commit.onLoadtherefore drops that initial report as coming from a "superseded" filter (ProcessTree.tsx:326).staleTime: 30_000,apps/frontend/src/app/ApplicationProviders.tsx:35), no further report is ever made. The view keeps an empty load and renders the loading pseudo-row.onLoadbefore child effects run, for example by assigning it during render or in a layout effect, or by comparing against the scope passed with the report. Add a regression test that re-applies a cached filter withinstaleTime.F2, Low (non-blocking, D4/D5 polish): collapsing a filtered release root discards its loaded results.
ProcessTree.tsx:332-341keeps only unfiltered pages)."…fixture v1, 3 processes"becomes"…fixture v1"). The polite summary and the "No processes match your search." message also disappear while any root is collapsed, becausesettledneeds every root load (ProcessTree.tsx:455-464).Per-criterion verdicts
aria-expandedandaria-controlsand reveals 4 labelled fields. There is one control per field, each withmaxLength256.normalizeFieldstrims, collapses whitespace and omits empty fields, sending case and punctuation literally. The mock ANDs tokens and fields as literal substrings, with no regex or Boolean handling.degives only Beta.onChange, Clear applies immediately, and the component race test shows the slow earlierrailquery is aborted and never replacesship. Code review confirms results are read only for the current scoped key and superseded filter loads are purged.aria-expanded=true, counts 3/3/3/3/1.localStorageandsessionStorageempty).Workspaceonly (App.tsx).STEEL.*,steel.+,(diesel)), cancellation races and no-match cases are covered. Browser probe: whitespace-only input gives the unfiltered tree, and.*gives a literal zero match. There is no regression case for re-applying a cached filter (F1).Other review notes
grepoversrc/componentsandApp.tsx).model.tsroot-count change: it only affects zero-item root-scoped pages, because the mock returns the root branch otherwise. It is correct for [Task] F3: render the paginated release and nested process tree #16's unfiltered tree.f2-gate.spec.tskeyboard tab-order update matches the new tab stops.Next action
Engineering fixes F1 and adds a regression test, then QA rechecks at the new SHA with unit, e2e and the cached re-apply probe. F2 is optional in this PR or can be a follow-up.
fix: render cached filters, keep collapsed filtered results and fit s…
DavidVFitzGerald commentedon Nov 14, 2026
Engineering: fixes for QA and hosted CI — READY FOR QA re-check at
3bbf34e(PR #54).onLoad: only mounted loaders report, and superseded scopes are still purged on filter change. Regression test:process-search.test.tsx› renders a filter reused from the query cache (no new requests, no Loading row, summary present).bcc5181(https://github.com/DavidVFitzGerald/LCA-diff/actions/runs/43614206011): in Firefox the Process Name input's intrinsic width pushed Clear × under the comparison pane, so it couldn't be clicked. Inputs now fill the sidebar width, andprocess-search.spec.tsasserts the controls stay inside the sidebar. That assertion fails in Firefox without the fix.DavidVFitzGerald commentedon Nov 14, 2026
Hosted CI at
3bbf34e: PRqualityPASS (https://github.com/DavidVFitzGerald/LCA-diff/actions/runs/43614944312); full-suite dispatch PASS (https://github.com/DavidVFitzGerald/LCA-diff/actions/runs/43614973440). QA re-check in progress.DavidVFitzGerald commentedon Nov 14, 2026
QA: PASS
Re-check at SHA
3bbf34e(branchfeat/f3-search, PR #54), following the QA FAIL atbcc5181. Phase 1, mock mode only. Rootless compose projectlca-diff-qa17in a fresh detached worktree at3bbf34e. This is not evidence of real search, auth or server-side matching parity (I1). Hosted CI is the coordinator's job.Commands and results (container only)
COMPOSE_PROJECT_NAME=lca-diff-qa17 FRONTEND_PORT=5191 ./dev up && ./dev check: PASS.git diff --name-only main...3bbf34e: nopackage.jsonor lockfile changes.docker compose -p lca-diff-qa17 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 x4) && npm run build && npm run test:e2e -- --grep @smoke && npm run test:e2e': exit 0.npm ci(frozen): 232 packages.@smoke: 10 passed.npx playwright test e2e/qa17-probe.spec.ts. All cases passed in both browsers.Re-check of earlier findings
gamma, change tobeta, then searchgammaagain: Gamma and its 4 expanded ancestors render with no Loading row.gamma, Clear, then searchgammaagain: same result, and "1 process matches your search." is announced.…, 3 processesand "3 processes match your search." Re-expanding restores the 3 matching leaves.ProcessTree.tsxonLoad/purge effect):gamma→beta→alphatyped in quick succession, 3 times in a row. Only Alpha rendered, with no Beta or Gamma rows and no Loading row, including 400 ms after settling.railaborted, never replacingship) still passes.process-search.spec.tsnow asserts that containment.Per-criterion verdicts
bcc5181: default Process Name field, labelled Advanced disclosure, normalized AND fields.Non-blocking notes
locator.evaluateAllfor 3 cases. The same flows rewritten with locator assertions passed in Firefox, and the full suite passes, so this is a harness/browser quirk, not an application failure. It is worth watching if a future spec usesevaluateAllin Firefox.Next action
Coordinator: hosted CI, then maintainer review and merge.
DavidVFitzGerald commentedon Nov 14, 2026
Coordinator: QA re-check PASS at
3bbf34e(issuecomment-6880597190), after the FAIL atbcc5181. Hosted CI PASS at3bbf34e(PR quality run 43614944312, full dispatch run 43614973440). State: ready for review; PR #54 awaits maintainer merge. Non-blocking: QA saw PlaywrightevaluateAllpage crashes in container Firefox with an ad-hoc probe; the committed specs don't use it. Watch for this in future specs.feat: add reactive AND-tokenized process search with a filtered tree …
test: cover search normalization, AND matching, races, states and cle…
docs: record #17 search evidence (Refs #17)
fix: render cached filters, keep collapsed filtered results and fit s…
DavidVFitzGerald commentedon Nov 14, 2026
Closed by coordinator: PR #54 merged by the maintainer after QA PASS (re-check at
3bbf34e) and hosted CI PASS.