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:
@@ -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) {
|
||||
|
||||
@@ -7,8 +7,17 @@
|
||||
import Titlebar from "$lib/components/Titlebar.svelte";
|
||||
import { page, settings } from "$lib/stores/page.svelte.js";
|
||||
|
||||
import { page as sveltePage } from "$app/stores";
|
||||
|
||||
let { children } = $props();
|
||||
|
||||
// Detect secondary windows (float, viewer) — they use +layout@.svelte
|
||||
// but as a fallback, hide chrome if the URL matches
|
||||
let isSecondaryWindow = $derived(
|
||||
$sveltePage.url.pathname.startsWith("/float") ||
|
||||
$sveltePage.url.pathname.startsWith("/viewer")
|
||||
);
|
||||
|
||||
// Recording indicator dot (follows mouse)
|
||||
let mouseX = $state(0);
|
||||
let mouseY = $state(0);
|
||||
@@ -98,17 +107,22 @@
|
||||
></div>
|
||||
{/if}
|
||||
|
||||
<div class="flex flex-col h-screen w-screen overflow-hidden grain">
|
||||
<Titlebar />
|
||||
<div class="flex flex-1 min-h-0">
|
||||
{#if page.current !== "first-run"}
|
||||
<Sidebar />
|
||||
{/if}
|
||||
<div class="flex-1 overflow-hidden bg-bg">
|
||||
{@render children()}
|
||||
{#if isSecondaryWindow}
|
||||
<!-- Secondary windows (float, viewer) render children only — no shell chrome -->
|
||||
{@render children()}
|
||||
{:else}
|
||||
<div class="flex flex-col h-screen w-screen overflow-hidden grain">
|
||||
<Titlebar />
|
||||
<div class="flex flex-1 min-h-0">
|
||||
{#if page.current !== "first-run"}
|
||||
<Sidebar />
|
||||
{/if}
|
||||
<div class="flex-1 overflow-hidden bg-bg">
|
||||
{@render children()}
|
||||
</div>
|
||||
{#if page.taskSidebarOpen && page.current !== "first-run"}
|
||||
<TaskSidebar />
|
||||
{/if}
|
||||
</div>
|
||||
{#if page.taskSidebarOpen && page.current !== "first-run"}
|
||||
<TaskSidebar />
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
@@ -168,7 +168,7 @@
|
||||
data-tauri-drag-region
|
||||
>
|
||||
<span class="text-[12px] font-medium text-text-secondary tracking-wide" data-tauri-drag-region>
|
||||
Ramble - To-do
|
||||
Kon - To-do
|
||||
</span>
|
||||
|
||||
<div class="flex-1" data-tauri-drag-region></div>
|
||||
|
||||
Reference in New Issue
Block a user