From cb51e8e432898671275eb4fc86ae81dc31c997e3 Mon Sep 17 00:00:00 2001 From: Marcel Date: Wed, 29 Apr 2026 01:04:25 +0200 Subject: [PATCH] refactor(autosave): drop unused handleMentionsChange + getPendingMentions exports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Felix #2: both were exported anticipating a future use that never came — the editor only emits text+mentions through handleTextChange. Dead public surface invites stale code; ship the smaller API. Co-Authored-By: Claude Sonnet 4.6 --- frontend/src/lib/hooks/useBlockAutoSave.svelte.ts | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/frontend/src/lib/hooks/useBlockAutoSave.svelte.ts b/frontend/src/lib/hooks/useBlockAutoSave.svelte.ts index fd76f3e8..21de5442 100644 --- a/frontend/src/lib/hooks/useBlockAutoSave.svelte.ts +++ b/frontend/src/lib/hooks/useBlockAutoSave.svelte.ts @@ -23,10 +23,6 @@ export function createBlockAutoSave({ saveFn, documentId }: Options) { saveStates.set(blockId, state); } - function getPendingMentions(blockId: string, fallback: PersonMention[]): PersonMention[] { - return pendingMentions.get(blockId) ?? fallback; - } - async function executeSave(blockId: string): Promise { const text = pendingTexts.get(blockId); if (text === undefined) return; @@ -90,12 +86,6 @@ export function createBlockAutoSave({ saveFn, documentId }: Options) { scheduleDebounce(blockId); } - function handleMentionsChange(blockId: string, mentionedPersons: PersonMention[]): void { - pendingMentions.set(blockId, mentionedPersons); - // Mentions changes always accompany text changes from the editor, so the - // text-debounce timer covers them too. - } - function handleBlur(): void { for (const [blockId] of [...debounceTimers]) { clearDebounce(blockId); @@ -150,9 +140,7 @@ export function createBlockAutoSave({ saveFn, documentId }: Options) { return { getSaveState, - getPendingMentions, handleTextChange, - handleMentionsChange, handleBlur, handleRetry, clearBlock,