summaryrefslogtreecommitdiff
path: root/PHASE_2_SURGICAL_PLAN.md
diff options
context:
space:
mode:
Diffstat (limited to 'PHASE_2_SURGICAL_PLAN.md')
-rw-r--r--PHASE_2_SURGICAL_PLAN.md114
1 files changed, 114 insertions, 0 deletions
diff --git a/PHASE_2_SURGICAL_PLAN.md b/PHASE_2_SURGICAL_PLAN.md
new file mode 100644
index 0000000..dbac3a6
--- /dev/null
+++ b/PHASE_2_SURGICAL_PLAN.md
@@ -0,0 +1,114 @@
+# Phase 2: The Productivity OS (Interactive & Refined)
+
+This phase transforms the dashboard into a primary interface with write capabilities, smart sorting, and a refined "Glassmorphism" UI.
+
+## 1. The Unified Atom Model
+**Status:** [ ] Pending
+
+```text
+Define `models.Atom` to abstract over Trello, Todoist, Obsidian, and PlanToEat.
+Implement mapper functions.
+
+1. **Model:** Create `internal/models/atom.go` with:
+ - AtomSource enum (trello, todoist, obsidian, plantoeat)
+ - AtomType enum (task, note, meal)
+ - Atom struct with normalized fields (ID, Title, Description, DueDate, Priority, etc.)
+ - UI helper fields (SourceIcon, ColorClass)
+ - Raw field for preserving original data
+2. **Mappers:** Implement converter functions:
+ - TaskToAtom(Task) -> Atom
+ - CardToAtom(Card) -> Atom
+ - NoteToAtom(Note) -> Atom
+ - MealToAtom(Meal) -> Atom
+3. **Priority Mapping:** Normalize priority scales to 1-4 (Low to Urgent)
+4. **Color Mapping:** Assign brand colors (Trello=Blue, Todoist=Red, Obsidian=Purple, PlanToEat=Green)
+```
+
+## 2. Information Architecture: The 4-Tab Split
+**Status:** [ ] Pending
+
+```text
+Refactor the frontend and router to support 4 distinct tabs.
+
+1. **Templates:** Update `web/templates/index.html` navigation to:
+ - Tasks (Todoist + Due Trello)
+ - Planning (Trello Boards)
+ - Notes (Obsidian)
+ - Meals (PlanToEat)
+2. **Handlers:** Create/Update handlers in `internal/handlers/tabs.go` (new file):
+ - `HandleTasksTab`: Aggregates Todoist + Trello cards with due dates.
+ - `HandlePlanningTab`: Returns Trello boards (excluding cards shown in Tasks?).
+ - `HandleMealsTab`: Returns PlanToEat data.
+3. **Router:** Register new routes `/tabs/tasks`, `/tabs/planning`, `/tabs/meals`.
+```
+
+## 3. Trello: Smart Sorting & Logic
+**Status:** [ ] Pending
+
+```text
+Enhance Trello sorting in `internal/api/trello.go` and `internal/store/sqlite.go`.
+
+1. **Backend:** Update `GetBoardsWithCards` to sort by:
+ - Primary: Has active cards?
+ - Secondary: Newest card modification date (requires parsing Trello ID hex timestamp).
+ - Tertiary: Number of cards.
+2. **Store:** Update SQL query in `GetBoards` to reflect this sort order.
+```
+
+## 4. Todoist: "Due First" Sorting
+**Status:** [ ] Pending
+
+```text
+Ensure Todoist tasks are sorted by urgency.
+
+1. **Store:** Edit `internal/store/sqlite.go` -> `GetTasks`.
+2. **Query:** Update ORDER BY clause:
+ - `CASE WHEN due_date IS NULL THEN 1 ELSE 0 END` (Due dates first)
+ - `due_date ASC` (Earliest first)
+ - `priority DESC` (High priority next)
+```
+
+## 5. Obsidian: Search & Categorization
+**Status:** [ ] Pending
+
+```text
+Enhance Obsidian to support search and categorization.
+
+1. **Backend:** Edit `internal/api/obsidian.go`.
+ - Add `SearchNotes(query string)`.
+ - Add logic to group notes by tags (e.g., #planning, #task, #meal).
+2. **Frontend:** Add a Search Bar to the Notes tab.
+ - HTMX trigger: `hx-get="/tabs/notes/search" hx-trigger="keyup changed delay:500ms"`.
+```
+
+## 6. Visual Overhaul: "Muted Landscape"
+**Status:** [ ] Pending
+
+```text
+Apply the new visual design.
+
+1. **CSS:** Update Tailwind config for "muted" palette.
+2. **Layout:** Add a full-screen background image container.
+3. **Components:** Update cards to use `bg-white/80 backdrop-blur-md` (Glassmorphism).
+```
+
+## 7. Write Operations (The "Primary Interface" Goal)
+**Status:** [ ] Pending
+
+```text
+Implement the interactive features.
+
+1. **Trello:** Implement `UpdateCard` (Archive) and "Mark Complete" button.
+2. **Obsidian:** Implement `CreateNote` (Quick Capture) and "New Note" form.
+```
+
+## 8. Mobile PWA
+**Status:** [ ] Pending
+
+```text
+Make it installable.
+
+1. Create `web/static/manifest.json`.
+2. Add icons.
+3. Link manifest in `index.html`.
+```