diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-01-19 09:11:04 -1000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-01-19 09:11:04 -1000 |
| commit | 2215aaa458b318edb16337ab56cf658117023eb4 (patch) | |
| tree | 73dc62cb8ed385e8ab5d255825b03ffb8845b27e /issues/bug_002_tab_state.md | |
| parent | 791034f1b588bf679f45a0f89168515fcbde66d5 (diff) | |
Implement Unified Quick Add for Tasks tab (Phase 3 Step 8)
Add Quick Add form to create Todoist tasks or Trello cards directly
from the Tasks tab with optional due date support.
Features:
- HandleUnifiedAdd handler with due date parsing
- HandleGetListsOptions for dynamic Trello list loading
- Quick Add form with source toggle (Todoist/Trello)
- Date picker for due dates
- HX-Trigger refresh after successful creation
- Pass boards to tasks-tab template for board selector
Cleanup:
- Remove resolved issue tracking files
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Diffstat (limited to 'issues/bug_002_tab_state.md')
| -rw-r--r-- | issues/bug_002_tab_state.md | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/issues/bug_002_tab_state.md b/issues/bug_002_tab_state.md deleted file mode 100644 index c8c7c09..0000000 --- a/issues/bug_002_tab_state.md +++ /dev/null @@ -1,31 +0,0 @@ -# Bug 002: Tab State Persistence (RESOLVED) - -## Status -**RESOLVED** - -## Description -When a user switches tabs (e.g., to "Notes") and refreshes the page, the dashboard resets to the default "Tasks" tab. This is a poor user experience. The application should respect the `?tab=` query parameter and update the URL when tabs are switched. - -## Root Cause -1. **Server-Side:** `HandleDashboard` does not read the `tab` query parameter or pass it to the template. -2. **Client-Side:** `index.html` hardcodes the initial active tab to "Tasks". -3. **Client-Side:** Tab buttons use `hx-push-url="false"`, so the URL doesn't update on click. - -## Resolution -1. **Model Update:** Added `ActiveTab` field to `DashboardData` struct in `internal/models/types.go`. -2. **Handler Update:** Updated `HandleDashboard` in `internal/handlers/handlers.go` to: - * Read `r.URL.Query().Get("tab")`. - * Validate the tab name (defaulting to "tasks"). - * Set `ActiveTab` in the data passed to the template. -3. **Template Update:** Updated `web/templates/index.html` to: - * Use `{{if eq .ActiveTab "..."}}` to conditionally apply the `tab-button-active` class. - * Set the initial `hx-get` for `#tab-content` to `/tabs/{{.ActiveTab}}`. - * Set `hx-push-url="?tab=..."` on all tab buttons to ensure the URL updates in the browser history. -4. **Client-Side Update:** Updated `web/static/js/app.js` to initialize `currentTab` from the URL query parameter. - -## Verification -* **Automated Test:** Created `internal/handlers/tab_state_test.go` which verifies: - * Default load (`/`) renders "tasks" as active. - * Query param load (`/?tab=notes`) renders "notes" as active. - * All valid tab names are supported. -* **Manual Verification:** Confirmed that clicking tabs updates the URL and refreshing the page preserves the active tab. |
