Skip to content

Search pages follow-up: registry error states, no-evidence handling, generator fixes, session hook#335

Merged
BigSimmo merged 2 commits into
mainfrom
claude/search-pages-review-f4xmhp
Jul 7, 2026
Merged

Search pages follow-up: registry error states, no-evidence handling, generator fixes, session hook#335
BigSimmo merged 2 commits into
mainfrom
claude/search-pages-review-f4xmhp

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Summary

Follow-up to the search pages review (#320), clearing the remaining recommendations:

  • Services navigator registry states (services-navigator-page.tsx): unauthorized/errored registry loads no longer silently fall back to static fixture records (which showed a full result list whose entries then failed on click). The navigator now shows the same "Session expired" / "Could not load services" notices as the services home and detail pages. Demo mode is unaffected — the registry API serves demo fixtures as status ready.
  • Documents no-evidence deep links (master-document-flow-mockups.tsx): findEvidence no longer borrows the clozapine fixture's evidence for documents whose evidence array is empty. The reader's hit panel shows an explicit "No extracted evidence" state, and the evidence detail route renders a dedicated notice page with links back to the document and results instead of mismatched borrowed content.
  • Differentials export parser fixed upstream (scripts/lib/parse-differentials-export.ts): the markdown preamble before the first ## no longer becomes a bogus record (the # Scenario Presets preset and # Red Flag Flows flow), and bare-number field-weight rows (e.g. tags → 1.1) are dropped from the search alias table. The checked-in snapshot was cleaned to match (presets 8→7, flows 8→7, aliases 28→20) and parser regression tests added. The runtime loader filters from Fix search page defects across documents, services, forms, favourites, and differentials #320 remain as defence in depth.
  • Forms results mock controls (forms-search-results-page.tsx): inert controls (secondary tabs, refine toggles, "View full pathway", mobile Filters) are now disabled with "Coming soon" affordances matching the documents page pattern; "View all forms" is a real link to /forms and "Open Form 4A" links to the transport order form.
  • Favourites (favourites/page.tsx, favourites-command-library-page.tsx): dropped the key={query} remount (query is a pure prop), so clearing the search chip no longer wipes set/type/view/sort selections; the empty-state row now spans the correct column count on both sides of the lg breakpoint.
  • Dead code: deleted ServicesNavigatorPreview (no importers, hardcoded "+1" overflow badge, fixture-only search).
  • Node 24 SessionStart hook (.claude/hooks/session-start.sh, .claude/settings.json): web-only hook that installs Node 24 into a cached location when the container ships an older Node (the repo is engine-strict node 24.x/npm 11.x), exports it via $CLAUDE_ENV_FILE, and runs npm ci when node_modules is missing. Validated end-to-end in this container, idempotent, and leaves the lockfile untouched.
  • Lint cleanups: removed the unused onPickSample prop from AnswerEmptyState (and its call site), removed two unused type imports in API routes, and added the derived canUsePrivateApis to the DocumentViewer fetch effect deps (no behavioural change — all its inputs were already dependencies). The remaining exhaustive-deps warning in ClinicalDashboard guards deliberate auto-run semantics and was intentionally left.
  • Docs: recorded the answer-thread Back-button URL/state disagreement in docs/process-hardening.md as an open product decision, with a guardrail against "fixing" it by re-running searches on Back.

Dropped during rebase: the originally-planned query-ranked differentials results in differentials-home.tsx were superseded by main's own implementation (useDifferentialSearch + composeDifferentialSearchResults, merged via #331's line); this PR keeps main's version untouched.

Verification

  • npm run verify:cheap (typecheck, lint — 1 deliberate pre-existing warning, vitest 1182 passing post-rebase, runtime + sitemap checks)
  • npm run verify:ui — full Chromium Playwright suite, 106/106 passing on the pre-rebase head (required downloading the pinned Playwright Chromium build in this container first); post-rebase re-verified with typecheck/lint/vitest/format
  • npm run verify:release — not applicable to this PR
  • npm run format:check
  • npm run eval:retrieval:quality — not run (needs live Supabase/OpenAI keys). RAG retrieval/ranking/selection/chunking/scoring are untouched; the only ranking-adjacent changes are parser/alias hygiene for the client-side differentials static catalogue, which make its query expansion strictly cleaner
  • npm run eval:rag / eval:quality — answer generation and synthesis untouched
  • npm run check:production-readiness — no clinical workflow, privacy, environment, Supabase, or deployment behavior changed
  • npm run check:deployment-readiness — no deployment behavior changed

