fix(notes): adopt server-side notes.md changes (speaker rename, reprocess) into the open editor buffer

Also untangles the a11y svelte-ignore comment from its prose so eslint's
no-unused-svelte-ignore stops parsing the explanation as ignore codes.
This commit is contained in:
iamdoubz
2026-07-15 17:41:37 -05:00
parent 28d9b2988a
commit de25ac70e7
+22 -5
View File
@@ -74,6 +74,10 @@
let editorEl: HTMLTextAreaElement | undefined = $state();
let saveTimer: ReturnType<typeof setTimeout> | undefined;
let loadedForId: string | null = null;
// The server copy the buffer was last synced against — lets the effect below
// tell a server-side notes change (speaker rename, reprocess) apart from the
// user's own unsaved edits.
let lastServerNotes: string | null = null;
// Transcript/notes split (FR-UX-1): resizable (drag the Splitter) and
// each side independently hideable, shared across the finalized-meeting
@@ -111,14 +115,23 @@
selectedSegmentMs = null;
});
// Sync the editor buffer whenever a different meeting is selected.
// Sync the editor buffer whenever a different meeting is selected — and when
// the *server* copy of the same meeting's notes changes underneath us (a
// speaker rename rewrites notes.md's dialogue tags, reprocess regenerates it).
// A buffer with unsaved local edits is never clobbered: it only adopts the
// server copy when it still equals the last-synced one.
$effect(() => {
const m = meetings.selected;
if (m && m.id !== loadedForId) {
notesText = m.notes_markdown;
lastServerNotes = m.notes_markdown;
loadedForId = m.id;
} else if (m && m.id === loadedForId && m.notes_markdown !== lastServerNotes) {
if (notesText === lastServerNotes) notesText = m.notes_markdown;
lastServerNotes = m.notes_markdown;
} else if (!m) {
loadedForId = null;
lastServerNotes = null;
}
});
@@ -357,9 +370,9 @@
style="grid-template-columns: {splitColumns()};"
bind:clientWidth={splitWidth}
>
<!-- svelte-ignore a11y_no_static_element_interactions -- wheel/touchmove
here only note "the user scrolled by hand" to pause playback
auto-scroll; the pane isn't an interactive control. -->
<!-- wheel/touchmove here only note "the user scrolled by hand" to pause
playback auto-scroll; the pane isn't an interactive control. -->
<!-- svelte-ignore a11y_no_static_element_interactions -->
<div
class="pane transcript"
class:collapsed={layout.transcriptCollapsed}
@@ -513,7 +526,11 @@
>
<ListChecks size={14} aria-hidden="true" />
</button>
<button onclick={() => insertLinePrefix("### ")} title={t("notes.h3")} aria-label={t("notes.h3")}>
<button
onclick={() => insertLinePrefix("### ")}
title={t("notes.h3")}
aria-label={t("notes.h3")}
>
<Heading3 size={14} aria-hidden="true" />
</button>
<button