pediatric-ai-scribe-v3/public/js
Daniel 0e1e74882e feat: sources are numbered in the order the answer cites them
Borrowed from the quiz app's AI Mode, where validating citations and
ordering them fall out of the same pass: it collects the sources an
answer actually used into an insertion-ordered map, so the list comes
back in first-citation order for free.

Ours listed sources in retrieval order — an order the reader never sees
and has no way to follow. An answer whose first citation was [7] opened
a list that began at [1], so matching a marker to a source meant
hunting. Reference lists in published writing are numbered by first
appearance for exactly this reason.

Cited sources now come first, renumbered by first appearance, and the
markers in the text are rewritten to match. Anything retrieved and not
cited keeps its place after them, labelled "not cited" — the panel is
also a view of what the search returned, which is worth keeping, but it
should not sit among the numbers the answer used.

The marker itself now shows its number instead of the word "src". Every
citation read identically, so the only way to tell one from another was
to hover it — which made the numbered list beneath useless to match
against. The export has shown numbers since the day "src" was
introduced, with no recorded reason for the difference.

Renumbering happens once the whole answer is known, never while
streaming: the order is the order of first citation, so a citation that
has not arrived yet cannot take its place, and numbers would shuffle
under the reader mid-sentence. The text is rewritten in a single pass —
number by number would turn 2 into 1 and then that 1 into whatever 1
maps to.

An invented citation reserves no position and is left exactly as it was.
It is still not turned into a link, and citation_audit still records it;
what matters here is that it cannot push a real source down the list.

Accuracy was already held: a marker with no matching source never
becomes a link. This changes what a reader can do with the ones that are
real.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dv6sqaY6Vq3ChZHMem3cnU
2026-09-13 03:26:17 +02:00
..
admin fix: My Resources uses the image model you chose for it, and says so on save 2026-09-13 02:37:57 +02:00
assistant feat: sources are numbered in the order the answer cites them 2026-09-13 03:26:17 +02:00
bedside
calculators
notes feat: retire Learning Hub 2026-09-12 20:14:20 +02:00
wellVisit
accountBoundary.js fix: trim the account-boundary message to what a reader needs 2026-09-12 18:36:37 +02:00
admin-docs.js docs: merge the duplicate pairs and correct them against the running app 2026-09-12 04:57:35 +02:00
admin.js fix: the Search Sources card loads its saved settings again 2026-09-13 02:12:17 +02:00
app.js fix: a newly added model reaches every picker, including the user-facing ones 2026-09-12 17:46:18 +02:00
audioBackup.js feat: a retried transcript goes back to the tab the audio came from 2026-09-11 12:39:50 +02:00
auth.js fix: the account boundary explains itself instead of reading as an SSO failure 2026-09-12 18:24:14 +02:00
authFetch.js feat: sign in with a code emailed to you, offered beside the password 2026-09-11 20:12:03 +02:00
calc-math.js
calculators.js
chartReview.js
clinicalAssistant.js feat: sources are numbered in the order the answer cites them 2026-09-13 03:26:17 +02:00
diagrams.js
documents.js
drugs-loader.js
e2e-bootstrap.js
ed-encounters.js feat: a retried transcript goes back to the tab the audio came from 2026-09-11 12:39:50 +02:00
encounters.js
extensions.js fix: image Done state, chat titles that keep whole words, and readable extension cards 2026-09-10 06:44:22 +02:00
generatedImages.js feat: PubMed search for My Resources, and an image tool that actually fires 2026-09-11 16:47:08 +02:00
hospitalCourse.js
liveEncounter.js feat: a retried transcript goes back to the tab the audio came from 2026-09-11 12:39:50 +02:00
memories.js
milestones.js
milestonesData.js
myResources.js feat: a theme is shown by a sample deck you download, not a picture 2026-09-12 22:24:05 +02:00
nextcloud.js fix: "Sign in with Nextcloud" opens the sign-in page 2026-09-12 21:36:51 +02:00
notes.js
peGuide.js
recordingModules.js feat: a retried transcript goes back to the tab the audio came from 2026-09-11 12:39:50 +02:00
secureStorage.js
shadess.js feat: a retried transcript goes back to the tab the audio came from 2026-09-11 12:39:50 +02:00
sickVisit.js feat: a retried transcript goes back to the tab the audio came from 2026-09-11 12:39:50 +02:00
soap.js feat: a retried transcript goes back to the tab the audio came from 2026-09-11 12:39:50 +02:00
speechRecognition.js
transcriptionSettings.js
ui-state.js
voiceDictation.js feat: a retried transcript goes back to the tab the audio came from 2026-09-11 12:39:50 +02:00
voicePreferences.js
wellVisit.js