diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-01-26 16:49:44 -1000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-01-26 16:49:44 -1000 |
| commit | 42a4e32daca13b518e64e5821080ff3d6adf0e39 (patch) | |
| tree | 639c790e25b961ecf51ab6ea75206bc3432f1548 /issues/013-quick-add-shopping-list.md | |
| parent | 8de1b5cb8915ed9a6e32566431d05fafafeb338d (diff) | |
Use configured timezone throughout codebase
- Add config/timezone.go with timezone utilities:
- SetDisplayTimezone(), GetDisplayTimezone()
- Now(), Today() - current time/date in display TZ
- ParseDateInDisplayTZ(), ToDisplayTZ() - parsing helpers
- Initialize timezone at startup in main.go
- Update all datetime logic to use configured timezone:
- handlers/handlers.go - all time.Now() calls
- handlers/timeline.go - date parsing
- handlers/timeline_logic.go - now calculation
- models/atom.go - ComputeUIFields()
- models/timeline.go - ComputeDaySection()
- api/plantoeat.go - meal date parsing
- api/todoist.go - due date parsing
- api/trello.go - due date parsing
This ensures all dates/times display correctly regardless
of server timezone setting.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Diffstat (limited to 'issues/013-quick-add-shopping-list.md')
| -rw-r--r-- | issues/013-quick-add-shopping-list.md | 81 |
1 files changed, 0 insertions, 81 deletions
diff --git a/issues/013-quick-add-shopping-list.md b/issues/013-quick-add-shopping-list.md deleted file mode 100644 index e09ab92..0000000 --- a/issues/013-quick-add-shopping-list.md +++ /dev/null @@ -1,81 +0,0 @@ -# [FEATURE] Quick add for shopping list items - -## Description -Add a quick add interface for shopping list items. - -## User Story -As a user, I want to quickly add items to my shopping list without navigating away. - -## Technical Context -- Requires decision on backend: PlanToEat API vs local SQLite -- May need new table `shopping_items` if local -- Could integrate with modal menu from issue #002 - -## Test Strategy - -### Unit Test (Red) -**File:** `internal/store/sqlite_test.go` - -```go -func TestAddShoppingItem(t *testing.T) { - store := setupTestStore(t) - - err := store.AddShoppingItem(ShoppingItem{ - Name: "Milk", - Quantity: "1 gallon", - }) - - assert.NoError(t, err) - - items, _ := store.GetShoppingItems() - assert.Len(t, items, 1) - assert.Equal(t, "Milk", items[0].Name) -} -``` - -### E2E Test (Red) -Quick-add form submits, item appears in list. - -## Proposed Approach - -1. **Decide backend:** - - Option A: PlanToEat API (if it supports shopping lists) - - Option B: Local SQLite table (simpler, offline-capable) - -2. **Database (if local):** - ```sql - CREATE TABLE shopping_items ( - id INTEGER PRIMARY KEY AUTOINCREMENT, - name TEXT NOT NULL, - quantity TEXT, - checked BOOLEAN DEFAULT 0, - created_at DATETIME DEFAULT CURRENT_TIMESTAMP - ); - ``` - -3. **Handler:** - - `POST /api/shopping/add` — add item - - `GET /api/shopping` — list items - - `PUT /api/shopping/{id}/check` — toggle checked - - `DELETE /api/shopping/{id}` — remove item - -4. **UI:** - - Quick-add form in modal menu (integrate with #002) or meals tab - - Simple input: item name, optional quantity - - List view with checkboxes - -## Affected Components -- `internal/store/sqlite.go` (new table/methods) -- `internal/store/sqlite_test.go` -- `internal/handlers/handlers.go` (new endpoints) -- `web/templates/partials/shopping-list.html` (new) -- Potentially `web/templates/partials/modal-menu.html` (from #002) - -## Definition of Done -- [ ] Can add items via quick-add form -- [ ] Items persisted (API or local) -- [ ] Items displayed in list view -- [ ] Can check/uncheck items -- [ ] Can delete items -- [ ] Unit tests for store operations -- [ ] E2E test for add flow |
