Skip to content

Commit 740e8e5

Browse files
KillerXclaude
andcommitted
feat(vault): add "Correct transcription" Cantemo action button
Adds a permission-gated chip to the Vault item actions (and the embedded cantemo panel) that opens the transcription editor for the item at /transcription/<vxid> in a new tab. Gated by the existing transcription permission (admin or mediabanken), matching the home-page Transcription tool. Adds openToolWithIdPath since the editor takes the id as a path segment rather than the ?id= query the export chips use. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 3461954 commit 740e8e5

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

frontend/app/composables/useCantemoActions.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,14 @@ export function useCantemoActions(vxId: MaybeRefOrGetter<string | undefined>) {
5353
window.open(`${path}?id=${id}`, "_blank");
5454
}
5555

56+
// Like openTool, but for tools that take the item id as a path segment
57+
// (e.g. the transcription editor at /transcription/<vxid>) rather than ?id=.
58+
function openToolWithIdPath(path: string) {
59+
const id = toValue(vxId);
60+
if (!id) return;
61+
window.open(`${path}/${id}`, "_blank");
62+
}
63+
5664
const chips = computed<CantemoChip[]>(() => {
5765
const m = me.value;
5866
return [
@@ -105,6 +113,18 @@ export function useCantemoActions(vxId: MaybeRefOrGetter<string | undefined>) {
105113
"Transcription started",
106114
),
107115
},
116+
{
117+
name: "Correct transcription",
118+
action: "Open the transcription editor",
119+
color: "#8b5cf6",
120+
enabled: !!(
121+
m?.admin ||
122+
(m?.transcription &&
123+
(m.transcription.admin ||
124+
m.transcription.mediabanken))
125+
),
126+
run: () => openToolWithIdPath("/transcription"),
127+
},
108128
{
109129
name: "Update subtitle from Subtrans",
110130
action: "Trigger appropriate workflow",

0 commit comments

Comments
 (0)