feat(focus-timer): Phase 1 — visual countdown ring + just-start timer
Closes the Core MVP gap in docs/brief/feature-set.md ("visual time
representation") and wires the dangling kon:start-timer emit that
MicroSteps.svelte has been firing into the void since the stub was
written. Implements phase 1 of the 2026-04-23 feature-complete
roadmap.
New:
- src/lib/stores/focusTimer.svelte.ts — singleton timer store with
localStorage persistence so a timer started in Dictation survives
page nav, window close, and reopen. Gentle WebAudio chime at
completion (no bundled asset). 250 ms tick. Completion flash for
3 s before auto-clear.
- src/lib/components/FocusTimer.svelte — floating top-right overlay
with SVG progress ring (shrinking colour: accent -> warning in
the final 15% -> success on completion). Cancel + "+1 min" on
hover. Renders nothing when idle.
Wired in +layout.svelte next to ToastViewport.
Two triggers now in the app:
- MicroSteps row 2-min button (pre-existing emit, previously no
listener)
- WipTaskList row 5-min button (new; the brief's "just-start"
from the Now column)
Respects prefers-reduced-motion via the existing
[data-reduce-motion] attribute.
Out of scope, carried to later phases: rhythmic voice anchoring
(Phase 6), custom-duration picker, multi-timer UI, native OS
notification (deferred to Phase 6 with the full nudge pipeline).
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
import Titlebar from "$lib/components/Titlebar.svelte";
|
||||
import ToastViewport from "$lib/components/ToastViewport.svelte";
|
||||
import ResizeHandles from "$lib/components/ResizeHandles.svelte";
|
||||
import FocusTimer from "$lib/components/FocusTimer.svelte";
|
||||
import { hasTauriRuntime } from "$lib/utils/runtime.js";
|
||||
import { loadOsInfo, isLinux } from "$lib/utils/osInfo.js";
|
||||
import { page, settings, saveSettings } from "$lib/stores/page.svelte.js";
|
||||
@@ -396,6 +397,13 @@
|
||||
in the bottom-right of the viewport. (Day 3 of the upgrade plan) -->
|
||||
<ToastViewport />
|
||||
|
||||
<!-- Global focus-timer overlay. Renders nothing until a `kon:start-timer`
|
||||
event fires; then pins a shrinking colour ring to the top-right.
|
||||
Phase 1 of the 2026-04-23 feature-complete roadmap — closes the
|
||||
visual-time-representation gap from docs/brief/feature-set.md and
|
||||
wires the dangling emit in MicroSteps.svelte. -->
|
||||
<FocusTimer />
|
||||
|
||||
<!-- Invisible resize margins for frameless (macOS/Windows). On Linux we
|
||||
use native decorations, so ResizeHandles would compete with the
|
||||
compositor's own resize and is suppressed. -->
|
||||
|
||||
Reference in New Issue
Block a user