agent: lumotia — v0.1 release-completion run
Closes the code-side v0.1 ship gate. All quality gates green: cargo fmt/clippy/test (~327 tests), npm check (0/0), vitest 13/13, scripts/dogfood-rebrand-drill.sh 8/8. Phase F — first-run onboarding promoted to v0.1 - FirstRunPage with skip-to-main + failure recovery + event recording - Six onboarding commands (record/list/has-completed + lumotia_events) - Storage migration v17 (onboarding_events + lumotia_events tables) UI hardening (in-scope items from v0.1-ui-hardening.md) - StatusPill + PostCaptureCard components, 21st preview entry - Sidebar recording-as-sacred-state (opacity + aria-disabled, reduced-motion) - Settings 6-section regroup + Help section + Activation log + Privacy toggle - Error-state copy sweep (DictationPage + SettingsPage, plain-language) - Global :focus-visible rule, textarea outlines restored - Ctrl+K / Ctrl+, / Escape bindings in +layout LLM resilience - rule_based_extract_tasks (regex-free imperative-verb extractor) + extract_tasks_with_fallback wrapper — task extraction never returns zero - tokio::time::timeout(120s) wraps cleanup/tags/tasks commands Release artefacts - LICENSE (canonical AGPL-3.0), CHANGELOG (Keep-a-Changelog format) - v0.1-release-notes, privacy-and-ai-use, install-warnings, tester-onboarding-kit, tester-acceptance-runbook, code-signing-setup, apple-silicon-rb08-runbook, virtual-audio-setup, v0.1-contrast-audit - Workspace versioning + AGPL spdx; npm exact-pin (10 ranges removed) - AppImage SHA-256 sidecar in build.yml - README v0.1 section + Reporting-issues; canonical repo slug Closure pass — items moved from human-required to code-complete - KI-02 Linux idle inhibit: zbus 5 → org.freedesktop.login1.Manager.Inhibit - KI-03 Windows sleep prevention: SetThreadExecutionState(ES_CONTINUOUS|...) - acquire/release_idle_inhibit Tauri commands, wired in DictationPage - Diagnostic-bundle frontend wire-up (Settings → Help button) - WCAG-AA contrast fix via .btn-filled-text utility (no token changes) - 8 destructive-action sites wrapped in plain-language confirm() guards - KNOWN-ISSUES.md + v0.1-known-limitations.md updated (KI-02/03 fixed) Scripts - pre-tag-verify.sh, tag-day.sh, smoke-linux + driver - parse-diagnostic-bundle.sh, parse-activation-log.py Per-item audit trail: docs/release/v0.1-completion-status.md Remaining: W-01…W-08 (signing certs, hardware probes, smoke matrix, tester recruitment) — see docs/release/v0.1-known-limitations.md.
This commit is contained in:
@@ -5,8 +5,27 @@
|
||||
import { page, settings, saveSettings } from "$lib/stores/page.svelte.js";
|
||||
import UnicodeSpinner from "$lib/components/UnicodeSpinner.svelte";
|
||||
import { toasts } from "$lib/stores/toasts.svelte.js";
|
||||
import { Download, CheckCircle, Sunrise, Moon, Play } from 'lucide-svelte';
|
||||
import { Download, CheckCircle, Sunrise, Moon, Play, Mic } from 'lucide-svelte';
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Onboarding event helpers (best-effort — failures are logged, never blocking)
|
||||
// ---------------------------------------------------------------------------
|
||||
async function recordEvent(event: string, skipped = false, notes: string | null = null) {
|
||||
try {
|
||||
await invoke("record_onboarding_event", {
|
||||
event,
|
||||
version: "0.1.0",
|
||||
skipped,
|
||||
notes,
|
||||
});
|
||||
} catch (err) {
|
||||
console.warn("[onboarding] Could not record event:", event, err);
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Core download state
|
||||
// ---------------------------------------------------------------------------
|
||||
let systemInfo = $state(null);
|
||||
let models = $state([]);
|
||||
let probing = $state(true);
|
||||
@@ -26,13 +45,38 @@
|
||||
return remaining / 60;
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Test-recording step state
|
||||
// ---------------------------------------------------------------------------
|
||||
// We use the documented fallback: a button that defers the real test to the
|
||||
// main UI rather than re-implementing the full DictationPage recording stack
|
||||
// here. The inline recording stack is ~150 lines of DictationPage machinery
|
||||
// (audio capture, chunked transcription, LLM cleanup) — too risky to
|
||||
// duplicate. Fallback is documented per task spec.
|
||||
type TestStep = "idle" | "prompt" | "done_skip";
|
||||
let testStep = $state<TestStep>("idle");
|
||||
|
||||
async function deferTestToMainUi() {
|
||||
await recordEvent("test_recording", true, "deferred_to_main_ui");
|
||||
testStep = "done_skip";
|
||||
setTimeout(() => {
|
||||
advanceToRituals();
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Probe + download
|
||||
// ---------------------------------------------------------------------------
|
||||
async function probe() {
|
||||
probing = true;
|
||||
error = "";
|
||||
try {
|
||||
systemInfo = await invoke("probe_system");
|
||||
models = await invoke("rank_models");
|
||||
await recordEvent("permissions_granted");
|
||||
probing = false;
|
||||
} catch (e) {
|
||||
error = `Hardware probe failed: ${e}`;
|
||||
error = `Hardware probe failed. This usually means a missing system library or a permission issue.\n\nDetail: ${e}`;
|
||||
probing = false;
|
||||
}
|
||||
}
|
||||
@@ -42,12 +86,12 @@
|
||||
downloadingModel = modelId;
|
||||
downloadProgress = 0;
|
||||
downloadStartedAt = Date.now();
|
||||
error = "";
|
||||
|
||||
// Tauri unlisten handles must be released on every exit path —
|
||||
// declared outside the try so the finally can always call them,
|
||||
// but assigned inside so a throw on the second listen() doesn't
|
||||
// leak the first one. SettingsPage.svelte:864-880 is the
|
||||
// long-form reference pattern (onMount + onDestroy).
|
||||
// leak the first one.
|
||||
let unlisten: (() => void) | undefined;
|
||||
let unlistenParakeet: (() => void) | undefined;
|
||||
|
||||
@@ -83,19 +127,16 @@
|
||||
settings.engine = "parakeet";
|
||||
}
|
||||
|
||||
await recordEvent("model_ready", false, modelId);
|
||||
|
||||
ready = true;
|
||||
// Brief "Ready" beat, then onto the rituals prompt (or straight
|
||||
// to dictation if the user has already seen it).
|
||||
// Brief "Ready" beat, then onto the test-recording step.
|
||||
setTimeout(() => {
|
||||
if (settings.ritualsPromptSeen) {
|
||||
page.current = "dictation";
|
||||
} else {
|
||||
ready = false;
|
||||
ritualsStep = "morning";
|
||||
}
|
||||
ready = false;
|
||||
testStep = "prompt";
|
||||
}, 1500);
|
||||
} catch (e) {
|
||||
error = `Download failed: ${e}`;
|
||||
error = `The download did not complete. Check your internet connection and try again.\n\nDetail: ${e}`;
|
||||
downloading = false;
|
||||
} finally {
|
||||
// Guard against listen() throwing before assigning the unlisten
|
||||
@@ -106,11 +147,21 @@
|
||||
}
|
||||
}
|
||||
|
||||
// Phase 5: forced-choice rituals + autostart prompts. Research on
|
||||
// libertarian-paternalism nudges (Thaler/Sunstein) says defaults
|
||||
// drive uptake, but the ADHD target audience is sensitive to
|
||||
// parental framing — so we present explicit opt-in with calm copy
|
||||
// rather than defaulting anything on.
|
||||
// ---------------------------------------------------------------------------
|
||||
// After test-recording: advance to rituals or dictation
|
||||
// ---------------------------------------------------------------------------
|
||||
function advanceToRituals() {
|
||||
if (settings.ritualsPromptSeen) {
|
||||
page.current = "dictation";
|
||||
} else {
|
||||
testStep = "idle";
|
||||
ritualsStep = "morning";
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Phase 5: forced-choice rituals + autostart prompts.
|
||||
// ---------------------------------------------------------------------------
|
||||
type RitualsStep = "idle" | "morning" | "evening" | "autostart" | "done";
|
||||
let ritualsStep = $state<RitualsStep>("idle");
|
||||
let autostartApplying = $state(false);
|
||||
@@ -147,27 +198,35 @@
|
||||
settings.ritualsPromptSeen = true;
|
||||
saveSettings();
|
||||
ritualsStep = "done";
|
||||
await recordEvent("completed", false, settings.modelSize ?? null);
|
||||
setTimeout(() => { page.current = "dictation"; }, 900);
|
||||
}
|
||||
}
|
||||
|
||||
function skipRituals() {
|
||||
async function skipRituals() {
|
||||
settings.ritualsPromptSeen = true;
|
||||
saveSettings();
|
||||
await recordEvent("completed", false, settings.modelSize ?? null);
|
||||
page.current = "dictation";
|
||||
}
|
||||
|
||||
function skipSetup() {
|
||||
async function skipSetup() {
|
||||
// Skipping model download still marks the rituals prompt as seen —
|
||||
// the user chose to bypass the walk-through; they can find rituals
|
||||
// in Settings when they're ready.
|
||||
settings.ritualsPromptSeen = true;
|
||||
saveSettings();
|
||||
await recordEvent("skipped", true, "skipped_from_model_select");
|
||||
page.current = "dictation";
|
||||
}
|
||||
|
||||
// Start probing on mount
|
||||
probe();
|
||||
// ---------------------------------------------------------------------------
|
||||
// Mount: fire "started" event + kick off hardware probe
|
||||
// ---------------------------------------------------------------------------
|
||||
$effect(() => {
|
||||
recordEvent("started");
|
||||
probe();
|
||||
});
|
||||
</script>
|
||||
|
||||
<div class="flex flex-col items-center justify-center h-full px-8 py-12 max-w-xl mx-auto">
|
||||
@@ -182,7 +241,44 @@
|
||||
<div class="text-center">
|
||||
<CheckCircle size={40} strokeWidth={1.5} class="text-success mx-auto" />
|
||||
<h2 class="text-xl font-medium text-text mt-4">Ready to go</h2>
|
||||
<p class="text-sm text-text-secondary mt-2">A few quick choices, then you're in.</p>
|
||||
<p class="text-sm text-text-secondary mt-2">Let's make sure everything works.</p>
|
||||
</div>
|
||||
|
||||
{:else if testStep === "prompt"}
|
||||
<!-- Sub-task 4: pre-supplied test-recording prompt (fallback path) -->
|
||||
<div class="w-full max-w-md mx-auto text-center">
|
||||
<Mic size={32} strokeWidth={1.5} class="text-accent mx-auto mb-3" />
|
||||
<h2 class="text-xl font-medium text-text">Try a test recording</h2>
|
||||
<p class="text-sm text-text-secondary mt-3 leading-relaxed">
|
||||
Read this sentence aloud so we can confirm your microphone and the transcription are working.
|
||||
</p>
|
||||
<blockquote class="mt-4 px-4 py-3 rounded-lg bg-bg-input border-l-4 border-accent text-left">
|
||||
<p class="text-sm text-text italic leading-relaxed">
|
||||
"Today is a good day to test my microphone and see how the transcription looks."
|
||||
</p>
|
||||
</blockquote>
|
||||
<p class="text-xs text-text-tertiary mt-3 leading-relaxed">
|
||||
The main dictation screen is just a button press away. Try your first real recording there — it's the same experience you'll use every day.
|
||||
</p>
|
||||
<div class="flex items-center justify-center gap-3 mt-6">
|
||||
<button
|
||||
class="px-4 py-2 rounded-lg text-sm bg-accent btn-filled-text hover:bg-accent-hover"
|
||||
style="transition-duration: var(--duration-ui)"
|
||||
onclick={deferTestToMainUi}
|
||||
>Open the main app and try recording there</button>
|
||||
</div>
|
||||
<button
|
||||
class="mt-5 text-xs text-text-tertiary hover:text-text-secondary underline"
|
||||
style="transition-duration: var(--duration-ui)"
|
||||
onclick={skipRituals}
|
||||
>Skip and go straight to the app</button>
|
||||
</div>
|
||||
|
||||
{:else if testStep === "done_skip"}
|
||||
<div class="text-center">
|
||||
<CheckCircle size={40} strokeWidth={1.5} class="text-success mx-auto" />
|
||||
<h2 class="text-xl font-medium text-text mt-4">Almost there</h2>
|
||||
<p class="text-sm text-text-secondary mt-2">Taking you to the app now.</p>
|
||||
</div>
|
||||
|
||||
{:else if ritualsStep === "morning"}
|
||||
@@ -199,7 +295,7 @@
|
||||
onclick={() => answerMorning(false)}
|
||||
>No thanks</button>
|
||||
<button
|
||||
class="px-4 py-2 rounded-lg text-sm bg-accent text-white hover:bg-accent-hover"
|
||||
class="px-4 py-2 rounded-lg text-sm bg-accent btn-filled-text hover:bg-accent-hover"
|
||||
onclick={() => answerMorning(true)}
|
||||
>Yes, turn it on</button>
|
||||
</div>
|
||||
@@ -223,7 +319,7 @@
|
||||
onclick={() => answerEvening(false)}
|
||||
>No thanks</button>
|
||||
<button
|
||||
class="px-4 py-2 rounded-lg text-sm bg-accent text-white hover:bg-accent-hover"
|
||||
class="px-4 py-2 rounded-lg text-sm bg-accent btn-filled-text hover:bg-accent-hover"
|
||||
onclick={() => answerEvening(true)}
|
||||
>Yes, turn it on</button>
|
||||
</div>
|
||||
@@ -280,12 +376,29 @@
|
||||
</div>
|
||||
|
||||
{:else}
|
||||
<!-- Model selection + error recovery -->
|
||||
<div class="w-full">
|
||||
<h2 class="text-2xl font-medium text-text text-center">Welcome to Lumotia</h2>
|
||||
<p class="text-sm text-text-secondary text-center mt-2">Press the button. Start talking. That's it.</p>
|
||||
|
||||
{#if error}
|
||||
<div class="mt-4 p-3 rounded-lg bg-danger/10 text-danger text-sm">{error}</div>
|
||||
<!-- Sub-task 5: failure recovery — plain-English error + Try again / Skip -->
|
||||
<div class="mt-4 p-3 rounded-lg bg-danger/10 border border-danger/20">
|
||||
<p class="text-sm text-danger font-medium mb-1">Something went wrong</p>
|
||||
<p class="text-xs text-danger/80 whitespace-pre-line leading-relaxed">{error}</p>
|
||||
<div class="flex gap-2 mt-3">
|
||||
<button
|
||||
class="px-3 py-1.5 rounded-md text-xs bg-danger btn-filled-text hover:bg-danger/80"
|
||||
style="transition-duration: var(--duration-ui)"
|
||||
onclick={() => { error = ""; probe(); }}
|
||||
>Try again</button>
|
||||
<button
|
||||
class="px-3 py-1.5 rounded-md text-xs border border-danger/40 text-danger hover:bg-danger/10"
|
||||
style="transition-duration: var(--duration-ui)"
|
||||
onclick={skipSetup}
|
||||
>Skip this step</button>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{#if systemInfo}
|
||||
|
||||
Reference in New Issue
Block a user