refactor(autosave): drop unused handleMentionsChange + getPendingMentions exports

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 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-04-29 01:04:25 +02:00
parent bbde9e8497
commit cb51e8e432

View File

@@ -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<void> {
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,