mirror of
https://github.com/temetro/temetro.git
synced 2026-09-04 14:55:28 +00:00
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:
@@ -26,13 +26,18 @@ export function hasCitationMarkers(text: string): boolean {
|
||||
}
|
||||
|
||||
// Rewrites [[src:id]] → [n](#cite-id) for known sources; strips unknown markers.
|
||||
// Each source is cited at most once (its first occurrence) so an over-eager model
|
||||
// that tags every word with the same source collapses to a single chip.
|
||||
function withCitationLinks(
|
||||
text: string,
|
||||
numberById: Map<string, number>,
|
||||
): string {
|
||||
const seen = new Set<string>();
|
||||
return text.replace(CITATION_RE, (_match, id: string) => {
|
||||
const num = numberById.get(id);
|
||||
return num ? `[${num}](${CITE_HREF_PREFIX}${id})` : "";
|
||||
if (!num || seen.has(id)) return "";
|
||||
seen.add(id);
|
||||
return `[${num}](${CITE_HREF_PREFIX}${id})`;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user