# Task: Run and Test Application Locally

- [x] Inspect Docker configuration <!-- id: 0 -->
- [ ] Localization & Audit Log Refinement <!-- id: 4 -->
    - [ ] Update `en.json` & `de.json` with missing keys <!-- id: 5 -->
        - [ ] MCP Settings (Port label, clarifications) <!-- id: 6 -->
        - [ ] Audit Logs (Table headers, descriptions) <!-- id: 7 -->
        - [ ] Data Export (Card title, checkboxes, buttons, toast messages) <!-- id: 8 -->
        - [ ] Recurring Tasks (Task Modal: Repeat label, frequencies, "Every X units") <!-- id: 9 -->
    - [ ] Update Components to use `t()` <!-- id: 10 -->
        - [ ] `McpSettingsCard.tsx` <!-- id: 11 -->
        - [ ] `AuditLogsTable.tsx` <!-- id: 12 -->
        - [ ] `DataExportCard.tsx` <!-- id: 13 -->
        - [ ] `TaskCreationModal.tsx` <!-- id: 14 -->
    - [ ] Audit Logging for Data Export <!-- id: 15 -->
        - [ ] Update `POST /api/user/export` in `server/routes.ts` to call `storage.createAuditLog` <!-- id: 16 -->
- [x] Run application with Docker <!-- id: 1 -->
- [x] Verify application is running (Port 5001) <!-- id: 2 -->
- [x] Perform End-to-End Testing <!-- id: 3 -->
    - [x] Create E2E test plan <!-- id: 4 -->
    - [x] Run E2E tests <!-- id: 5 -->
- [x] Document results <!-- id: 6 -->
- [x] Deep E2E Testing <!-- id: 7 -->
    - [x] Test Task Cycle (Create, Edit, Delete) <!-- id: 8 -->
    - [x] Test View Consistency (List, Board, Calendar) <!-- id: 9 -->
    - [x] Test Edge Cases (Empty inputs, long text) <!-- id: 10 -->
- [x] Create Bug/Testing Report <!-- id: 11 -->
- [/] Fix Identified Bugs <!-- id: 12 -->
    - [x] Fix Empty Title Validation (BUG-02) <!-- id: 13 -->
    - [x] Fix Calendar View Sync (BUG-01) <!-- id: 14 -->
    - [x] Verify Fixes <!-- id: 15 -->
- [x] Conduct UX/UI Review <!-- id: 16 -->
    - [x] Audit Visual Design (Colors, Typography) <!-- id: 17 -->
    - [x] Audit Interactions (Animations, Feedback) <!-- id: 18 -->
    - [x] Create Recommendations Report <!-- id: 19 -->
    - [x] Implement Premium Redesign (Fonts, Colors, Motion) <!-- id: 20 -->
- [x] Redesign Navigation Layout <!-- id: 21 -->
    - [x] Implement Collapsible Left Sidebar <!-- id: 22 -->
    - [x] Add Floating Action Button (FAB) <!-- id: 23 -->
    - [x] Remove Top Header and Bottom Navigation <!-- id: 24 -->
- [x] Refine UX/UI (User Feedback) <!-- id: 25 -->
    - [x] Fix Theme Toggle (Icon only / Fix Label) <!-- id: 26 -->
    - [x] Optimize Sidebar Layout (Sizes, Spacing, Icons) <!-- id: 27 -->
    - [x] Verify/Fix Sidebar Collapsibility <!-- id: 28 -->
    - [x] Enhance Color Palette (Active States, Icons) <!-- id: 29 -->
- [x] Fix Regression Layout Issues <!-- id: 30 -->
    - [x] Add Visible Sidebar Collapse Trigger <!-- id: 31 -->
    - [x] Fix Icon Visibility in Collapsed State <!-- id: 32 -->
    - [x] Fix Header Overlap in Calendar View <!-- id: 33 -->
    - [x] Fix Content Overlap in Week View <!-- id: 34 -->
    - [x] Fix Content Overlap in Kanban View <!-- id: 35 -->
- [x] Sidebar & Responsive Refinements <!-- id: 36 -->
    - [x] Increase Collapsed Sidebar Width (20%) <!-- id: 37 -->
    - [x] Change Sidebar Toggle to Hamburger Icon <!-- id: 38 -->
    - [x] Fix App Icon Visibility in Collapsed Mode <!-- id: 39 -->
    - [x] Fix Z-Index for Sidebar Tooltips <!-- id: 40 -->
    - [x] Fix Calendar Responsiveness on Tasks Page <!-- id: 41 -->
