diff --git a/src/lib/components/FocusTimer.svelte b/src/lib/components/FocusTimer.svelte index 4fcdc0f..1e8b777 100644 --- a/src/lib/components/FocusTimer.svelte +++ b/src/lib/components/FocusTimer.svelte @@ -15,8 +15,26 @@ // follows the sensory-zone theme switcher in Settings. import { onMount, onDestroy } from "svelte"; - import { X, Plus } from "lucide-svelte"; + import { X, Plus, ExternalLink } from "lucide-svelte"; import { focusTimer } from "$lib/stores/focusTimer.svelte.js"; + import { hasTauriRuntime } from "$lib/utils/runtime.js"; + + // Hide the "pop out" button inside the float window itself — opening + // a second float from a float would be silly and would re-mount the + // same component. Detect via URL rather than a prop so we do not + // have to thread context through every mount site. + let isSecondaryWindow = $state(false); + if (typeof window !== "undefined") { + isSecondaryWindow = window.location.pathname.startsWith("/float") + || window.location.pathname.startsWith("/viewer"); + } + + function handlePopOut() { + // Mirror the button in TasksPage.svelte — opens the always-on-top + // Now list + pinned timer in one floating window. + if (!hasTauriRuntime()) return; + window.open("/float", "_blank", "width=380,height=520"); + } const RING_SIZE = 64; const RING_STROKE = 5; @@ -148,6 +166,16 @@ >