2 Commits

Author SHA1 Message Date
Cursor Agent
0338495a57 fix(vocab): dedupe bulk import case-insensitively within the paste
Some checks failed
check / cargo check (macos-latest) (push) Has been cancelled
check / cargo check (ubuntu-22.04) (push) Has been cancelled
check / cargo check (windows-latest) (push) Has been cancelled
check / svelte build + lint (push) Has been cancelled
Previously the bulk import ran new Set(...) on raw trimmed strings
before lowercasing, so 'ACME' and 'acme' both survived the first
dedupe pass. Neither existed in the store, so both got added —
defeating the commit message's claim that pasting the same block
twice with different casing is a no-op.

Collapse case variants at the initial dedupe step using a lowercase
seen-set, keeping the first occurrence's casing as written.

Co-authored-by: jars <jakejars@users.noreply.github.com>
2026-04-21 16:00:03 +01:00
Cursor Agent
74062f8381 fix(capabilities): cover transcription-preview window in default ACL
The preview window was missing from the default capability's window
list. Its frontend calls core:window:allow-hide (getCurrentWindow().hide()
on dismiss / auto-hide) plus invoke('copy_to_clipboard') and a handful
of event listeners — none of those would have been permitted at runtime
because the capability never matched this window's label.

Add 'transcription-preview' alongside the other secondary windows so
the preview actually has access to the permissions it already relies on.
Regenerate gen/schemas/capabilities.json to match.

Co-authored-by: jars <jakejars@users.noreply.github.com>
2026-04-21 16:00:03 +01:00
3 changed files with 15 additions and 11 deletions

View File

@@ -2,7 +2,7 @@
"$schema": "../gen/schemas/desktop-schema.json",
"identifier": "default",
"description": "Capability for the main window",
"windows": ["main", "tasks-float", "transcript-viewer"],
"windows": ["main", "tasks-float", "transcript-viewer", "transcription-preview"],
"permissions": [
"core:default",
"core:window:allow-start-dragging",

View File

@@ -1 +1 @@
{"default":{"identifier":"default","description":"Capability for the main window","local":true,"windows":["main","tasks-float","transcript-viewer"],"permissions":["core:default","core:window:allow-start-dragging","core:window:allow-set-always-on-top","core:window:allow-minimize","core:window:allow-toggle-maximize","core:window:allow-is-maximized","core:window:allow-close","core:window:allow-hide","core:window:allow-show","core:window:allow-set-focus","opener:default","dialog:default","global-shortcut:allow-register","global-shortcut:allow-unregister"]}}
{"default":{"identifier":"default","description":"Capability for the main window","local":true,"windows":["main","tasks-float","transcript-viewer","transcription-preview"],"permissions":["core:default","core:window:allow-start-dragging","core:window:allow-set-always-on-top","core:window:allow-minimize","core:window:allow-toggle-maximize","core:window:allow-is-maximized","core:window:allow-close","core:window:allow-hide","core:window:allow-show","core:window:allow-set-focus","opener:default","dialog:default","global-shortcut:allow-register","global-shortcut:allow-unregister"]}}

View File

@@ -196,15 +196,19 @@
async function addBulkVocabTerms() {
const raw = bulkVocabText;
// Accept newline-separated OR comma-separated (or mixed) — whichever the
// user pasted. Trim each entry, drop empties, dedupe within the input.
const candidates = Array.from(
new Set(
raw
.split(/[\n,]+/)
.map((entry) => entry.trim())
.filter((entry) => entry.length > 0),
),
);
// user pasted. Trim each entry, drop empties, and dedupe case-insensitively
// so "ACME" and "acme" in the same paste collapse to a single term
// (Whisper prompts don't care about case).
const seen = new Set();
const candidates = [];
for (const entry of raw.split(/[\n,]+/)) {
const trimmed = entry.trim();
if (!trimmed) continue;
const key = trimmed.toLowerCase();
if (seen.has(key)) continue;
seen.add(key);
candidates.push(trimmed);
}
if (candidates.length === 0) {
vocabularyError = "Nothing to import — paste one term per line or separated by commas.";
return;