Redesign Services into a progressive referral workflow - #1829
Conversation
…at-services-flow-redesign-20260812
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. 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 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 configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe 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. ChangesServices redesign
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
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
Review and sweep summary for PR #1829
I reviewed the full changed set for actionable defects and did not find high-confidence regressions. Findings
Remediations
Local evidence
Decision
|
Review summary (review-and-fix)
Disposition: no fixes applied; review complete for this pass. |
Codex babysit sweep (review-and-fix)Snapshot
Review findings
Required checks on snapshot
Local proof
Ledger
Merge left to you. |
Babysit review summary
Findings
Ledger
Evidence
|
Babysit summary (1829)
|
Codex babysit summary (1829)
|
PR review summary (babysit)PR #1829 snapshot
Findings
Disposition
Notes
|
There was a problem hiding this comment.
💡 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".
|
@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. |
There was a problem hiding this comment.
💡 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".
There was a problem hiding this comment.
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 viagroup=andrun=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.
Babysit review snapshot —
|
Babysit review (scope: exact babysit-pr)Snapshot (current GitHub head):
Outcome: dispositioned (no additional action required; no new high-confidence defects found in this pass). Merge left to you. |
babysit summary
|
Babysit review summary
|
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>
Babysit summary — PR #1829 heavy review-and-fixTip: Fixed
Dispositioned / already clear
Required CIRe-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)
Residual risks
LedgerAppended local-only (unpushed) row for head Merge left to you. |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (2)
src/components/services/services-navigator-page.tsx (1)
338-344: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winMove the
setShowComparisoncall out of thesetSelectedSlugsupdater, and give the shortlist cap a visible effect.Two points in
toggleSelected:
- 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..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 winTighten the focus-ring regexes; they can pass on the wrong element.
[\s\S]*?matches across element boundaries. The first regex is satisfied by the firstfocus-visible:outline-[color:var(--focus)]that appears anywhere aftersetShowComparison(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
📒 Files selected for processing (15)
docs/branch-review-ledger.mddocs/design-system/COMPONENTS.mddocs/design-system/adoption-manifest.jsonsrc/app/(search-app)/services/page.tsxsrc/components/services/service-detail-page.tsxsrc/components/services/service-group-nav.tsxsrc/components/services/service-referral-flow.tsxsrc/components/services/services-home-page.tsxsrc/components/services/services-navigator-page.tsxsrc/lib/service-core-groups.tstests/audit-content-services-regressions.test.tstests/service-detail-page.dom.test.tsxtests/services-catalog.test.tstests/ui-smoke.spec.tstests/ui-tools.spec.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>
Comment resolution + mergeResolved the 2 open CodeRabbit threads with fixes on tip
Unresolved review threads: 0. Merged: |
Summary
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-localnpm run verify:uiwhen UI, routing, styling, browser behavior, reduced-motion, or forced-colors behavior changednpm run verify:releasebefore release or handoff confidence claimsnpm run verify:phone-chromenpm run buildnpm run check:rag:fixturesnpm run check:production-readinesswhen clinical workflow, privacy, environment, Supabase, source governance, or deployment behavior changednpm run check:deployment-readinesswhen deployment startup, hosting, or rollout behavior changedRisk and rollout
Clinical Governance Preflight
Clinical KB Database(sjrfecxgysukkwxsowpy)Notes
Summary by CodeRabbit
New Features
Bug Fixes
Documentation