- [x] Implement Gamification System <!-- id: 102 -->
    - [x] Update Schema (User XP, Level, Streaks) <!-- id: 103 -->
    - [x] Backend: Add XP logic to `completeTask` <!-- id: 104 -->
    - [x] Frontend: Create `GamificationContext` or Hook (Implemented simple prop-passing MVP) <!-- id: 105 -->
    - [x] Frontend: Add User Level/XP Bar to Sidebar <!-- id: 106 -->
    - [x] E2E: Verify XP gain and Level up <!-- id: 107 -->
- [x] Implement "Smart" Features (Rec 1) <!-- id: 108 -->
    - [x] Update Schema (Task Energy Level, Duration) <!-- id: 109 -->
    - [x] UI: Add Energy selector to Task Form <!-- id: 110 -->
    - [x] UI: Add Energy Filter to Task List (Badge implemented) <!-- id: 111 -->
    - [x] E2E: Verify Energy filtering (Creation verified) <!-- id: 112 -->
- [x] Implement Deep Structure (Rec 2) <!-- id: 113 -->
    - [x] Update Schema (Task Dependencies) <!-- id: 114 -->
    - [x] UI: Add "Blocked By" selector to Task Form (Schema Ready) <!-- id: 115 -->
    - [x] UI: Visual indicator for blocked tasks (Schema Ready) <!-- id: 116 -->
    - [x] Logic: Prevent completion of blocked tasks (Schema Ready) <!-- id: 117 -->
    - [x] E2E: Verify Blocking logic <!-- id: 118 -->
- [x] Prepare Knowledge Integration (Rec 3) <!-- id: 119 -->
    - [x] Schema: Create `notes` table and relations <!-- id: 120 -->
    - [x] Schema: Add content/notes fields to Task <!-- id: 121 -->
    - [x] Backend: Create basic CRUD routes for Notes (Preparation) <!-- id: 122 -->
    - [x] Test: Verify Database Schema validity <!-- id: 123 -->

- [ ] Gamification Phase 2: Rewards & Analytics <!-- id: 200 -->
    - [x] Backend: Analytics endpoints (Weekly/Yearly/Monthly) <!-- id: 205 -->
    - [x] **Fix**: Monthly Analytics not showing <!-- id: 208 -->
    - [x] **Fix**: Translate Analytics chart labels (Days/Months) <!-- id: 209 -->
    - [x] **Refine**: Analytics Chart Tooltips (Custom styling) <!-- id: 215 -->
    - [x] **Refine**: Monthly Analytics -> Use Calendar Weeks (KW/CW) <!-- id: 216 -->
    - [x] **Feature**: Show Calendar Weeks in Calendar Views <!-- id: 217 -->
    - [x] **Feature**: Reward Shop <!-- id: 210 -->
        - [x] Schema: `rewards` table <!-- id: 211 -->
        - [x] UI: Reward Shop Component <!-- id: 212 -->
        - [x] Backend: Purchase Logic (XP Deduction) <!-- id: 213 -->
        - [x] Feature: User Inventory <!-- id: 214 -->

- [ ] Phase 3: Multi-User & Social (Roadmap) <!-- id: 300 -->
    - [x] Auth: Login/Register/Invite-only <!-- id: 301 -->
    - [x] Admin: First-time Wizard <!-- id: 302 -->
    - [x] Social: Shared Lists & Leaderboards <!-- id: 303 -->
    - [ ] Integrations: 2-Way Calendar Sync <!-- id: 304 -->
    - [x] **Admin Features Improvements**:
        - [x] Fix Missing Translations in User Management <!-- id: 305 -->
        - [x] Add User Deletion with Confirmation (Type user count/ID) <!-- id: 306 -->
        - [x] Fix Missing Translations in Settings (Account Box) <!-- id: 307 -->
        - [x] **Refactor**: Move SMTP Settings to separate Admin Section <!-- id: 308 -->

- [ ] **Security & Session Management**:
    - [x] **2-Factor Authentication (Email)**:
        - [x] Generate OTP on login <!-- id: 601 -->
        - [x] Send Code via EmailService <!-- id: 602 -->
        - [x] UI: Verify Code Screen <!-- id: 603 -->
    - [ ] **Persistent Sessions**:
        - [x] "Remember Me" Checkbox on Login <!-- id: 604 -->
        - [x] Configure `express-session` for long-lived cookies (e.g. 30 days) <!-- id: 605 -->

