- TranscriptionBlockData now carries mentionedPersons (matches backend schema added in PR-A). - useBlockAutoSave.saveFn signature widens to (blockId, text, mentions); pendingMentions is tracked alongside pendingTexts and is preserved on failure so a retry resends the in-flight payload (B12). - TranscriptionBlock.svelte renders <PersonMentionEditor>, exposing the textarea node back through a captureTextarea callback so the existing quote-selection feature still works. - saveBlock in routes/documents/[id]/+page.svelte forwards mentions on PUT. - flushOnUnload sends mentions in the keepalive payload too. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
49 lines
1.2 KiB
Svelte
49 lines
1.2 KiB
Svelte
<script lang="ts">
|
|
import { provideConfirmService, type ConfirmService } from '$lib/services/confirm.svelte.js';
|
|
import TranscriptionBlock from './TranscriptionBlock.svelte';
|
|
import type { PersonMention } from '$lib/types';
|
|
|
|
type BlockProps = {
|
|
blockId: string;
|
|
documentId: string;
|
|
blockNumber: number;
|
|
text: string;
|
|
mentionedPersons?: PersonMention[];
|
|
label: string | null;
|
|
active: boolean;
|
|
saveState: 'idle' | 'saving' | 'saved' | 'fading' | 'error';
|
|
canComment: boolean;
|
|
currentUserId: string | null;
|
|
onTextChange: (text: string, mentionedPersons: PersonMention[]) => void;
|
|
onFocus: () => void;
|
|
onDeleteClick: () => void;
|
|
onRetry: () => void;
|
|
onReviewToggle?: () => void;
|
|
onMoveUp?: () => void;
|
|
onMoveDown?: () => void;
|
|
isFirst?: boolean;
|
|
isLast?: boolean;
|
|
};
|
|
|
|
let {
|
|
onServiceReady,
|
|
mentionedPersons = [],
|
|
reviewed = false,
|
|
onReviewToggle = () => {},
|
|
...blockProps
|
|
}: BlockProps & {
|
|
onServiceReady: (s: ConfirmService) => void;
|
|
reviewed?: boolean;
|
|
} = $props();
|
|
|
|
const service = provideConfirmService();
|
|
onServiceReady(service);
|
|
</script>
|
|
|
|
<TranscriptionBlock
|
|
{...blockProps}
|
|
mentionedPersons={mentionedPersons}
|
|
reviewed={reviewed}
|
|
onReviewToggle={onReviewToggle}
|
|
/>
|