fix(kon): float window sidebar, transcription doubling guard, branding

Float window fixes:
- Root layout now detects /float and /viewer URLs and hides Sidebar,
  Titlebar, TaskSidebar for secondary windows. Belt-and-braces fix
  since +layout@.svelte should handle this but may not in SPA mode.
- Float window title: "Ramble - To-do" → "Kon - To-do"

Transcription doubling guard:
- Added chunk_id deduplication set in DictationPage — if a chunk_id
  has already been processed, skip the duplicate result
- Set cleared on each new recording session

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
jake
2026-03-16 23:07:30 +00:00
parent c463293935
commit 1ad2b55d9c
7 changed files with 146 additions and 14 deletions

View File

@@ -34,6 +34,9 @@
let activeTemplate = $state("");
let showTemplateMenu = $state(false);
// Deduplication: track which chunk IDs have been processed
let processedChunks = new Set();
// AudioWorklet state
let audioContext = null;
let workletNode = null;
@@ -79,6 +82,11 @@
function handleResult(result) {
if (result.status === "transcription" && result.segments) {
// Deduplication guard: skip if this chunk_id was already processed
if (result.chunk_id != null && processedChunks.has(result.chunk_id)) {
return;
}
if (result.chunk_id != null) processedChunks.add(result.chunk_id);
const text = result.segments.map((s) => s.text).join(" ").trim();
if (text) {
if (insertPos >= 0) {
@@ -214,6 +222,7 @@
pcmBuffer = [];
chunkId = 0;
chunkTimeOffset = 0;
processedChunks.clear();
// Only clear transcript if not in insert mode (fresh recording)
if (insertPos === -1) {