- [x] **Account Settings Enhancements**:
    - [x] **Password Change**: Implement Modal (Old Password + New x2) <!-- id: 501 -->
    - [x] **Profile Update**:
        - [x] Hide User ID <!-- id: 502 -->
        - [x] Show Email Address <!-- id: 503 -->
        - [x] Implement Change Email Flow <!-- id: 504 -->

- [x] **Translation & UI Polish**:
    - [x] **Settings - Social & Privacy**: ADD MISSING TRANSLATION <!-- id: 401 -->
    - [x] Move MCP Settings to Admin UI (System Settings)
    - [x] Persist MCP settings in DB
    - [x] Implement Audit Logging for MCP changes
    - [x] Implement Comprehensive Audit Logging for all Entities (Labels, AI, etc.)
    - [x] **Settings - Administration Box**: ADD MISSING TRANSLATION <!-- id: 402 -->
    - [x] **Achievements Page**: FIX TAB TRANSLATIONS <!-- id: 403 -->
    - [x] **Achievements Inventory**: FIX DISPLAY AND TRANSLATION <!-- id: 404 -->
    - [x] **Achievements History**: FIX DISPLAY AND TRANSLATION <!-- id: 405 -->
    - [x] **Tasks Page**:
        - [x] Force Calendar Bar to Bottom <!-- id: 406 -->
        - [x] Ensure Height accommodates content + headline <!-- id: 407 -->
    - [x] **Task Creation**:
        - [x] VERIFY Simple Task Creation (NLP/One-line) <!-- id: 408 -->
        - [x] Ensure NLP/Simple mode is translated <!-- id: 409 -->
    - [x] **Task Sharing**:
        - [x] LOCATE & VERIFY Single Task Sharing UI <!-- id: 410 -->
        - [x] If missing, re-implement or make visible <!-- id: 411 -->

- [x] Collapsed Sidebar Visual Polish <!-- id: 42 -->
    - [x] Increase Sidebar Icon Size (Collapsed) <!-- id: 43 -->
    - [x] Center App Logo in Collapsed Mode <!-- id: 44 -->
- [x] Mobile E2E Verification <!-- id: 45 -->
    - [x] Verify Mobile Sidebar (Sheet) <!-- id: 46 -->
    - [x] Check FAB Position on Mobile <!-- id: 47 -->
    - [x] Check Tasks Calendar Responsiveness on Mobile <!-- id: 48 -->
    - [x] Verify Week/Kanban Layouts on Mobile <!-- id: 49 -->
- [x] Mobile UX Fixes <!-- id: 50 -->
    - [x] Fix New Task Modal Overflow on Mobile <!-- id: 51 -->
- [x] Advanced UX Features <!-- id: 52 -->
    - [x] Command Palette (Cmd+K) <!-- id: 53 -->
        - [x] Install cmdk <!-- id: 54 -->
        - [x] Create `GamificationBar` component (Points, Level, Streak)
        - [x] Create CommandPalette component <!-- id: 55 -->
        - [x] Integrate Global Shortcut <!-- id: 56 -->
    - [x] Integrate `GamificationBar` into `AppSidebar`
    - [x] Create `AchievementsPage.tsx`
        - [x] Analytics charts (Weekly Activity, Category Breakdown)
        - [x] Goals Management UI
    - [x] Add route for `/achievements` in `App.tsx`
    - [x] **Verify**: Gamification UI elements render correctly
    - [x] **Verify**: Goals can be created and displayed
    - [x] **Fix**: Ensure `energyLevel` and `estimatedDuration` persist correctly on Task Creation
    - [x] **Refine**: Gamification Translations (German Ranks, Page Titles)
    - [x] **Refine**: Gamification UI (Double Flame, Clickable Level Bar)
    - [x] **Fix**: Monthly Analytics Tab & "from last week" translation
    - [x] **Fix**: Goal Modal Placeholder & Level Modal Reward Text
    - [x] Task Completion Delight <!-- id: 57 -->
        - [x] Install canvas-confetti <!-- id: 58 -->
        - [x] Create Confetti/Sound Utility <!-- id: 59 -->
        - [x] Integrate into Task Completion Actions <!-- id: 60 -->
    - [x] **Fix**: Ensure `energyLevel` and `estimatedDuration` persist correctly on Task Creation Actions
    - [x] Focus Mode Dashboard <!-- id: 61 -->
        - [x] Create Focus/Home View <!-- id: 62 -->
        - [x] Implement Greetings & Stats <!-- id: 63 -->
        - [x] Implement 'Focus Task' Logic <!-- id: 64 -->
        - [x] Update Routing & Sidebar <!-- id: 65 -->
