summaryrefslogtreecommitdiff
path: root/issues
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-01-13 13:51:30 -1000
committerPeter Stone <thepeterstone@gmail.com>2026-01-13 13:51:30 -1000
commit429476f5ac97f56c7f6a755d6dd565767d31dfb6 (patch)
tree333e4b075c3292336cd073ce71911eebc649b1b2 /issues
parent96a24772c4508cc7d088ee7b7a47c76858490446 (diff)
Implement Glassmorphism Foundation (Phase 2.5)
Visual overhaul with glassmorphism design system: - Gradient background (indigo/purple/pink) - Glass morphic cards with backdrop blur - Rounded pill navigation with glass effect - Enhanced shadows and hover states - Refined scrollbar styling Changes: - Update input.css with glassmorphism components and utilities - Modify index.html navigation to use glass container - Mark Bug 001 as resolved in tracking docs Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Diffstat (limited to 'issues')
-rw-r--r--issues/bug_001_template_rendering.md116
1 files changed, 12 insertions, 104 deletions
diff --git a/issues/bug_001_template_rendering.md b/issues/bug_001_template_rendering.md
index b5b51e7..61a8022 100644
--- a/issues/bug_001_template_rendering.md
+++ b/issues/bug_001_template_rendering.md
@@ -1,109 +1,17 @@
-# Bug Report: Template Rendering Error in Notes Tab
+# Bug 001: Template Error in Notes Tab
-## Description
-The application logs an error when rendering the Notes tab:
-`Error rendering notes tab: template: error-banner.html:2:5: executing "error-banner" at <.Errors>: can't evaluate field Errors in type struct { Notes []models.Note }`
-
-This occurs because the `notes-tab` template (which includes `error-banner`) expects a data structure with an `Errors` field, but `HandleNotes` in `internal/handlers/tabs.go` passes an anonymous struct with only `Notes`.
-
-## Reproduction
-1. Run the application.
-2. Navigate to the Notes tab (or trigger a request to `/tabs/notes`).
-3. Observe the error in the server logs.
-
-## Fix Instructions
-
-### 1. Create a Reproduction Test
-Create a new test file `internal/handlers/tabs_test.go` to reproduce the issue.
-
-```go
-package handlers
-
-import (
- "html/template"
- "net/http"
- "net/http/httptest"
- "testing"
-
- "task-dashboard/internal/models"
- "task-dashboard/internal/store"
-)
-
-func TestHandleNotes_RenderError(t *testing.T) {
- // Setup
- // Note: You might need to mock the store or use a temporary SQLite DB
- // For this specific template error, we can test the template execution directly
- // or mock the store to return empty notes.
-
- // Since setting up the full store with DB is complex for a unit test,
- // let's focus on the data structure passed to the template.
- // However, the handler is coupled to the store.
-
- // A better approach for this specific bug is to verify the fix by ensuring
- // the data struct has the Errors field.
-}
-```
+**Status:** Resolved
+**Severity:** High (Runtime Panic/Error)
+**Component:** Frontend/Handlers
-**Better Approach:**
-Modify `internal/handlers/tabs.go` to use a consistent data structure that includes `Errors`.
-
-### 2. Modify `internal/handlers/tabs.go`
-
-Update the `HandleNotes` function (and others if necessary) to pass a struct that includes `Errors`.
-
-```go
-// Define a shared data structure or use an anonymous one with Errors
-data := struct {
- Notes []models.Note
- Errors []string
-}{
- Notes: notes,
- Errors: nil, // Or populate if there are errors
-}
-```
-
-### 3. Verify
-Run the application and check the logs. The error should disappear.
-
-## Automated Test for Verification
-Since we don't have a full test suite set up yet, we can create a simple test that parses the templates and attempts to execute them with the corrected data structure to ensure compatibility.
-
-Create `internal/handlers/template_test.go`:
-
-```go
-package handlers_test
-
-import (
- "html/template"
- "testing"
- "task-dashboard/internal/models"
-)
+## Description
+The `notes-tab` template attempts to render the `error-banner` partial, which expects an `.Errors` field in the data context. However, the `HandleNotes` handler was passing an anonymous struct containing only `Notes`, causing a template execution error.
-func TestNotesTemplateRendering(t *testing.T) {
- // Parse templates
- tmpl, err := template.ParseGlob("../../web/templates/*.html")
- if err != nil {
- t.Fatalf("Failed to parse templates: %v", err)
- }
- tmpl, err = tmpl.ParseGlob("../../web/templates/partials/*.html")
- if err != nil {
- t.Fatalf("Failed to parse partials: %v", err)
- }
+## Root Cause
+Mismatch between template expectation (`{{.Errors}}`) and handler data structure (`struct { Notes []models.Note }`).
- // Define the data structure we EXPECT to use
- data := struct {
- Notes []models.Note
- Errors []string
- }{
- Notes: []models.Note{},
- Errors: []string{},
- }
+## Fix
+Updated `HandleNotes` in `internal/handlers/tabs.go` to include `Errors []string` in the data struct passed to the template.
- // Execute
- err = tmpl.ExecuteTemplate(io.Discard, "notes-tab", data)
- if err != nil {
- t.Errorf("Failed to render notes-tab with corrected data: %v", err)
- }
-}
-```
-(Note: You'll need to import `io` and adjust paths).
+## Verification
+A reproduction test case `internal/handlers/template_test.go` was created to verify that the `notes-tab` template can be successfully executed with the updated data structure.