feat(kon): scaffold hybrid modular workspace
- Cargo workspace with 6 domain crates: core, audio, transcription, ai-formatting, storage, cloud-providers - Minimal Tauri shell (lib.rs + main.rs) with plugin registration - Svelte 5 frontend copied from Ramble v0.2 - All crates compile as empty stubs - App identifier: uk.co.corbel.kon Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
71
src/routes/float/+layout@.svelte
Normal file
71
src/routes/float/+layout@.svelte
Normal file
@@ -0,0 +1,71 @@
|
||||
<script>
|
||||
import "../../app.css";
|
||||
import { onMount, onDestroy } from "svelte";
|
||||
import { listen } from "@tauri-apps/api/event";
|
||||
import { getCurrentWindow } from "@tauri-apps/api/window";
|
||||
import { settings } from "$lib/stores/page.svelte.js";
|
||||
|
||||
let { children } = $props();
|
||||
let glowing = $state(false);
|
||||
let unlistenFocus = null;
|
||||
let quickAddEl = $state(null);
|
||||
|
||||
// Theme application (float window has its own DOM)
|
||||
$effect(() => {
|
||||
const theme = settings.theme;
|
||||
if (theme === "Light") {
|
||||
document.documentElement.classList.add("light");
|
||||
return;
|
||||
}
|
||||
if (theme === "Dark") {
|
||||
document.documentElement.classList.remove("light");
|
||||
return;
|
||||
}
|
||||
// System mode
|
||||
const mq = window.matchMedia("(prefers-color-scheme: light)");
|
||||
const apply = () => document.documentElement.classList.toggle("light", mq.matches);
|
||||
apply();
|
||||
mq.addEventListener("change", apply);
|
||||
return () => mq.removeEventListener("change", apply);
|
||||
});
|
||||
|
||||
// Listen for settings changes from main window
|
||||
if (typeof window !== "undefined") {
|
||||
window.addEventListener("storage", (e) => {
|
||||
if (e.key === "ramble_settings" && e.newValue) {
|
||||
try {
|
||||
Object.assign(settings, JSON.parse(e.newValue));
|
||||
} catch {}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
onMount(async () => {
|
||||
try {
|
||||
unlistenFocus = await listen("task-window-focus", () => {
|
||||
glowing = true;
|
||||
setTimeout(() => { glowing = false; }, 700);
|
||||
// Auto-focus quick-add input
|
||||
const input = document.querySelector("[data-quick-add]");
|
||||
if (input) input.focus();
|
||||
});
|
||||
} catch {}
|
||||
});
|
||||
|
||||
onDestroy(() => {
|
||||
if (unlistenFocus) unlistenFocus();
|
||||
});
|
||||
|
||||
// Escape to close
|
||||
function handleKeydown(e) {
|
||||
if (e.key === "Escape") {
|
||||
getCurrentWindow().close();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<svelte:window onkeydown={handleKeydown} />
|
||||
|
||||
<div class="h-screen w-screen overflow-hidden grain rounded-lg border border-border shadow-xl animate-float-enter {glowing ? 'animate-glow-pulse' : ''}">
|
||||
{@render children()}
|
||||
</div>
|
||||
Reference in New Issue
Block a user