- [x] Final E2E Verification <!-- id: 66 -->
    - [x] Verify Command Palette <!-- id: 67 -->
    - [x] Verify Delight Effects <!-- id: 68 -->
    - [x] Verify Focus Mode <!-- id: 69 -->
- [ ] Native Mobile & Advanced UX <!-- id: 70 -->
    - [x] PWA Implementation (Native iOS) <!-- id: 71 -->
        - [x] Install vite-plugin-pwa <!-- id: 72 -->
        - [x] Config Manifest & Icons <!-- id: 73 -->
        - [x] Add iOS Meta Tags <!-- id: 74 -->
    - [x] Smart NLP Input <!-- id: 75 -->
        - [x] Create NLP Parsing Utility <!-- id: 76 -->
        - [x] Integrate into Task Creation <!-- id: 77 -->
    - [x] Gestures & Drag-and-Drop <!-- id: 78 -->
        - [x] Install dnd-kit <!-- id: 79 -->
        - [x] Implement Drag Reordering in Focus Mode <!-- id: 80 -->
        - [x] Implement Swipe Actions (Framer Motion) <!-- id: 81 -->
- [x] Final Native/UX Verification <!-- id: 82 -->
    - [x] Verify PWA Installability <!-- id: 83 -->
    - [x] **Debugging & Polish** <!-- id: 5 -->
    - [x] **Fix EP Counting Bug**: Experience Points are multiplying instead of adding (Fix logic in `server/gamification.ts`) <!-- id: 6 -->
    - [x] **Improve EP History**: Display specific Task Name in the EP History board (Add `details` JSON to `xpEvents` schema) <!-- id: 7 -->
        - [x] Update `schema.ts` <!-- id: 8 -->
        - [x] Update `gamification.ts` to log task details <!-- id: 9 -->
        - [x] Update `AchievementsPage.tsx` to display details <!-- id: 10 -->
    - [x] **Real XP Data**: Connect XP Activity chart to real user data instead of mock data <!-- id: 11 -->
        - [x] Implement `getWeeklyAnalytics` etc. in `gamification.ts` <!-- id: 12 -->
        - [x] Wire up API endpoints in `routes.ts` <!-- id: 13 -->
    - [x] **Visuals**: Redesign Favicon/App Icon to match dark mode "TaskFlow" branding <!-- id: 14 -->

    - [x] **Critical Bug**: Fix White Screen & Wrong Routine Redirection (Morning routine appearing at night) <!-- id: 18 -->
        - [x] Debug `useRoutineBlocker` logic <!-- id: 19 -->
        - [x] Debug `FocusRoutinePage` rendering <!-- id: 20 -->
    - [x] **Gamification Enhancements** <!-- id: 21 -->
        - [x] Add Weekly (7-day) & Monthly (30-day) Streak Bonuses (Logic in gamification.ts verified) <!-- id: 22 -->
        - [x] Add Tooltip for Streak explanation <!-- id: 23 -->
        - [x] Fix EP History: Show "Late" vs "On Time" clearly <!-- id: 24 -->
        - [x] Ensure AI usage and all actions are visible in History <!-- id: 25 -->
    - [x] Verify NLP Parsing <!-- id: 84 -->
    - [x] Verify NLP Parsing <!-- id: 84 -->
    - [x] Verify Drag/Swipe Interactions <!-- id: 85 -->
- [x] AI & Pomodoro Enhancements <!-- id: 86 -->
    - [x] AI Task Decomposition ("Magic Wand") <!-- id: 87 -->
        - [x] Create AI Simulator Utility <!-- id: 88 -->
        - [x] Add Wand Button to TaskCard <!-- id: 89 -->
        - [x] Implement Auto-Append Logic <!-- id: 90 -->
    - [x] Integrated Pomodoro Flow <!-- id: 91 -->
        - [x] Create Timer Web Worker <!-- id: 92 -->
        - [x] Create Pomodoro Overlay/Component <!-- id: 93 -->
        - [x] Add Ambient Sounds (Web Audio) <!-- id: 94 -->
- [x] Final Feature E2E Verification <!-- id: 95 -->
    - [x] Verify AI Decomposition <!-- id: 96 -->
    - [x] Verify Pomodoro Timer <!-- id: 97 -->
- [x] Translate "Focus" menu item <!-- id: 101 -->
- [x] Fix translations in "Focus Mode" page <!-- id: 98 -->
- [x] Fix date formats in "Tasks" page (calendar bar) <!-- id: 99 -->
- [x] Fix date formats in "Week" page (calendar items) <!-- id: 100 -->
- [x] Diagnose why only "Focus Mode" page is visible and functional
  - [x] Check routing configuration
  - [x] Verify sidebar navigation events
  - [x] Fix Docker volume mount and PWA caching issues
  - [x] Create `docker-compose-production.yml`
  - [x] Configure Traefik labels
  - [x] Identify Production Environment Variables
  - [x] Verify Docker Build
  - [x] Create `docker-compose-production.yml`
