Skip to content

feat: add public format package for issue rendering#2871

Merged
steveyegge merged 2 commits into
gastownhall:mainfrom
quad341:quad341/format-package
Apr 3, 2026
Merged

feat: add public format package for issue rendering#2871
steveyegge merged 2 commits into
gastownhall:mainfrom
quad341:quad341/format-package

Conversation

@quad341

@quad341 quad341 commented Mar 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Expose issue formatting functions as a public format package. These were previously internal to the bd CLI (cmd/bd/list_format.go). Consumers like gt can now render issue output identically to bd without shelling out.

Public API

  • PrettyIssue(issue) — one-line list format (status icon + ID + priority + title)
  • CompactIssue(issue, labels, blockedBy, blocks, parent) — with annotations
  • LongIssue(issue, labels) — full detail with description
  • DependencyInfo(blockedBy, blocks, parent) — dependency annotation string
  • StatusIcon(status) — raw icon character
  • ListSummary(total, byCounts) — footer with counts

Motivation

gt (gastownhall/gastown#3166) needs to render bead output without shelling out to bd. This package provides the same formatting bd uses internally, ensuring consistent output across both tools.

Tracked as gt-hqvbg.

Test plan

  • go build ./... clean

🤖 Generated with Claude Code

mayor and others added 2 commits March 28, 2026 11:30
Exposes issue formatting functions that were previously internal to the
bd CLI (cmd/bd/list_format.go). Consumers like gt can now render
issue output identically to bd without shelling out.

Public functions:
- PrettyIssue: one-line list format (status icon + ID + priority + title)
- CompactIssue: with assignee, labels, dependency annotations
- LongIssue: full detail with description
- DependencyInfo: "(parent: X, blocked by: Y, blocks: Z)" string
- StatusIcon: raw icon character without styling
- ListSummary: footer with total and status breakdown

Uses internal/ui for consistent styling (colors, muted, icons).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Tests for StatusIcon, DependencyInfo, PrettyIssue (open, epic, closed),
LongIssue (with assignee, labels, description), and ListSummary.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@codecov-commenter

codecov-commenter commented Mar 28, 2026

Copy link
Copy Markdown

❌ 6 Tests Failed:

Tests completed Failed Passed Skipped
5710 6 5704 583
View the top 3 failed test(s) by shortest run time
github.com/steveyegge/beads/cmd/bd::TestCheckBeadGate_InvalidFormat
Stack Traces | 0s run time
=== RUN   TestCheckBeadGate_InvalidFormat
--- FAIL: TestCheckBeadGate_InvalidFormat (0.00s)
github.com/steveyegge/beads/cmd/bd::TestCheckBeadGate_InvalidFormat/empty
Stack Traces | 0s run time
=== RUN   TestCheckBeadGate_InvalidFormat/empty
    gate_test.go:104: reason "cross-rig bead gate \"\" cannot be checked (multi-rig routing removed)" does not contain "invalid await_id format"
--- FAIL: TestCheckBeadGate_InvalidFormat/empty (0.00s)
github.com/steveyegge/beads/cmd/bd::TestCheckBeadGate_InvalidFormat/missing_bead
Stack Traces | 0s run time
=== RUN   TestCheckBeadGate_InvalidFormat/missing_bead
    gate_test.go:104: reason "cross-rig bead gate \"my-project:\" cannot be checked (multi-rig routing removed)" does not contain "await_id missing rig name or bead ID"
--- FAIL: TestCheckBeadGate_InvalidFormat/missing_bead (0.00s)
github.com/steveyegge/beads/cmd/bd::TestCheckBeadGate_InvalidFormat/missing_rig
Stack Traces | 0s run time
=== RUN   TestCheckBeadGate_InvalidFormat/missing_rig
    gate_test.go:104: reason "cross-rig bead gate \":gt-abc\" cannot be checked (multi-rig routing removed)" does not contain "await_id missing rig name"
--- FAIL: TestCheckBeadGate_InvalidFormat/missing_rig (0.00s)
github.com/steveyegge/beads/cmd/bd::TestCheckBeadGate_InvalidFormat/no_colon
Stack Traces | 0s run time
=== RUN   TestCheckBeadGate_InvalidFormat/no_colon
    gate_test.go:104: reason "cross-rig bead gate \"my-project-mp-abc\" cannot be checked (multi-rig routing removed)" does not contain "invalid await_id format"
--- FAIL: TestCheckBeadGate_InvalidFormat/no_colon (0.00s)
github.com/steveyegge/beads/cmd/bd::TestCheckBeadGate_RigNotFound
Stack Traces | 0s run time
=== RUN   TestCheckBeadGate_RigNotFound
    gate_test.go:135: reason should mention not found: "cross-rig bead gate \"nonexistent:some-id\" cannot be checked (multi-rig routing removed)"
--- FAIL: TestCheckBeadGate_RigNotFound (0.00s)

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@steveyegge steveyegge merged commit 4d88e4a into gastownhall:main Apr 3, 2026
28 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants