Add daemon support for label commands and populate labels in issue queries

- Updated label CLI commands to support both daemon and direct modes
- Added label fetching to GetIssue() and scanIssues() methods
- All label operations (add, remove, list, list-all) work with daemon
- Closed bd-162 (label CLI commands), bd-166 (duplicate), bd-141 (daemon support)

Amp-Thread-ID: https://ampcode.com/threads/T-4858f62e-ad06-4cc7-ad05-17ee76861f86
Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
Steve Yegge
2025-10-19 21:14:23 -07:00
parent 8a48b599ae
commit c3023cd5f7
6 changed files with 284 additions and 190 deletions

View File

@@ -925,6 +925,13 @@ func (s *SQLiteStorage) GetIssue(ctx context.Context, id string) (*types.Issue,
issue.OriginalSize = int(originalSize.Int64)
}
// Fetch labels for this issue
labels, err := s.GetLabels(ctx, issue.ID)
if err != nil {
return nil, fmt.Errorf("failed to get labels: %w", err)
}
issue.Labels = labels
return &issue, nil
}
@@ -1693,7 +1700,7 @@ func (s *SQLiteStorage) SearchIssues(ctx context.Context, query string, filter t
}
defer rows.Close()
return scanIssues(rows)
return s.scanIssues(ctx, rows)
}
// SetConfig sets a configuration value