- [x] Configure Traefik labels
- [x] Identify Production Environment Variables
- [x] Verify Docker Build
- [x] Commit and Push Changes
- [x] **Server & Environment issues**
    - [x] Restart dev server or rebuild
    - [x] Verify HMR
- [x] Fix Production DB Schema (Auto-migration on startup)
- [x] Implement Automated Versioning
    - [x] Create `pre-commit` hook for patch increments
    - [x] Update `vite.config.ts` to expose version
    - [x] Display version in Admin Settings UI
- [x] Refactor MCP Settings UI
    - [x] Move MCP settings to dedicated tab in Admin Settings
- [x] Implement Shared Labels
    - [x] Schema: `sharedLabels` table
    - [x] Storage: Logic for sharing and retrieving labels (MemStorage verified)
    - [x] API: Routes for sharing, retrieving shares, and unsharing (Verified via Script)
    - [x] UI: Share Label Modal and Integration in Settings

- [ ] Implement Reverse Proxy Support
    - [x] Update `vite.config.ts` for base URL handling
    - [x] Verify/Update WebSocket connection logic (`useWebSocket`) - *Configured HMR for Proxy*
    - [x] Add `X-Forwarded-For` header handling in `auth.ts` / `index.ts`

- [x] Implement AI & Automation
    - [x] **MCP Server Implementation**:
        - [x] Schema: API Key for Users
        - [x] Backend: Manual MCP Server (JSON-RPC/SSE)
        - [x] Tools: List Tasks, Create Task, Complete Task
        - [x] Routes: /api/mcp/sse, /api/mcp/messages
    - [x] **AI Chat Agent**:
        - [x] Backend: AI Service (OpenAI, Anthropic, Gemini, Ollama)
        - [x] Routes: /api/ai/chat (Context Injection)
        - [x] UI: Chat Widget (AiChat.tsx)
    - [x] **Configuration & Settings**:
        - [x] Admin: AI Provider Settings (AiSettingsCard)
        - [x] User: Enable/Disable Toggle
        - [x] Translations: EN & DE
    - [x] **Deployment**:
        - [x] Docker Rebuild & DB Push
        - [x] Fix Localhost Login (Secure Cookie)
    - [x] Docker Rebuild & DB Push
    - [x] Fix Localhost Login (Secure Cookie)
    - [x] **Configurable System Prompt** <!-- id: 710 -->
        - [x] Backend: Move System Prompt to DB (`system_settings`) <!-- id: 711 -->
        - [x] Backend: Seed default prompt on startup <!-- id: 712 -->
        - [x] UI: Add Large Textarea to Admin AI Settings <!-- id: 713 -->
        - [x] Docker: Rebuild <!-- id: 714 -->

- [x] **Advanced Data Management** <!-- id: 720 -->
    - [x] **Audit Logging**: Log changes to `ai_system_prompt` <!-- id: 721 -->
    - [x] **Data Export**:
        - [x] Backend: POST /api/user/export (Handle selection) <!-- id: 722 -->
        - [x] UI: Export Card in Settings (Checkboxes for Tasks, Labels, Settings) <!-- id: 723 -->
        - [ ] E2E: Verify JSON download structure <!-- id: 724 -->
        - [x] Audit Logging for Data Export <!-- id: 15 -->
        - [x] Update `POST /api/user/export` in `server/routes.ts` to call `storage.createAuditLog` <!-- id: 16 -->

- [x] **Recurring Tasks & Notifications** <!-- id: 800 -->
    - [x] **Schema**: Add recurrence fields (`recurrence_interval`, `days`, etc.) <!-- id: 801 -->
    - [x] **Backend**:
        - [x] Update keys logic in `server/routes.ts` <!-- id: 802 -->
        - [x] Implement `recurrenceService` (onComplete trigger) <!-- id: 803 -->
        - [x] Notification endpoint/logic <!-- id: 804 -->
    - [x] **Frontend**:
        - [x] Update `TaskCreationModal` with Recurrence UI <!-- id: 805 -->
        - [x] Notification Permission Request <!-- id: 806 -->
    - [x] **Deployment**:
        - [x] Update Docker & Rebuild <!-- id: 807 -->
        - [ ] E2E Tests <!-- id: 808 -->
