feat(phase9): frontend types + persistence wiring for llmTags
TranscriptEntry gains llmTags: string[]; TranscriptRow gains the storage-shape llmTags: string. ContentTags type added. mapTranscriptRow hydrates llmTags from the comma-joined column. saveTranscriptMeta forwards llmTags through to update_transcript_meta_cmd, mirroring the existing manualTags handling. buildFrontmatter unions auto + manual + llm tags so exported markdown surfaces every source in one tags: list. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -144,6 +144,8 @@ function mapTranscriptRow(row: TranscriptDto): TranscriptEntry {
|
||||
const text = row.text ?? "";
|
||||
const rawTags = row.manualTags ?? "";
|
||||
const manualTags = rawTags ? rawTags.split(",").filter(Boolean) : [];
|
||||
const rawLlmTags = row.llmTags ?? "";
|
||||
const llmTags = rawLlmTags ? rawLlmTags.split(",").filter(Boolean) : [];
|
||||
const rawSegments = row.segmentsJson ?? "";
|
||||
let segments: Segment[] = [];
|
||||
if (rawSegments) {
|
||||
@@ -173,6 +175,7 @@ function mapTranscriptRow(row: TranscriptDto): TranscriptEntry {
|
||||
template: row.template ?? "",
|
||||
language: row.language ?? "",
|
||||
segments,
|
||||
llmTags,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -196,6 +199,7 @@ function normaliseTranscriptEntry(entry: TranscriptWriteEntry): TranscriptEntry
|
||||
template: entry.template ?? "",
|
||||
language: entry.language ?? "",
|
||||
segments: Array.isArray(entry.segments) ? entry.segments : [],
|
||||
llmTags: Array.isArray(entry.llmTags) ? entry.llmTags : [],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -292,6 +296,11 @@ export async function saveTranscriptMeta(id: string, patch: TranscriptMetaPatch)
|
||||
template: patch.template,
|
||||
language: patch.language,
|
||||
segmentsJson: patch.segments === undefined ? undefined : JSON.stringify(patch.segments),
|
||||
llmTags: patch.llmTags == null
|
||||
? undefined
|
||||
: (Array.isArray(patch.llmTags)
|
||||
? patch.llmTags.join(",")
|
||||
: String(patch.llmTags)),
|
||||
};
|
||||
const row = await invoke<TranscriptDto>("update_transcript_meta_cmd", {
|
||||
id: String(id),
|
||||
|
||||
Reference in New Issue
Block a user