Skip to content

Redesign Services into a progressive referral workflow - #1829

Merged
BigSimmo merged 12 commits into
mainfrom
codex/chat-services-flow-redesign-20260812
Aug 12, 2026
Merged

Redesign Services into a progressive referral workflow#1829
BigSimmo merged 12 commits into
mainfrom
codex/chat-services-flow-redesign-20260812

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Aug 11, 2026

Copy link
Copy Markdown
Owner

Summary

  • Redesign Services around a clear four-stage referral workflow: Search, Shortlist, Compare, and Refer.
  • Add four URL-backed core groups with a space-efficient phone More sheet: Urgent help, Public mental health, Alcohol and other drugs, and Community support.
  • Replace the dense results rail with compact high-yield service cards, explicit shortlist comparison, and a referral-focused detail hierarchy.
  • Preserve existing ranked result order; group filtering is applied only after the existing service ranking.

RAG impact: no retrieval behaviour change — Services group filters are applied after existing service ranking and preserve relative result order.

Verification

  • npm run verify:pr-local
    • Partial: runtime, installed-lock parity, changed-file formatting, lint, and typecheck passed.
    • The full unit stage reported 552 files and 6037 tests passing, with 4 files and 18 tests failing in untouched Windows-only bundle fixture and pre-push hook cases.
    • Both changed-scope failures found during that run were corrected; the final focused selector passed 4 files and 78 tests.
    • Because the full unit stage stopped the orchestrator, build and RAG fixture validation were run directly and passed.
  • npm run verify:ui when UI, routing, styling, browser behavior, reduced-motion, or forced-colors behavior changed
    • UI verification not run as the broad shared-chrome gate: no shared chrome foundation changed. The complete changed-area Chromium set passed 185/185 tests.
  • npm run verify:release before release or handoff confidence claims
    • Verification not run: release/provider confidence is outside this scoped UI handoff.
  • npm run verify:phone-chrome
    • The top-level coordinator was repeatedly denied capacity by another Database worktree. Its exact selected stages were run individually and passed: 129 phone static/unit contracts, 185 changed-area Chromium tests, and 7 focused phone-scroll tests, plus runtime and installed-lock parity.
  • npm run build
    • Passed, including TypeScript, 1708 static pages, upload-limit parity, and the client bundle secret-surface check.
  • npm run check:rag:fixtures
    • Passed: 36 golden cases across 23 suites.
  • npm run check:production-readiness when clinical workflow, privacy, environment, Supabase, source governance, or deployment behavior changed
    • Partial/environment-gated: Node and the production boot guard passed; local Supabase variables and the OpenAI key are not present in this worktree.
  • npm run check:deployment-readiness when deployment startup, hosting, or rollout behavior changed
    • Verification not run: deployment startup and hosting were not changed.

Risk and rollout

  • Risk: Core-group membership is derived from existing service metadata and a service can appropriately appear in more than one browsing group. The grouping does not change ranking or clinical source data.
  • Rollback: Revert the Services redesign commits to restore the prior home, results rail, and detail layout.
  • Provider or production effects: None.

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

  • Opened as a draft because the aggregate PR-local gate is limited by known Windows-only fixture failures and production readiness is environment-gated.
  • Chromium phone emulation passed; physical iPhone Safari and cold-launch installed-PWA acceptance were not run.

Summary by CodeRabbit

  • New Features

    • Redesigned services browsing with core-group navigation, counts, filtering, and responsive mobile navigation.
    • Added shortlist and comparison workflows with clearer eligibility, cost, catchment, and verification details.
    • Added a guided referral flow from search through referral.
    • Improved service contact and referral options, including source-page fallback links.
  • Bug Fixes

    • Updated search submission and clearing behavior for more reliable service results.
  • Documentation

    • Updated service review records and design-system adoption documentation.

@supabase

supabase Bot commented Aug 11, 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 Aug 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 43 minutes

Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ea3ef070-7a0a-4953-a150-16ad332945ad

📥 Commits

Reviewing files that changed from the base of the PR and between 58d732a and 7014b7e.

