feat: Implement core frontend application with task management, user selection, and a collapsible sidebar.

This commit is contained in:
2026-03-07 22:18:36 -05:00
parent 2bee7dce43
commit e661e15bbf
7 changed files with 189 additions and 70 deletions

View File

@@ -156,7 +156,38 @@ frontend/src/
└── app.css # +sidebar theme tokens
```
## 5. Summary
## 5. Changelog
### 2026-03-07 — API Refactoring & UI Improvements
**Backend Refactoring:**
- Split monolithic `manage.cpp` and `utils.cpp` into single-responsibility files per endpoint (e.g., `list.cpp`, `add.cpp`, `remove.cpp`)
- Renamed `seed.cpp``store.cpp` in both `api/users/` and `api/tasks/` (better name for the data-store layer)
- Introduced `store.hpp` forward-declaration headers to resolve cross-domain dependencies (tasks needs `find_user`, users/remove needs `remove_tasks_for_user`)
- Added `unity.cpp` per domain to simplify `http_server.cpp` includes
- `.hpp` files contain structs and constants only; all functions live in `.cpp` files
**Frontend OTA Bug Fix:**
- Fixed `main.cpp` factory-partition check that unconditionally reset `www_part` to 0 on every boot, preventing OTA from ever switching to `www_1`
- Now only defaults to `www_0` on first boot (NVS key not found); OTA-written values are respected
**Date/Time Picker UX:**
- Fixed timezone drift bug: `formatDateForInput` used `toISOString()` (UTC) but `datetime-local` inputs use local time, causing ±N hours shift on each edit
- Split `datetime-local` into separate `date` + `time` inputs with labels
- Default date/time set to "now" when opening the add task form
- CSS trick to make Chrome/Edge open the picker on click anywhere in the input (`::-webkit-calendar-picker-indicator` stretched to fill)
**Dashboard Layout:**
- Moved "Upcoming Tasks" section above the system info grid (content-first, debug tools lower)
**Sidebar:**
- Auto-collapses on mobile (viewport ≤ 768px) via `window.innerWidth` check at init
**Build Warnings Fixed:**
- `<button>` inside `<button>` nesting in UserManager → changed user chips to `<div role="button">`
- `autofocus` a11y warnings suppressed with `<!-- svelte-ignore -->` comments
## 6. Summary
We implement a **temporary in-memory todo list** using **static BSS arrays** on the ESP32 backend, exposed via a **RESTful API** with 8 new endpoints. The frontend gains a **collapsible sidebar** for navigation between the existing Dashboard and a new **Task Manager** view. **Seed data** is populated on every boot for fast development iteration. The architecture is designed to make the eventual migration to **SQLite on SD card** straightforward — the API contracts and frontend components remain unchanged; only the storage layer swaps out.