Clinical Governance Preflight

  • Source-backed claims still require linked source verification before clinical use
  • No patient-identifiable document workflow was introduced or expanded without explicit governance approval
  • Supabase target remains Clinical KB Database (sjrfecxgysukkwxsowpy) — no env or Supabase changes
  • Service-role keys and private document access remain server-only
  • Demo/synthetic content remains clearly separated from real clinical sources (documents no longer borrow another document's fixture evidence)
  • Source metadata, review status, and outdated/unknown-source behavior remain conservative
  • Deployment classification/TGA SaMD impact was checked — no clinical decision-support ordering changed in this PR (the differentials ranking change shipped separately on main)

Notes

  • The snapshot data change is exactly what the fixed parser would emit; regenerating from the export zip will no longer reintroduce the artifacts.
  • The SessionStart hook takes effect for all future web sessions once this merges to main. It runs synchronously (dependencies guaranteed ready before the session starts); it can be switched to async mode for faster startup if preferred.

🤖 Generated with Claude Code

https://claude.ai/code/session_015rc3tTjs65D4gFBuCQhZGs

@supabase

supabase Bot commented Jul 6, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@BigSimmo
BigSimmo marked this pull request as ready for review July 6, 2026 18:18
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@BigSimmo

BigSimmo commented Jul 6, 2026

Copy link
Copy Markdown
Owner Author

@copilot resolve the merge conflicts in this pull request

…generator fixes, session hook

Follow-up to PR #320's search page review, addressing the remaining items:

- Services navigator: stop silently rendering fixture records when the
  registry is unauthorized or errored - show the same session-expired /
  load-error notices as the services home and detail pages. Demo mode is
  unaffected (the registry API serves fixtures as status ready).
- Documents flow: findEvidence no longer borrows another document's
  fixture evidence, so deep links to documents without extracted evidence
  render an explicit "No extracted evidence" state in the reader hit
  panel and a dedicated notice page on the evidence detail route.
- Differentials export parser: drop the markdown preamble section that
  became a bogus "# Scenario Presets" preset and "# Red Flag Flows" flow,
  and drop bare-number field-weight rows from the search alias table;
  cleaned the checked-in snapshot to match and added parser regression
  tests. Runtime loader filters from #320 remain as defence in depth.
- Differentials search results: rank the real catalogue with
  rankDifferentialRecords/searchPresentationWorkflows when a query is
  present (the acute-confusion walkthrough remains the empty-query demo),
  and reword the demo-content notice accordingly.
- Forms results: inert mock controls (secondary tabs, refine rail, view
  full pathway, mobile filters) are now disabled with "Coming soon"
  affordances matching the documents page; "View all forms" links to
  /forms and "Open Form 4A" links to the transport order form.
- Favourites: drop the key={query} remount so clearing a search no longer
  wipes set/type/view/sort selections, and span the empty row correctly
  on both sides of the lg breakpoint.
- Deleted the unused ServicesNavigatorPreview component (no importers,
  hardcoded overflow badge, fixture-only search).
- Added a web-only SessionStart hook that installs Node 24 (the repo is
  engine-strict node 24.x) into a cached location and runs npm ci when
  node_modules is missing, so remote sessions are productive immediately.
- Lint: removed the unused AnswerEmptyState onPickSample prop and two
  unused type imports; added the derived canUsePrivateApis to the
  DocumentViewer fetch effect deps (no behavioural change - its inputs
  were already dependencies).
- Documented the answer-thread Back-button URL/state question in
  docs/process-hardening.md as an open product decision with a guardrail.

Verified with typecheck, lint, vitest (1142 passing), format:check, and
npm run verify:ui (106 chromium Playwright tests passing).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015rc3tTjs65D4gFBuCQhZGs
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
@BigSimmo
BigSimmo merged commit 2d9882a into main Jul 7, 2026
5 checks passed
@BigSimmo
BigSimmo deleted the claude/search-pages-review-f4xmhp branch July 8, 2026 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants