Add comments feature (bd-162)

- Add comments table to SQLite schema
- Add Comment type to internal/types
- Implement AddIssueComment and GetIssueComments in storage layer
- Update JSONL export/import to include comments
- Add comments to 'bd show' output
- Create 'bd comments' CLI command structure
- Fix UpdateIssueID to update comments table and defer FK checks
- Add GetIssueComments/AddIssueComment to Storage interface

Note: CLI command needs daemon RPC support (tracked in bd-163)
Amp-Thread-ID: https://ampcode.com/threads/T-ece10dd1-cf64-48ff-9adb-dd304d0bcb25
Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
Steve Yegge
2025-10-19 18:28:41 -07:00
parent 34cf361b2b
commit a28d4fe4c7
11 changed files with 320 additions and 4 deletions

View File

@@ -29,6 +29,7 @@ type Issue struct {
OriginalSize int `json:"original_size,omitempty"`
Labels []string `json:"labels,omitempty"` // Populated only for export/import
Dependencies []*Dependency `json:"dependencies,omitempty"` // Populated only for export/import
Comments []*Comment `json:"comments,omitempty"` // Populated only for export/import
}
// Validate checks if the issue has valid field values
@@ -137,6 +138,15 @@ type Label struct {
Label string `json:"label"`
}
// Comment represents a comment on an issue
type Comment struct {
ID int64 `json:"id"`
IssueID string `json:"issue_id"`
Author string `json:"author"`
Text string `json:"text"`
CreatedAt time.Time `json:"created_at"`
}
// Event represents an audit trail entry
type Event struct {
ID int64 `json:"id"`