Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"version": 2,
"id": "4d148590-e6c2-4dde-b07d-111f312c827e",
"createdOn": "2026-09-07",
"action": "update",
"payload": {
"id": "#ZKR5YK",
"detail": "UPDATE 2026-09-06: this row is now partly stale and its Sources example is gone. PR #2672 consolidated /sources: its four-card mode home was deleted and the bare path now redirects to the shared home at /?mode=sources, so Sources no longer owns a home of its own and the mode pill landing there is correct rather than a miss. The row's remaining live cases are Favourites and Tools. Favourites is settled by an explicit owner decision (#V0EDR4, 2026-08-23: two purpose-specific surfaces are deliberate), which leaves Tools as the only open instance: changeMode still builds appModeSelectionHref, so picking Tools lands on /?mode=tools and the legacy client-only launcher (applications-launcher-page.tsx, data-testid tools-home) rather than canonical /tools (ToolsSearchResultsPage). Verified on main 0177bed by a browser probe: /?mode=tools renders tools-home. Documents and Medication also dropped off this row for the same reason as Sources - both bare paths redirect now. STILL AN OWNER RULING, not a defect to fix unilaterally: the pill deliberately always returns to the shared home, so special-casing Tools trades one inconsistency for another, and removing the second launcher means deleting a component that six assertions in tests/favourites-auth-gate.dom.test.tsx still render directly. Re-scope this row to Tools only.",
"baseRowFingerprint": "4a2c45298f781607394bb54bdde280518d7e1e6c1706ae00e2b05526613fa232"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"version": 2,
"id": "aca18f9d-f748-40cd-918a-51ecb9b91f1c",
"createdOn": "2026-09-07",
"action": "cancel",
"payload": {
"requestId": "4d148590-e6c2-4dde-b07d-111f312c827e",
"reason": "Withdrawn in favour of the competing request 4036f064, a done on the same row backed by an actual implementation (outcome: mode pill now routes to dedicated mode homes). My request only re-scoped #ZKR5YK to Tools after verifying that its Sources, Documents and Medication examples are gone (all three bare paths redirect now) and that Favourites is settled by owner decision #V0EDR4. A re-scope is pointless against a close that supersedes the whole row, and two pending mutations on one row block reconciliation for everyone (#686WHW). The verified findings are recorded in the PR that carried this session's fixes instead, so they are not lost if that close is ever reopened."
}
}
50 changes: 25 additions & 25 deletions docs/site-map.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ This file is generated by `npm run docs:update` (or `npm run sitemap:update` dir
| Specifiers | `/?mode=specifiers` | `/specifiers/search?q=depressed+but+racing+thoughts&focus=1&run=1` | `/specifiers/[slug]`, `/specifiers/builder`, `/specifiers/compare`, and `/specifiers/map`. |
| Formulation | `/?mode=formulation` | `/formulation/search?q=I+keep+going+over+it&focus=1&run=1` | `/formulation/[slug]`, `/formulation/builder`, `/formulation/compare`, and `/formulation/map`. |
| Medication | `/medications` | `/?mode=prescribing&q=acamprosate+renal+dose&focus=1&run=1` | `/medications/[slug]`; submitted searches resolve to `/?mode=prescribing&q=…&run=1`. |
| Tools | `/tools` | `/tools?q=medications&focus=1&run=1` | Canonical all-tools results directory at `/tools`; the universal mode picker opens it directly. `/?mode=tools` remains a dashboard-mode alias. |
| Tools | `/tools` | `/tools?q=medications&focus=1&run=1` | Canonical all-tools results directory at `/tools`; the universal mode picker opens it directly. `/?mode=tools` redirects here, so Tools has one surface. |
| Calculators | `/?mode=calculators` | `/calculators/search?q=PHQ-9&focus=1&run=1` | `/calculators/search` is the browsable calculator catalogue and scored-results surface; an empty query lists every calculator. |
| Factsheets | `/?mode=factsheets` | `/factsheets/search?q=sertraline&focus=1&run=1` | `/factsheets/search` is the query-and-filter surface; `/factsheets/topics` organises the library by category; `/factsheets/[slug]` records. |
| Dictionary | `/?mode=dictionary` | `/dictionary/search?q=MSE&focus=1&run=1` | `/dictionary/search` is one catalogue for both searching and browsing; `/dictionary/browse` redirects to it. Also `/topics`, `/topics/[slug]`, `/compare` and `/dictionary/[slug]` records; `/dictionary/sources` redirects to Sources. |
Expand Down Expand Up @@ -1436,27 +1436,27 @@ This file is generated by `npm run docs:update` (or `npm run sitemap:update` dir

## Route ownership/source map

| Area | Source |
| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Root dashboard and query modes | `src/app/(search-app)/page.tsx, src/lib/app-modes.ts` |
| Global shell layouts | `src/app/*/layout.tsx, src/components/clinical-dashboard/global-search-shell.tsx` |
| Services | `src/app/(search-app)/services, src/lib/services.ts, src/app/api/registry/records` |
| Forms | `src/app/(search-app)/forms, src/lib/forms.ts, src/app/api/registry/records` |
| Favourites | `src/app/(search-app)/favourites, src/components/clinical-dashboard/favourites-command-library-page.tsx` |
| Differentials | `src/app/(search-app)/differentials, src/lib/differentials.ts` |
| DSM-5 Diagnosis | `src/app/(search-app)/dsm, src/components/dsm, src/lib/dsm.ts` |
| Specifiers | `src/app/(search-app)/specifiers, src/components/specifiers, src/lib/specifiers.ts` |
| Formulation | `src/app/(search-app)/formulation, src/components/formulation, src/lib/formulation.ts` |
| Medications | `src/app/(search-app)/medications, src/components/clinical-dashboard/medication-prescribing-workspace.tsx` |
| Documents | `src/app/(search-app)/documents, src/lib/document-flow-routes.ts` |
| Calculators | `src/app/(search-app)/calculators, src/components/calculators` |
| Therapy Compass | `src/app/(search-app)/therapy-compass, src/lib/therapies.ts` |
| Factsheets | `src/app/(search-app)/factsheets, src/components/factsheets` |
| Dictionary | `src/app/(search-app)/dictionary, src/lib/dictionary.ts` |
| Safety Plan | `src/app/safety-plan, src/components/patient-safety-plan.tsx` |
| Privacy | `src/app/privacy` |
| Tools | `src/app/(search-app)/tools, src/components/tools/tools-search-results-page.tsx, src/components/applications-launcher-page.tsx (the retained `/?mode=tools` alias)` |
| Sources | `src/app/(search-app)/sources, src/components/sources, src/lib/sources` |
| On Call | `src/app/(search-app)/on-call, src/components/on-call` |
| Caring Contacts workspace | `src/app/caring-contacts, src/components/caring-contacts/workspace, src/lib/caring-contacts-routes.ts` |
| Mockups | `src/app/mockups` |
| Area | Source |
| ------------------------------ | ----------------------------------------------------------------------------------------------------------------------------- |
| Root dashboard and query modes | `src/app/(search-app)/page.tsx, src/lib/app-modes.ts` |
| Global shell layouts | `src/app/*/layout.tsx, src/components/clinical-dashboard/global-search-shell.tsx` |
| Services | `src/app/(search-app)/services, src/lib/services.ts, src/app/api/registry/records` |
| Forms | `src/app/(search-app)/forms, src/lib/forms.ts, src/app/api/registry/records` |
| Favourites | `src/app/(search-app)/favourites, src/components/clinical-dashboard/favourites-command-library-page.tsx` |
| Differentials | `src/app/(search-app)/differentials, src/lib/differentials.ts` |
| DSM-5 Diagnosis | `src/app/(search-app)/dsm, src/components/dsm, src/lib/dsm.ts` |
| Specifiers | `src/app/(search-app)/specifiers, src/components/specifiers, src/lib/specifiers.ts` |
| Formulation | `src/app/(search-app)/formulation, src/components/formulation, src/lib/formulation.ts` |
| Medications | `src/app/(search-app)/medications, src/components/clinical-dashboard/medication-prescribing-workspace.tsx` |
| Documents | `src/app/(search-app)/documents, src/lib/document-flow-routes.ts` |
| Calculators | `src/app/(search-app)/calculators, src/components/calculators` |
| Therapy Compass | `src/app/(search-app)/therapy-compass, src/lib/therapies.ts` |
| Factsheets | `src/app/(search-app)/factsheets, src/components/factsheets` |
| Dictionary | `src/app/(search-app)/dictionary, src/lib/dictionary.ts` |
| Safety Plan | `src/app/safety-plan, src/components/patient-safety-plan.tsx` |
| Privacy | `src/app/privacy` |
| Tools | `src/app/(search-app)/tools, src/components/tools/tools-search-results-page.tsx, src/components/tools/tool-quick-actions.tsx` |
| Sources | `src/app/(search-app)/sources, src/components/sources, src/lib/sources` |
| On Call | `src/app/(search-app)/on-call, src/components/on-call` |
| Caring Contacts workspace | `src/app/caring-contacts, src/components/caring-contacts/workspace, src/lib/caring-contacts-routes.ts` |
| Mockups | `src/app/mockups` |
4 changes: 2 additions & 2 deletions scripts/generate-site-map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ const routeOwnershipRows = [
["Privacy", "src/app/privacy"],
[
"Tools",
"src/app/(search-app)/tools, src/components/tools/tools-search-results-page.tsx, src/components/applications-launcher-page.tsx (the retained `/?mode=tools` alias)",
"src/app/(search-app)/tools, src/components/tools/tools-search-results-page.tsx, src/components/tools/tool-quick-actions.tsx",
],
["Sources", "src/app/(search-app)/sources, src/components/sources, src/lib/sources"],
["On Call", "src/app/(search-app)/on-call, src/components/on-call"],
Expand Down Expand Up @@ -532,7 +532,7 @@ function renderModePageIndex() {
home: appModeHomeHref("tools"),
search: appModeHomeHref("tools", { query: "medications", focus: true, run: true }),
detail:
"Canonical all-tools results directory at `/tools`; the universal mode picker opens it directly. `/?mode=tools` remains a dashboard-mode alias.",
"Canonical all-tools results directory at `/tools`; the universal mode picker opens it directly. `/?mode=tools` redirects here, so Tools has one surface.",
},
{
mode: "Calculators",
Expand Down
28 changes: 22 additions & 6 deletions src/components/ClinicalDashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3014,11 +3014,10 @@ function ClinicalDashboardContent({
activeModeResultKind === "services" ||
activeModeResultKind === "forms") &&
modeSearchSubmitted));
// `/tools` owns the tools catalogue, but the legacy `/?mode=tools` entry
// still renders this dashboard path. Keep both entry points composer-free so
// the alias cannot mount a second ownership model (hero/page/dock) behind
// the canonical route's no-composer contract. Modes that only borrow the
// `tools` result kind remain on the shared home and are intentionally exempt.
// `/tools` owns the tools catalogue and stays composer-free, so a dashboard
// path reaching the tools result kind must not mount a second ownership model
// (hero/page/dock) behind it. Modes that only borrow the `tools` result kind
// remain on the shared home and are intentionally exempt.
const toolsDirectoryWithoutComposer = activeModeResultKind === "tools" && !showSharedHome;
const showDesktopHomeComposer =
!error &&
Expand Down Expand Up @@ -3317,7 +3316,24 @@ function ClinicalDashboardContent({
onAsk={ask}
onClearQuery={() => {
setQuery("");
if (!answer) setModeSearchSubmitted(false);
if (answer) return;
// Clearing an initial Answer request must invalidate and abort it
// before navigation. Otherwise its late result can repaint the
// answer and restore the submitted URL after the shared home opens.
if (loading) stopSearch();
setModeSearchSubmitted(false);
// Clear the URL too, or `showSharedHome` (which reads `run=1` off the URL)
// stays suppressed while the mode branch, now query-less, falls back to the
// retired home its route was consolidated away from — `medication-home` and
// `document-search-empty-state`, both pinned by browser cases.
// `appModeSelectionHref`, not `appModeHomeHref`: these modes are all
// dashboard-owned, and `appModeHomeHref("prescribing")` answers
// `/medications`, which only 307s back here.
if (submittedUrlRunRequested) {
router.replace(appModeSelectionHref(searchMode, { focus: true, queryMode, scopeFilters }), {
scroll: false,
});
Comment thread
BigSimmo marked this conversation as resolved.
}
}}
onClearScope={() => setSelectedDocumentIds([])}
onQueryModeChange={setQueryMode}
Expand Down
2 changes: 1 addition & 1 deletion src/components/clinical-dashboard/ClinicalSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const sidebarToolItems = [
// points straight at the shared home too, matching Documents/Services above.
{ id: "prescribing", label: appModeDefinition("prescribing").label, icon: Pill, href: "/?mode=prescribing" },
{ id: "factsheets", label: "Factsheets", icon: appModeIcons.factsheets, href: "/?mode=factsheets" },
// PT-11: standalone /tools is the canonical entry; /?mode=tools remains a dashboard-mode alias.
// PT-11: standalone /tools is the canonical entry; /?mode=tools redirects to it.
{ id: "tools", label: "Tools", icon: Wrench, href: "/tools" },
] as const;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import type { ClinicalQueryMode } from "@/lib/clinical-query-mode";
// `normalizedPollDelay`. Shared with the dashboard's polling loop.
export const setupRecheckPollMs = 60_000;

/** Keep the retained `/?mode=tools` launcher separate from every other idle mode home. */
/** Keep the tools result kind separate from every other idle mode home. */
export function shouldShowSharedHome({
pathname,
mode,
Expand Down
Loading
Loading