📒 Files selected for processing (3)
  • src/components/services/service-detail-page.tsx
  • tests/service-detail-page.dom.test.tsx
  • tests/services-catalog.test.ts
📝 Walkthrough

Walkthrough

The services experience now uses core-group navigation, a four-stage referral flow, shortlist-based comparison, deferred search states, and contact-aware service details. The route submission logic and related regression, DOM, catalog, smoke, and UI tests were updated.

Changes

Services redesign

Layer / File(s) Summary
Core groups and shared service UI
src/lib/service-core-groups.ts, src/components/services/service-group-nav.tsx, src/components/services/service-referral-flow.tsx, docs/design-system/...
Added service classification helpers, referral stages, responsive group navigation, and Sheet adoption metadata.
Route and home-page integration
src/app/(search-app)/services/page.tsx, src/components/services/services-home-page.tsx
Submission state now uses run=1. The home page renders referral flow, group navigation, counts, and registry status.
Navigator shortlist and comparison workflow
src/components/services/services-navigator-page.tsx
Replaced the prior workflow with group filtering, shortlist controls, comparison, referral-stage filters, and deferred-query states.
Service detail referral actions
src/components/services/service-detail-page.tsx
Added group badges, referral-readiness content, source status, and conditional contact or source actions.
Workflow validation and review records
tests/*services*, tests/ui-*.spec.ts, docs/branch-review-ledger.md
Updated coverage for classification, contact actions, shortlist behavior, comparison, URLs, mobile navigation, and review records.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Browser
  participant ServicesNavigatorPage
  participant ServiceDetailPage
  Browser->>ServicesNavigatorPage: Select group or enter search query
  ServicesNavigatorPage->>Browser: Render filtered service cards
  Browser->>ServicesNavigatorPage: Add services to shortlist
  ServicesNavigatorPage->>Browser: Enable comparison after two selections
  Browser->>ServiceDetailPage: Open referral details
Loading

Possibly related PRs

Suggested labels: codex

Suggested reviewers: claude, cursoragent

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the primary Services redesign into a progressive referral workflow.
Description check ✅ Passed The description covers the required summary, verification results, risks, rollback, production effects, governance checks, and remaining limitations.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/chat-services-flow-redesign-20260812

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

@BigSimmo

Copy link
Copy Markdown
Owner Author

Review and sweep summary for PR #1829

  • Target PR: 1829 — Record Services redesign review
  • HEAD: 675ab617b8185d86680717205ecbee1341d528cc
  • Mergeability snapshot: mergeable=MERGEABLE, mergeStateStatus=BEHIND
  • Required checks at this head: Production UI (1/2/3), Production UI critical, PR required, PR mergeability, PR policy, Build, Static PR checks, Unit coverage, Semgrep all passing.

I reviewed the full changed set for actionable defects and did not find high-confidence regressions.

Findings

  • None. No P0/P1/P2 issues identified.
  • Existing review threads were checked and are resolved (no pending actionable threads).

Remediations

  • No code changes were required.

Local evidence

  • Manual code review across changed files in: src/components/services/*, src/app/(search-app)/services/page.tsx, and related tests/docs.
  • npm run ledger:lookup -- 675ab617b8185d86680717205ecbee1341d528cc --scope "review-and-fix" → not previously reviewed at this scope before this sweep.
  • npm run ledger:append -- --ref 1829 --head 675ab617b8185d86680717205ecbee1341d528cc --scope review-and-fix --outcome "No high-confidence findings" ... appended.

Decision

  • No blockers found. Merge remains blocked only by branch behind-status on GitHub; otherwise ready for handoff.

@BigSimmo

Copy link
Copy Markdown
Owner Author

Review summary (review-and-fix)

  • PR was already clean from a clinical UX standpoint on this open sweep; no high-confidence actionable findings were identified in the current changed scope.
  • Snapshot at head aa45101f52227bb7392fb96307e9c1628a705fd1.
  • No review threads were open.
  • PR was behind main; performed one sync (git merge --no-ff --no-edit refs/remotes/origin/main) and pushed that sync commit.
  • I could not run local npm test checks in this worktree because dependencies are not installed (vitest module missing). npm ci was not run in this run.
  • Required GitHub checks after sync are all green: PR required, Build, Unit coverage, Static PR checks, Semgrep (+ ingestion gate), Safety and config checks, PR policy, PR mergeability, Production UI (1/2/3), Production UI critical, Advisory UI, Lighthouse budget (advisory), Gitleaks.

Disposition: no fixes applied; review complete for this pass.

@BigSimmo

Copy link
Copy Markdown
Owner Author

Codex babysit sweep (review-and-fix)

Snapshot

Review findings

  • Unresolved actionable review threads: 0
  • Fixes applied: none required at this tip
  • Code risk notes: none identified during scoped review of changed files (src/components/services/**, src/app/(search-app)/services/page.tsx, service tests/docs)

Required checks on snapshot

  • PR required: pass
  • PR mergeability: pass
  • PR policy: pass
  • Static PR checks: pass
  • Safety and config checks: pass
  • Build: pass
  • Change scope: pass
  • Unit coverage: pass
  • Semgrep / Semgrep ingestion: pass
  • Gitleaks / GitGuardian: pass
  • Production UI critical + (1-3): pass
  • Note: advisory and dispatch-only checks remained skipping

Local proof

  • npm run format attempted but failed locally: prettier is not available in this checkout.
  • git merge refs/remotes/origin/main completed successfully to clear local behind state; no file conflicts requiring manual fix.
  • Branch pushed to codex/chat-services-flow-redesign-20260812 with merge commit to preserve clean sync.

Ledger

  • Appended one review record:
    • review-and-fix outcome clean at head 127ca19e3bd5b03b4075587a3e250fc1ac212038

Merge left to you.

@BigSimmo

Copy link
Copy Markdown
Owner Author

Babysit review summary

  • PR head inspected: 127ca19e3bd5b03b4075587a3e250fc1ac212038 (before this cycle's local main sync)
  • PR state at check: open, draft, mergeable MERGEABLE, merge-state BEHIND
  • Merge-tree snapshot against origin/main: clean
  • Unresolved review threads: none found
  • Required checks: previously completed and green on the open head (Production UI (1/2/3), PR required, plus earlier CI stages)
  • Local review scope validated for workflow and shortlist/compare/group behavior; no high-confidence action items identified.
  • Sync action: one clean main sync commit was captured locally for merge-base freshness (e2a16df27f88cbcafcc2885820799ce98607602e), no code-level blocker

Findings

  • No P0/P1 or scoped P2 defects identified.

Ledger

  • Appended review-and-fix ledger record for this PR head / review scope with outcome no-findings.

Evidence

  • Local checks were not executed in this environment because vitest is unavailable (node_modules/vitest/vitest.mjs missing).
  • Required-merge/actionable checks remain as reported above on GitHub for the open head.

@BigSimmo

Copy link
Copy Markdown
Owner Author

Babysit summary (1829)

  • Head confirmed: 127ca19e3bd5b03b4075587a3e250fc1ac212038 (codex/chat-services-flow-redesign-20260812)
  • Mergeability snapshot: MERGEABLE, draft=true, mergeStateStatus=BEHIND at last query
  • Branch vs origin/main: 0 ahead / 43 behind for origin/main...origin/codex/chat-services-flow-redesign-20260812 in this run; merge-tree (git merge-tree) is clean with no conflict markers.
  • Reviewable threads: no unresolved reviewThreads.
  • Required checks on this head: passing (PR required, PR policy, Safety, and gating checks observed). Advisory/optional checks include skipped jobs only.
  • Findings: no new high-confidence issues found in the changed scope. No actionable threads raised.
  • Fixes: none required; this PR is clean and dispositioned no-findings.
  • Ledger: appended review-and-fix no-findings for head 127ca19e3bd5b03b4075587a3e250fc1ac212038.
  • Scope remains unchanged; merge left to author.

@BigSimmo

Copy link
Copy Markdown
Owner Author

Codex babysit summary (1829)

  • Head: 127ca19e3bd5b03b4075587a3e250fc1ac212038
  • Mergeability snapshot: mergeable=MERGEABLE, mergeStateStatus=BEHIND (at snapshot time)
  • Merge-tree: clean in prior sync record; current tip is a merge commit with eb3f89d3 as one parent.
  • Required checks on snapshot: PR required, PR policy, PR mergeability, Static PR checks, Safety and config checks, Build, Unit coverage, Semgrep, Production UI (1/2/3), Production UI critical all passing.
  • Review scope: services navigator/detail/grouping and related tests/contracts.
  • Findings: no P0/P1/P2 defects identified.
  • Threads: no unresolved actionable review threads found.
  • Local proof: npm run ledger:lookup + review of changed code + npm run ledger:append appended babysit outcome no-findings (review complete).
  • Decision: No product fix required; merge left to author.

@BigSimmo

Copy link
Copy Markdown
Owner Author

PR review summary (babysit)

PR #1829 snapshot

  • Head: 127ca19e3bd5b03b4075587a3e250fc1ac212038 (BEHIND in GitHub UI)
  • Mergeability: MERGEABLE / PR mergeability passing on current tip.
  • Required checks on the current tip: all required checks green.
    • Build
    • Static PR checks
    • Unit coverage
    • Safety and config checks
    • PR mergeability
    • PR policy
    • Production UI (1/2/3)
    • PR required

Findings

  • No unresolved review threads were found for this PR.
  • No actionable P0/P1 defects found in the PR-introduced changes.
  • No functional code fix was required.

Disposition

  • Result: dispositioned in babysit ledger.
  • No local code changes were pushed.

Notes

  • I did not merge or sync branches for this PR.
  • Checks are green, and there are no remaining actionable blockers.

@BigSimmo
BigSimmo marked this pull request as ready for review August 12, 2026 00:07

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 092b52d8c6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/lib/service-core-groups.ts Outdated
@BigSimmo

Copy link
Copy Markdown
Owner Author

@codex resolve actionable Codex review findings for this pull request and current head using the repository instructions. This is the pull request's single automatic repair pass: do not perform a fresh review, create new standalone findings, or request another review. Work only the existing unresolved Codex threads on the current head. The only repository destination is BigSimmo/Database, and the only branch destination is the pull request head branch codex/chat-services-flow-redesign-20260812 at starting commit 092b52d; never publish fixes to a detached or synthetic work branch and never create a stacked pull request. Use the authenticated GitHub connector to commit each approved fix to BigSimmo/Database:codex/chat-services-flow-redesign-20260812, then verify that the pull request head contains the published commit before reporting success. Always fix P0 and P1 findings. For P2 and lower findings, fix only clear, scoped, low-risk issues; otherwise disposition them with a concise reason. For a fixed thread, reply with as the first line and as the second line. For a no-code disposition, use followed by . These result markers authorize the workflow to close that exact thread only after it verifies a fixed commit is the pull request head; a local-only commit is not a fix. If publication or verification fails, do not use either result marker, do not claim success, and leave the thread open with the blocker. If human input or new authorization is required, do the same. Finish only after every actionable thread is fixed or dispositioned and closed, or explicitly left open for a human decision. Do not update the branch from main, address unrelated reviews, broaden scope, or create more than one scoped fix commit. Do not use external APIs, paid services, credentials, dependency changes, or broad refactors unless explicitly authorized. Add targeted tests where behavior changes and run the narrowest relevant validation.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 092b52d8c6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/lib/service-core-groups.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR redesigns the Services mode into a progressive referral workflow (Search → Shortlist → Compare → Refer), adds URL-backed “core group” browsing, and updates UI + test coverage to match the new navigation and shortlist/comparison model while preserving the underlying service ranking.

Changes:

  • Introduces core service groups (urgent, public, aod, community) and group navigation (including a phone “More” sheet) with URL state via group= and run=1.
  • Replaces the prior “decision rail” selection UX with service cards + a shortlist bar and an explicit comparison panel.
  • Updates Playwright + unit/DOM regression tests and design-system adoption docs to reflect the new Services UX.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/ui-tools.spec.ts Updates launcher/UI expectations for the redesigned Services flow and new “Review referral” affordances.
tests/ui-smoke.spec.ts Updates smoke coverage to assert the shortlist → compare lifecycle instead of the old decision rail behavior.
tests/services-catalog.test.ts Adds unit coverage for mapping representative services into the new core browse groups.
tests/service-detail-page.dom.test.tsx Updates DOM assertions for the new service detail actions behavior (website/source actions).
tests/audit-content-services-regressions.test.ts Updates audit regression expectations to match shortlist-based navigator source.
src/lib/service-core-groups.ts Adds core-group classification helpers (regex-based) and group label utilities.
src/components/services/services-navigator-page.tsx Implements the new Services browsing/search UI, shortlist bar, comparison panel, group filtering, and revised cards.
src/components/services/services-home-page.tsx Redesigns Services home around the referral workflow and core-group browsing entry points.
src/components/services/service-referral-flow.tsx Adds a reusable visual “Referral workflow” stage indicator (track/cards variants).
src/components/services/service-group-nav.tsx Adds the responsive core-group navigation component with a phone “More” sheet.
src/components/services/service-detail-page.tsx Updates service detail hierarchy and actions to be referral-focused (including source fallback when no contact).
src/app/(search-app)/services/page.tsx Switches the Services index route to treat run=1 as the navigator entry (enabling browse-without-query).
docs/design-system/COMPONENTS.md Updates generated design-system inventory counts affected by new Sheet usage.
docs/design-system/adoption-manifest.json Records adoption of Sheet and related design-system components in the new Services nav.
docs/branch-review-ledger.md Adds a ledger row capturing review/verification metadata for this change set.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tests/services-catalog.test.ts Outdated
@BigSimmo

Copy link
Copy Markdown
Owner Author

Babysit review snapshot — scope: babysit

  • PR head: 1021bbb7ef699248f7d8f7aa2a69739ee83fa354 (pushed from _tmp-1829-babysit)
  • Local merge-tree vs origin/main: clean
  • Behind/Ahead: 0 ahead / 65 behind relative to origin/main
  • Mergeable state: BEHIND
  • Unresolved actionable threads: 0 (all existing threads resolved inline)

Fixes

  • src/lib/service-core-groups.ts
    • Switched from concatenating source fields into one string to per-field matching.
    • Added serviceGroupFields() and includesPatternInFields() helpers and evaluate urgent, public, aod, and community patterns against each field independently.
  • tests/services-catalog.test.ts
    • Added fixture existence assertions for representative slugs before asserting core-group memberships.

Checks

  • npm exec eslint src/lib/service-core-groups.ts tests/services-catalog.test.ts
  • npm exec vitest run tests/services-catalog.test.ts
  • gh pr checks 1829 --requiredGitleaks and PR policy currently pending after new push.

Dispositions

  • P1 cross-field match false-positive: fixed by per-field matching.
  • Test robustness around representative fixture lookup: fixed with explicit toBeDefined() guards.

Residual risks

  • PR is still behind main; merge not attempted.
  • Required checks are in progress and not yet green.
  • Pre-push hook reported missing installed eslint/typescript in this worktree, so local pre-push lint/typecheck guard did not run there.

Merge not performed. I will continue to next open PR after this check settles unless you want me to stop here.

@BigSimmo

Copy link
Copy Markdown
Owner Author

Babysit review (scope: exact babysit-pr)

Snapshot (current GitHub head): 1021bbb7ef699248f7d8f7aa2a69739ee83fa354 on branch codex/chat-services-flow-redesign-20260812.

  • Merge state snapshot: mergeStateStatus=BEHIND, mergeable=true.
  • Local mergeability check: merge-tree against origin/main is clean.
  • Threads: no unresolved actionable threads on reviewThreads (all prior findings are resolved/outdated).
  • Focused local checks run on changed high-risk paths:
    • npm exec eslint src/lib/service-core-groups.ts src/components/services/service-referral-flow.tsx src/components/services/service-detail-page.tsx src/components/services/services-home-page.tsx src/components/services/services-navigator-page.tsx src/components/services/service-group-nav.tsx
    • npm exec vitest run tests/services-catalog.test.ts tests/service-detail-page.dom.test.tsx tests/audit-content-services-regressions.test.ts
    • npm run format -- --check src/lib/service-core-groups.ts src/components/services/services-home-page.tsx src/components/services/service-referral-flow.tsx src/components/services/services-navigator-page.tsx
  • Checks are all green locally.
  • Required remote checks at head were green (PR required success; unit/build/UI gates all passing in GH snapshot).

Outcome: dispositioned (no additional action required; no new high-confidence defects found in this pass). Merge left to you.

@BigSimmo

Copy link
Copy Markdown
Owner Author

babysit summary

  • PR: Redesign Services into a progressive referral workflow #1829
  • Tip: c79cdf8
  • Mergeability snapshot: mergeable=MERGEABLE, mergeStateStatus=BEHIND, remote compare vs main = �head: 8 behind: 6 (diverged)
  • Required checks on this head: most are still pending after sync (Change scope, PR mergeability, PR policy, Gitleaks, Semgrep, Semgrep ingestion gate); advisory/skip checks observed where unchanged.
  • Branch/thread disposition: no actionable unresolved threads on current head; prior inline comments on old commits were marked outdated.
  • Fixes made:
    1. Avoid cross-field phrase classification in src/lib/service-core-groups.ts by matching grouping regexes per source field (instead of concatenated text), preventing false public matches such as public + community across tags.
    2. Harden browse-group test fixtures in ests/services-catalog.test.ts (non-null record assertions + cross-field negative regression case).
  • Local proof:
    ode node_modules/vitest/vitest.mjs run tests/services-catalog.test.ts passed (17/17).
  • Ledger: appended via
    pm run ledger:append ... with outcome ixed.
  • Residual: CI required checks still running; merge remains blocked by BEHIND sync debt until checks pass and/or a main sync is performed.

@BigSimmo

Copy link
Copy Markdown
Owner Author

Babysit review summary

  • Snapshot: reviewed at GitHub head c79cdf85d01e7de65ca281151a2ec92a41fb777d (branch codex/chat-services-flow-redesign-20260812).
  • Merge state: BEHIND; mergeable is MERGEABLE while mergeStateStatus remains BEHIND (blocked by base drift).
  • Attempted unblock step: refreshed PR head from refs/pull/1829/head, checked out exact PR head, and attempted sync against origin/main; no effective delta applied in this worktree for this PR head.
  • Review threads: all 3 threads are resolved (isResolved: true).
  • Required checks: PR required, PR policy, Static PR checks, Unit coverage, Build, Production UI (1/2/3), Safety and config checks, Gitleaks, Semgrep, and GitGuardian Security Checks are pass; PR mergeability is fail (drive behind state).
  • Disposition: blocked in review due behind state only; no code change required at this pass.
  • Next action: PR author should sync/update base and re-trigger checks; then a fresh mergeability snapshot can proceed.

@BigSimmo
BigSimmo enabled auto-merge August 12, 2026 04:32
cursoragent and others added 2 commits August 12, 2026 04:56
Resolve services navigator/detail conflicts by keeping the progressive
referral workflow redesign from this PR.

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
…ocus

Show a skeleton while the deferred query catches up so group-empty copy
does not flash on quick-filter changes, and add focus-visible rings on
shortlist Compare/Clear plus the Show all services link.

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
@cursor

cursor Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Babysit summary — PR #1829 heavy review-and-fix

Tip: 58d732a1b63af1debf7e480e8b3e59cec8fcc130 on codex/chat-services-flow-redesign-20260812
Sync / merge-tree: merged origin/main (was DIRTY with real conflicts in service-detail-page.tsx + services-navigator-page.tsx). Current merge-tree vs origin/main is clean; GitHub now reports mergeable=MERGEABLE (was CONFLICTING). Ahead of main by product commits only; 0 behind. Auto-merge was already armed — this push was required to clear the conflict blocker.

Fixed

  1. Main sync conflicts — kept this PR’s progressive referral redesign for both conflicted services files (e744fd5e).
  2. P2 deferred-query lag empty flash — while deferredQuery lags a new quick-filter/query, show skeleton instead of “No services in this group”; group-empty only when deferredQuery === query (58d732a1).
  3. P2 shortlist keyboard focus — added focus-visible rings on Compare / Clear and the “Show all services” link (58d732a1).
  4. Contract tests — audit regressions assert the deferred-lag + focus guards.

Dispositioned / already clear

  • Prior Codex P1 cross-field core-group matching (service-core-groups.ts) already fixed earlier (per-field matching + negative test); re-verified.
  • Copilot fixture-null concern already addressed in prior tip.
  • Bugbot: no Bugbot review comments/findings on this PR.
  • Unresolved actionable review threads: 0.

Required CI

Re-triggered on the new tip (expected after the unblock push). Pre-push tip had required checks green; PR mergeability was the blocker (dirty). Current rollup at comment time: Change scope / PR policy / PR mergeability / Semgrep / Gitleaks in progress.

Local gates (decisive)

  • npm run verify:cheapPASSTest Files 556 passed (556) / Tests 6070 passed | 1 skipped (6071)
  • npm run verify:pr-localPASSfailed: (none) (lint, typecheck, test, build, RAG fixtures)
  • npm run verify:phone-chromePASS — changed-browser 185 passed (2.8m); focused-browser 7 passed (19.3s)
  • Focused services tests: 23 passed (services-catalog + audit-content-services-regressions)

Residual risks

  • Shortlist/compare is React state only (lost when leaving for referral detail).
  • community core group is intentionally broad.
  • Full verify:ui / provider-backed / release gates not run (not required; phone-chrome covered the selected UI scope).

Ledger

Appended local-only (unpushed) row for head 58d732a1… under scope PR 1829 heavy review-and-fix so this tip is not a ledger-only push.

Merge left to you.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (2)
src/components/services/services-navigator-page.tsx (1)

338-344: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Move the setShowComparison call out of the setSelectedSlugs updater, and give the shortlist cap a visible effect.

Two points in toggleSelected:

  1. The updater calls setShowComparison(false). React can run an updater function more than once, so state updaters must stay pure. Compute the next list first, then apply both updates.
  2. .slice(0, 5) silently drops the sixth selection. The user taps "Add to shortlist", and nothing changes: no state change, no message. Disable or explain the control when the shortlist holds five services.

Point 1 is also reported by React Doctor (no-impure-state-updater, no-side-effect-in-state-updater-function).

♻️ Proposed fix for the impure updater
-  function toggleSelected(slug: string) {
-    setSelectedSlugs((current) => {
-      const next = current.includes(slug) ? current.filter((item) => item !== slug) : [...current, slug].slice(0, 5);
-      if (next.length < 2) setShowComparison(false);
-      return next;
-    });
-  }
+  function toggleSelected(slug: string) {
+    const next = selectedSlugs.includes(slug)
+      ? selectedSlugs.filter((item) => item !== slug)
+      : [...selectedSlugs, slug].slice(0, 5);
+    setSelectedSlugs(next);
+    if (next.length < 2) setShowComparison(false);
+  }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/services/services-navigator-page.tsx` around lines 338 - 344,
Update toggleSelected so the next selected-slug list is computed outside the
setSelectedSlugs updater, then apply setSelectedSlugs and setShowComparison
separately, keeping the updater pure. Replace the silent slice(0, 5) cap with
visible five-item limit behavior by disabling or clearly explaining the
add-to-shortlist control when five services are selected.

Source: Linters/SAST tools

tests/audit-content-services-regressions.test.ts (1)

86-92: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Tighten the focus-ring regexes; they can pass on the wrong element.

[\s\S]*? matches across element boundaries. The first regex is satisfied by the first focus-visible:outline-[color:var(--focus)] that appears anywhere after setShowComparison(true), which includes the Clear button and every later control in the file. If the class is removed from the Compare button only, this assertion still passes.

Bound the match to the same element, for example by asserting against the normalized source between the handler and the closing > of that button.

♻️ Suggested tightening
-    expect(serviceNavigatorSource).toMatch(
-      /setShowComparison\(true\)[\s\S]*?focus-visible:outline-\[color:var\(--focus\)\]/,
-    );
-    expect(serviceNavigatorSource).toMatch(
-      /setSelectedSlugs\(\[\]\)[\s\S]*?focus-visible:outline-\[color:var\(--focus\)\]/,
-    );
+    // Confine each match to the single JSX element that owns the handler.
+    expect(normalizedServiceNavigatorSource).toMatch(
+      /setShowComparison\(true\)[^>]*?focus-visible:outline-\[color:var\(--focus\)\]/,
+    );
+    expect(normalizedServiceNavigatorSource).toMatch(
+      /setSelectedSlugs\(\[\]\)[^>]*?focus-visible:outline-\[color:var\(--focus\)\]/,
+    );
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/audit-content-services-regressions.test.ts` around lines 86 - 92,
Restrict both regex assertions around setShowComparison(true) and
setSelectedSlugs([]) to the same button element by matching only through that
element’s closing “>”, rather than using an unbounded [\s\S]*? span. Keep the
focus-visible outline class requirement while preventing later controls from
satisfying the assertions.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/components/services/service-detail-page.tsx`:
- Around line 731-733: Update the referral-route display expression in the
service detail rendering so it selects service.referral only when
hasText(service.referral) is true; otherwise fall back to service.route.
Preserve the existing compactCatalogField formatting and "Confirm referral
route" fallback when neither field contains text.

In `@tests/services-catalog.test.ts`:
- Around line 231-240: Update the crossFieldOnly case in the
serviceMatchesCoreGroup test to use a minimal ServiceRecord fixture, placing
"public" and "community" in separate fields without spreading yarn!. Keep the
expected false result so the test specifically verifies patterns cannot match
across field boundaries.

---

Nitpick comments:
In `@src/components/services/services-navigator-page.tsx`:
- Around line 338-344: Update toggleSelected so the next selected-slug list is
computed outside the setSelectedSlugs updater, then apply setSelectedSlugs and
setShowComparison separately, keeping the updater pure. Replace the silent
slice(0, 5) cap with visible five-item limit behavior by disabling or clearly
explaining the add-to-shortlist control when five services are selected.

In `@tests/audit-content-services-regressions.test.ts`:
- Around line 86-92: Restrict both regex assertions around
setShowComparison(true) and setSelectedSlugs([]) to the same button element by
matching only through that element’s closing “>”, rather than using an unbounded
[\s\S]*? span. Keep the focus-visible outline class requirement while preventing
later controls from satisfying the assertions.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 82cba924-9259-41b9-820b-3d006313b85a

📥 Commits

Reviewing files that changed from the base of the PR and between 4587f78 and 58d732a.

📒 Files selected for processing (15)
  • docs/branch-review-ledger.md
  • docs/design-system/COMPONENTS.md
  • docs/design-system/adoption-manifest.json
  • src/app/(search-app)/services/page.tsx
  • src/components/services/service-detail-page.tsx
  • src/components/services/service-group-nav.tsx
  • src/components/services/service-referral-flow.tsx
  • src/components/services/services-home-page.tsx
  • src/components/services/services-navigator-page.tsx
  • src/lib/service-core-groups.ts
  • tests/audit-content-services-regressions.test.ts
  • tests/service-detail-page.dom.test.tsx
  • tests/services-catalog.test.ts
  • tests/ui-smoke.spec.ts
  • tests/ui-tools.spec.ts

Comment thread src/components/services/service-detail-page.tsx
Comment thread tests/services-catalog.test.ts
Use hasText when choosing referral vs route for the detail heading so an
empty referral string cannot blank the route, and isolate the cross-field
core-group negative test on a minimal ServiceRecord.

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
@BigSimmo
BigSimmo merged commit 3b6cab0 into main Aug 12, 2026
58 checks passed
@BigSimmo
BigSimmo deleted the codex/chat-services-flow-redesign-20260812 branch August 12, 2026 05:36
@cursor

cursor Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Comment resolution + merge

Resolved the 2 open CodeRabbit threads with fixes on tip 7014b7e8:

  1. Blank service.referral — heading now uses hasText(service.referral) before selecting referral vs route (DOM regression added).
  2. Cross-field negative test — minimal ServiceRecord fixture isolates adjacent public/community tags.

Unresolved review threads: 0.
Required CI went green; auto-merge completed.

Merged: 3b6cab0e into main at 2026-08-12T05:36:53Z.

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