Commit graph

6 commits

Author SHA1 Message Date
Kevin Glynn
a028506ec6
fix(graph): merge components for bd graph --all --html (GH#3592) (#3648)
Merged after maintainer review for release prep. CI was green and PR was approved.
2026-05-02 14:02:24 -07:00
maphew
de7cb335b8 fix(graph): lift children to parent's layer in graph layout (GH#1748)
Children of an epic were placed in Layer 0 (no blocking deps) even when
their parent epic was in a higher layer due to blockers. This made the
graph misleading — children appeared "ready" while the parent was blocked.

After computing layers from blocking deps, a post-processing step now
lifts children to at least their parent's layer via parent-child deps.
Children with their own blocking deps that put them higher are unaffected.

Iterates until stable to handle nested parent-child hierarchies.

Amp-Thread-ID: https://ampcode.com/threads/T-019ca756-6480-7088-86a2-0d20013e61c7
Co-authored-by: Amp <amp@ampcode.com>
2026-02-28 20:04:07 -07:00
beads/crew/lizzy
2bb827facb style: run gofmt across entire codebase (bd-nmk12)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 19:35:20 -08:00
Steve Yegge
3d8cf15418 fix(graph): pass subgraph to renderGraph to fix nil pointer crash
The renderGraph function was being called with nil instead of the
loaded subgraph, causing a nil pointer dereference in
computeDependencyCounts when iterating over subgraph.Dependencies.

Changes:
- Pass subgraph variable to renderGraph instead of nil
- Add defensive nil check in computeDependencyCounts
- Add test case for nil subgraph handling

Fixes GH#657

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 01:59:31 -08:00
Charles P. Cross
77d8a995e8
feat(graph): use subgraph to display dependency counts
Restore the subgraph parameter in renderGraph (previously marked as
unused with _) and use it to display meaningful dependency information:

- Add computeDependencyCounts() to calculate blocks/blocked-by counts
- Add renderNodeBoxWithDeps() to render nodes with dependency info
- Show "blocks:N" when an issue blocks N other issues
- Show "needs:N" when an issue depends on N other issues
- Add dependency summary showing total blocking relationships

This makes the graph visualization more informative by showing how
issues relate to each other in the dependency chain.

Tests added:
- TestComputeDependencyCounts: verifies dependency counting logic
- TestRenderNodeBoxWithDeps: verifies box rendering with dep info

Co-authored-by: Charles P. Cross <cpdata@users.noreply.github.com>
2025-12-18 20:35:00 -08:00
Charles P. Cross
5316559cf6
test(graph): add tests for graph utility functions
Add comprehensive tests for the new graph.go functions to meet
coverage threshold after rebase introduced 405 new lines:

- TestTruncateTitle: tests rune-safe title truncation
- TestPadRight: tests rune-safe string padding
- TestRenderNodeBox: tests ASCII box rendering for all status types
- TestComputeLayout: tests topological layout computation with
  dependencies

These tests cover the pure utility functions and basic graph layout
logic, bringing coverage from 44.7% to 45.1%.
2025-12-18 17:56:24 -05:00