feat(smartlog): Phase 4 — topological DAG ordering + summary header · Refs #308 - #416
Merged
Merged
Conversation
… Refs #308 - Add summary header line: 'smartlog N worktrees · M stacked' giving a quick count before the tree output - Replace alphabetical BTreeMap iteration with topological group ordering via topo_sort_groups(): stacked groups now appear directly below their parent group instead of jumping alphabetically - Multi-level stacks (grandparent → parent → child) are rendered in correct depth order thanks to recursive DFS from root bases - Cycle-safe: a placed HashSet prevents infinite loops in unusual reference loops between worktree branches - Stack group header updated to '○ <branch> ⤷ stacked on <ticket>' for cleaner visual connection to parent - Add 4 new Phase 4 tests covering: summary counts, singular form, topo ordering across lexicographic gap, and multi-level three-deep stacks Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
무엇
parsec smartlog출력 순서와 요약 정보를 개선한다.smartlog N worktrees · M stacked한 줄로 전체 현황 파악placedHashSet으로 비정상 참조 루프에서도 무한 루프 방지○ <branch> ⤷ stacked on <ticket>형식으로 시각적 연결 명확화왜 (이슈 참조)
Refs #308 — smartlog DAG renderer 강화. Phase 1/2/3 이후 마지막 남은 렌더링 개선:
변경
src/cli/commands/smartlog.rs1파일topo_sort_groups()신규 private 함수 (DFS 기반 위상 정렬)render_text(): summary 헤더 추가, BTreeMap 직접 순회 →topo_sort_groups사용다음 Phase 힌트
리스크
low — 순수 렌더링 변경. GitHub API 호출 없음. 기존 struct/CLI surface 무변경.
출력 포맷 변경(요약 헤더 추가, 그룹 순서)이지만 기존 테스트 전부 통과.
롤백
git revert 1f85359— 이전 알파벳 순서 렌더링으로 즉시 복원.Test plan
cargo test -- smartlog: 29 tests pass (기존 25 + Phase 4 신규 4)cargo build+cargo clippy -D warnings+cargo fmt --check: all cleanparsec smartlog --no-overlay→ 요약 헤더 + 트리 정상 출력 확인@erishforG