3.2 KiB
3.2 KiB
Aether Frontend Agent Context: Gemini CLI Standard
Role: Aether App Orchestrator (SvelteKit Frontend) Location: GEMINI.md (Project Root)
🚨 MANDATORY PROTOCOL
You must follow the safety, testing, and coordination standards defined in:
documentation/GUIDE__DEVELOPMENT.md
🏗️ Technical Domain: Aether Frontend
Stack & UI Standards
- Framework: SvelteKit v2 + Svelte 5 (Runes)
- Styling: Tailwind 4 + Skeleton UI + Skeleton V3 (SkeletonNext)
- Local Cache: Dexie.js (IndexedDB)
- Icons: Standardizing on Lucide-Svelte. Avoid legacy Font-Awesome where possible.
Reactivity Patterns (The "Aether Way")
- Svelte 5 Runes: Use
$state,$derived, and$effect. - Navigation Shield: Use SvelteKit's
page.urlsearchParams as the single source of truth for navigation-driven selection. Sync to global stores only viauntrack()within effects. - Side-Effect Purge: Keep
liveQueryobservables pure. Do NOT update global stores ($events_slct) inside derived observables to prevent infinite reactivity loops. - Dexie LiveQuery: Use the
$prefix (e.g.,$lq__obj) consistently. Results fromliveQueryare observables. - Initialization: Always initialize reactive state (
$state) outside of$props()destructuring.
Performance & Data
- SWR (Stale-While-Revalidate): Never block SvelteKit
loadfunctions with API calls for cached data. Let the UI render instantly from IndexedDB and update reactively. - Triple-ID Pattern: Map
id,[obj_type]_id, and[obj_type]_id_randomconsistently. - ID Vision: The backend uses String IDs. Primary keys should use
_idorid(String) mapping to backendid_random.
🧠 Recent Strategy & Patterns
- Safe Handover (Native): Rename
.tmpto.fileONLY after SHA-256 verification in Electron. - Envelopes: API helpers automatically handle the
{data: ...}envelope returned by the backend. - Bootstrap Paradox: Use unauthenticated bypass (
x-no-account-id: "Nothing to See Here") for initial site/domain lookups. - Sev-1 Incident Recovery (2026-02-13): Purged redundant/misplaced headers (
x-aether-api-token,Access-Control-Allow-Origin). Unified all CRUD helpers to standard/v3/crud/...paths. - Account ID Scavenging: Core fetch helpers now proactively read
account_idfromlocalStorage(ae_loc) if missing from config. This is the mandatory fix for Svelte 5 hydration race conditions whereonMounttriggers API calls before global stores are synced. - V3 Event File Mapping (2026-02-19): Mapped prefixed backend fields (
hosted_file_hash_sha256,hosted_file_size) to flat properties (hash_sha256,file_size) in the data layer. Requiredinc_hosted_file=truequery param for full metadata retrieval. - Launcher Location Discovery: Resolved missing locations in room select by ensuring
load_ae_obj_li__event_locationrequestshidden: 'all'during background sync and initial load.
🤝 Coordination & Continuity
- Handshake: Use the
messagetool to notify the Backend Agent of UI/Data requirements. - Active Tasks: Track your progress in
documentation/AGENT_TODO.md. - Reference: See
README.mdfor build/deploy steps andTODO.mdfor project milestones.