Skip to content

feat(settings): wire landing, recent-searches, and compact-citations preferences live#910

Merged
BigSimmo merged 1 commit into
mainfrom
claude/audit-recent-changes-kde66i
Jul 19, 2026
Merged

feat(settings): wire landing, recent-searches, and compact-citations preferences live#910
BigSimmo merged 1 commit into
mainfrom
claude/audit-recent-changes-kde66i

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Jul 19, 2026

Copy link
Copy Markdown
Owner

Summary

  • Follow-up to fix: remediate 2026-07-19 audit findings (inert settings, offline auth, redirect query) #906: wires the wireable inert settings live and fixes the stale-node_modules session-start gap found during the 24-hour audit.
  • Wired live (their "Saved for later — not active yet" markers removed):
    1. Default landing viewGlobalSearchShellClient applies a one-shot router.replace to the saved landing mode on a bare / load (search → documents, browse → tools via the new landingModeForPreference helper). Explicit mode/q/run params always win, and the dashboard's existing URL-sync effect performs the actual switch.
    2. Recent searches on homeAnswerEmptyState gates its recent-query chips on showRecentOnHome.
    3. Compact citations — the answer source capsule drops its text label to icon + count when compactCitations is on. The "No direct source found" warning is explicitly exempted so compact mode can never hide a missing-source signal (locked by test).
  • Still marked inactive, with reasons documented in the test contract: jurisdiction/population/answer-style (wiring them into answer generation is provider-eval-gated per the repo confirmation boundary), saved-protocols-on-home (no protocols module exists yet), and the three notification toggles (no delivery infrastructure exists).
  • Session-start hook hardening.claude/hooks/session-start.sh now stamps the package-lock.json sha256 into node_modules/.session-start-lock-hash after npm ci and reinstalls when the lockfile no longer matches, so dependency-bumping merges can't leave a cached container silently stale (that staleness faked a typecheck regression during the audit).
  • Appends the ledger row documenting this pass.

Verification

UI verification not run: the landing redirect reuses the dashboard's existing URL-mode sync path and the capsule/chips changes are gated presentational branches with dom-test coverage; the blocking hosted Production UI job covers this head in CI.

Verification not run: npm run check:production-readiness — no secrets in this container (documented demo-mode expectation) and no answer-generation, retrieval, or source-governance logic changed; the capsule change is presentational with the missing-source warning locked by test.

Risk and rollout

  • Risk: Low. All three wirings are client-side presentation/navigation gates driven by an existing validated preference store; the landing redirect fires once per load and only on a bare / with no explicit params. The hook change only affects dev-container setup, never CI or production.
  • Rollback: Revert the single commit.
  • Provider or production effects: None. No OpenAI, Supabase, deployment, or provider-backed check ran.

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)
  • Service-role keys and private document access remain server-only
  • Demo/synthetic content remains clearly separated from real clinical sources
  • Source metadata, review status, and outdated/unknown-source behavior remain conservative
  • Deployment classification/TGA SaMD impact was checked when clinical decision-support behavior changed

Notes

  • No clinical decision-support behavior changed: answer generation, retrieval, and source governance are untouched. The compact-citations change only collapses the capsule's text label, and the missing-source warning is test-locked to stay visible in compact mode.
  • Wiring answer style / population / jurisdiction into generation remains the documented follow-up requiring explicit approval for the provider-backed eval gates (eval:rag, eval:quality).

🤖 Generated with Claude Code

https://claude.ai/code/session_01LxzDsyr6FXLG1zcuLGyFsf

Summary by CodeRabbit

  • New Features
    • Default landing view preferences now direct users to their selected dashboard automatically.
    • Recent-search suggestions on the home screen can be enabled or disabled in Settings.
    • Compact citations hide the “Sources” label while retaining source counts and missing-source warnings.
  • Bug Fixes
    • Settings now accurately indicate which preferences are active.
    • Session startup now refreshes installed packages when dependency definitions change.

…preferences live

The default-landing preference now drives a one-shot mode redirect on bare
'/' loads (explicit mode/query params always win), the answer home gates its
recent-query chips on showRecentOnHome, and the source capsule drops its text
label to icon+count under compactCitations — with the 'No direct source
found' warning exempted so compact mode can never hide a missing-source
signal. The three wired rows lose their 'Saved for later' marker; the still-
inert rows (clinical trio pending provider-gated eval, protocols module and
notification infrastructure not built) keep it, with reasons in the test
contract.

Also hardens .claude/hooks/session-start.sh: the lockfile sha256 is stamped
after npm ci and a mismatch triggers reinstall, closing the stale-container
gap that faked a typecheck regression during the 24h audit.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LxzDsyr6FXLG1zcuLGyFsf
@supabase

supabase Bot commented Jul 19, 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 ↗︎.

@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 762f48ee-719d-4d43-a3e1-ed360b7eadb5

📥 Commits

Reviewing files that changed from the base of the PR and between 7ec25d9 and b68079b.

📒 Files selected for processing (9)
  • .claude/hooks/session-start.sh
  • docs/branch-review-ledger.md
  • src/components/clinical-dashboard/answer-content.tsx
  • src/components/clinical-dashboard/answer-status.tsx
  • src/components/clinical-dashboard/global-search-shell.tsx
  • src/components/clinical-dashboard/settings-dialog.tsx
  • src/components/clinical-dashboard/use-app-preferences.ts
  • tests/answer-preferences.dom.test.tsx
  • tests/settings-inert-preferences.dom.test.tsx

📝 Walkthrough

Walkthrough

The PR activates three application preferences: default landing mode, recent searches on home, and compact citations. It adds preference-driven rendering and routing, updates settings accessibility markers and tests, and makes session-start dependency installation respond to lockfile changes.

Changes

Preference-driven clinical dashboard behavior

Layer / File(s) Summary
Preference mappings and settings activation
src/components/clinical-dashboard/use-app-preferences.ts, src/components/clinical-dashboard/settings-dialog.tsx
Adds landing preference utilities and removes inert markers from the default landing, recent searches, and compact citations controls.
Runtime preference behavior
src/components/clinical-dashboard/global-search-shell.tsx, src/components/clinical-dashboard/answer-status.tsx, src/components/clinical-dashboard/answer-content.tsx
Applies saved landing mode, recent-search visibility, and compact citation rendering in dashboard components.
Preference behavior validation
tests/answer-preferences.dom.test.tsx, tests/settings-inert-preferences.dom.test.tsx
Tests preference-driven behavior and updates the inert-setting contract for functional rows.

Session-start dependency synchronization

Layer / File(s) Summary
Lockfile-aware session-start installation
.claude/hooks/session-start.sh, docs/branch-review-ledger.md
Reinstalls dependencies when the lockfile hash is missing or changed, records the hash after installation, and documents the remediation.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

Suggested labels: codex

Suggested reviewers: claude

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/audit-recent-changes-kde66i

Comment @coderabbitai help to get the list of available commands.

@BigSimmo
BigSimmo marked this pull request as ready for review July 19, 2026 06:19
@BigSimmo
BigSimmo enabled auto-merge (squash) July 19, 2026 06:19
@BigSimmo
BigSimmo merged commit 9b227b5 into main Jul 19, 2026
17 checks passed
@BigSimmo
BigSimmo deleted the claude/audit-recent-changes-kde66i branch July 19, 2026 06:19
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.

2 participants