fix(chat,analysis,sidebar): compact cards, sparse citations, range + active state

- Chat patient cards are now compact previews (header + key stat + "Click for
  more"); cards size to content (items-start) instead of stretching to the tallest;
  Edit record moved into the summary detail dialog
- AI citations render once per source per message (collapses per-word spam) and the
  prompt now asks the model to cite sparingly (once per paragraph, not per list item)
- Sidebar sub-items use exact-match active state so Meetings no longer lights Inbox
- Analysis defaults to All Time, drops the 12m option, and clamps the chart window
  to >=2 points so 30d/Today render instead of collapsing

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Khalid Abdi
2026-06-20 01:57:31 +03:00
parent c88b674196
commit e841cb56e1
6 changed files with 77 additions and 101 deletions
+6 -5
View File
@@ -165,11 +165,12 @@ function systemPrompt(
"tool, so keep your prose a brief summary rather than re-listing every field.",
"",
"Citations: every retrieval tool result includes a `sourceId` (e.g. \"s1\").",
"When you state a fact drawn from a tool result, append an inline citation",
"marker immediately after that statement, in the exact form [[src:ID]] using",
"the matching sourceId e.g. \"BP is well controlled [[src:s1]].\" Cite only",
"facts grounded in tool results, place the marker right after the relevant",
"sentence, and never invent or guess a sourceId.",
"Cite **sparingly** — add at most ONE marker per paragraph, on the single most",
"important record-derived claim, in the exact form [[src:ID]] using the matching",
"sourceId (e.g. \"BP is well controlled this quarter [[src:s1]].\"). Do NOT cite",
"every sentence, do NOT cite individual list items (e.g. each allergy or",
"medication), and never repeat the same source more than once. Cite only facts",
"grounded in tool results, and never invent or guess a sourceId.",
veilActive
? `Privacy: this conversation runs on an external provider (${providerLabel}). Patient identifiers are de-identified as tokens like [PATIENT_1] / [MRN_1]; refer to patients generically ("this patient") rather than repeating tokens.`
: "",