From 764d4d2d07449aec72c87afe941b7c63ea05e08c Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Sat, 21 Mar 2026 21:24:02 +0000 Subject: feat: Phase 1 — remove bug feature and dead code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Delete Bug struct, BugToAtom, SourceBug, TypeBug, TypeNote - Remove bug store methods (SaveBug, GetBugs, ResolveBug, etc.) - Remove HandleGetBugs, HandleReportBug, bug branches in handlers - Remove bug routes, bugs.html template, bug UI from index.html - Remove AddMealToPlanner stub + interface method - Migration 018: DROP TABLE IF EXISTS bugs Co-Authored-By: Claude Sonnet 4.6 --- internal/models/atom.go | 24 ------------------------ internal/models/atom_test.go | 30 ------------------------------ internal/models/types.go | 8 -------- 3 files changed, 62 deletions(-) (limited to 'internal/models') diff --git a/internal/models/atom.go b/internal/models/atom.go index 3804de4..9c519ba 100644 --- a/internal/models/atom.go +++ b/internal/models/atom.go @@ -1,7 +1,6 @@ package models import ( - "fmt" "time" "task-dashboard/internal/config" @@ -13,16 +12,13 @@ const ( SourceTrello AtomSource = "trello" SourceTodoist AtomSource = "todoist" SourceMeal AtomSource = "plantoeat" - SourceBug AtomSource = "bug" ) type AtomType string const ( TypeTask AtomType = "task" - TypeNote AtomType = "note" TypeMeal AtomType = "meal" - TypeBug AtomType = "bug" ) // Atom represents a unified unit of work or information @@ -147,23 +143,3 @@ func MealToAtom(m Meal) Atom { } } -// BugToAtom converts a Bug to an Atom -func BugToAtom(b Bug) Atom { - // Bugs get high priority (3) to encourage fixing - priority := 3 - - return Atom{ - ID: fmt.Sprintf("bug-%d", b.ID), - Title: b.Description, - Description: "Bug Report", - Source: SourceBug, - Type: TypeBug, - URL: "", - DueDate: nil, // Bugs don't have due dates - CreatedAt: b.CreatedAt, - Priority: priority, - SourceIcon: "🐛", - ColorClass: "border-red-700", - Raw: b, - } -} diff --git a/internal/models/atom_test.go b/internal/models/atom_test.go index 537d232..3ed4774 100644 --- a/internal/models/atom_test.go +++ b/internal/models/atom_test.go @@ -123,36 +123,6 @@ func TestMealToAtom(t *testing.T) { } } -func TestBugToAtom(t *testing.T) { - now := time.Now() - bug := Bug{ - ID: 42, - Description: "Something is broken", - CreatedAt: now, - } - - atom := BugToAtom(bug) - - if atom.ID != "bug-42" { - t.Errorf("Expected ID 'bug-42', got '%s'", atom.ID) - } - if atom.Title != "Something is broken" { - t.Errorf("Expected title 'Something is broken', got '%s'", atom.Title) - } - if atom.Source != SourceBug { - t.Errorf("Expected source Bug, got '%s'", atom.Source) - } - if atom.Type != TypeBug { - t.Errorf("Expected type Bug, got '%s'", atom.Type) - } - if atom.Priority != 3 { - t.Errorf("Expected high priority 3, got %d", atom.Priority) - } - if atom.SourceIcon != "🐛" { - t.Error("Expected bug icon") - } -} - func TestAtom_ComputeUIFields(t *testing.T) { // Test nil due date t.Run("nil due date", func(t *testing.T) { diff --git a/internal/models/types.go b/internal/models/types.go index 8ec2095..194eca9 100644 --- a/internal/models/types.go +++ b/internal/models/types.go @@ -159,14 +159,6 @@ type TaskListInfo struct { Name string `json:"name"` } -// Bug represents a bug report -type Bug struct { - ID int64 `json:"id"` - Description string `json:"description"` - CreatedAt time.Time `json:"created_at"` - ResolvedAt *time.Time `json:"resolved_at,omitempty"` -} - // CacheMetadata tracks when data was last fetched type CacheMetadata struct { Key string `json:"key"` -- cgit v1.2.3