# [DEF:Std:UI_Svelte:Standard] # @TIER: CRITICAL # @PURPOSE: Unification of all Svelte components following GRACE-Poly (UX Edition). # @LAYER: UI # @INVARIANT: Every component MUST have `` anchors and UX tags. # @INVARIANT: Use Tailwind CSS for all styling (no custom CSS without justification). ## 1. UX PHILOSOPHY: RESOURCE-CENTRIC * **Definition:** Navigation and actions revolve around Resources (Dashboards, Datasets), not Tools (Migration, Git). * **Discovery:** All actions (Migrate, Backup, Git) for a resource MUST be grouped together (e.g., in a dropdown menu). * **Traceability:** Every action must be linked to a Task ID with visible logs in the Task Drawer. ## 2. COMPONENT ARCHITECTURE: GLOBAL TASK DRAWER * **Role:** A single, persistent slide-out panel (`GlobalTaskDrawer.svelte`) in `+layout.svelte`. * **Triggering:** Opens automatically when a task starts or when a user clicks a status badge. * **Interaction:** Interactive elements (Password prompts, Mapping tables) MUST be rendered INSIDE the Drawer, not as center-screen modals. ## 3. COMPONENT STRUCTURE & CORE RULES * **Styling:** Tailwind CSS utility classes are MANDATORY. Minimize scoped ` ``` ## 2. STATE MANAGEMENT & STORES * **Subscription:** Use `$` prefix for reactive store access (e.g., `$sidebarStore`). * **Data Flow:** Mark store interactions in `[DEF:]` metadata: * `# @RELATION: BINDS_TO -> store_id` ## 3. UI/UX BEST PRACTICES * **Transitions:** Use Svelte built-in transitions for UI state changes. * **Feedback:** Always provide visual feedback for async actions (Loading spinners, skeleton loaders). * **Modularity:** Break down components into "Atoms" (Trivial) and "Orchestrators" (Critical). ## 4. ACCESSIBILITY (A11Y) * Ensure proper ARIA roles and keyboard navigation for interactive elements. * Use semantic HTML tags (`