feat: person @mentions edit-mode infrastructure (PR-B1, #362) #369

Merged
marcel merged 26 commits from feat/person-mentions-issue-362-frontend-b1 into main 2026-04-29 08:05:49 +02:00
Showing only changes of commit cb51e8e432 - Show all commits

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,