Render nested section headers with per-level indentation in the TUI - #188
Open
shouze wants to merge 1 commit into
Open
Render nested section headers with per-level indentation in the TUI#188shouze wants to merge 1 commit into
shouze wants to merge 1 commit into
Conversation
shouze
marked this pull request as ready for review
August 23, 2026 20:54
|
Coverage after merging feat/team-hierarchy-tui into feat/team-hierarchy-output will be
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Contributor
There was a problem hiding this comment.
Pull request overview
Adds depth-aware section header rows to the interactive TUI so nested team-hierarchy headings can be rendered (and navigated) with per-level indentation, building on the existing sectionPath diff markers from the hierarchy flattener.
Changes:
- Extend
RowwithsectionLeveland havebuildRowsemit one section row per hierarchical heading transition (while carrying pending headings across filtered-out repos). - Update
renderGroupsto indent section headers by 2 spaces per nesting level and adjust width budgeting to avoid wrapping. - Add unit tests covering hierarchical row emission, ancestor non-repetition, pending heading carryover under filtering, and indentation in rendered output.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/types.ts |
Adds Row.sectionLevel to represent nesting depth for section rows. |
src/render/rows.ts |
Enhances buildRows to emit hierarchical section rows from sectionPath transitions and preserve headings across filters. |
src/render.ts |
Indents section headers by level and updates clipping/width calculations accordingly. |
src/render.test.ts |
Adds test coverage for hierarchical section row emission and indentation rendering behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Row gains sectionLevel (0 for flat groupByTeamPrefix sections, N for groupByTeamHierarchy nesting depth). - buildRows emits one section row per new heading transition in a hierarchical sectionPath, diffed against the last heading actually shown so unchanged ancestors aren't repeated for sibling leaves; a pending heading is still carried across filtered-out repos (mirrors the existing flat sectionLabel behavior). - renderGroups indents each section heading by 2 spaces per level; pick-mode bar and the multi-team hint keep working unchanged at whichever level is a combined section. - Mouse hit-testing (mouse-hit.ts) and row-height accounting (rowTerminalLines, isCursorVisible, normalizeScrollOffset) needed no changes: section row cost/geometry is independent of nesting depth.
shouze
force-pushed
the
feat/team-hierarchy-tui
branch
from
August 24, 2026 00:14
0f7d060 to
2dbdbdc
Compare
|
Coverage after merging feat/team-hierarchy-tui into feat/team-hierarchy-output will be
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 similar comment
|
Coverage after merging feat/team-hierarchy-tui into feat/team-hierarchy-output will be
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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.
Summary
Adds depth-aware rendering and navigation for nested team-hierarchy headings
in the interactive TUI, building on the
sectionPathmarkers introduced in#179.
RowgainssectionLevel(0 for flatgroupByTeamPrefixsections, N forgroupByTeamHierarchynesting depth).buildRowsemits one "section" row per new heading transition in ahierarchical
sectionPath— diffed against the last heading actuallyrendered, so a sibling leaf under an unchanged ancestor doesn't repeat that
ancestor's heading. A pending heading is still carried across filtered-out
repos, mirroring the existing flat
sectionLabelbehavior (and using thesame "pending across skips" pattern already established there).
renderGroupsindents each section heading by 2 spaces per level. Pick-modebar and the multi-team hint (
[p: pick team]) keep working unchanged atwhichever level is a combined section — no changes needed to that logic
itself, just width-budget accounting for the added indent.
mouse-hit.ts) and row-height accounting(
rowTerminalLines,isCursorVisible,normalizeScrollOffset) needed nochanges: a section row's cost/geometry is independent of its nesting depth,
so navigation, scrolling, and clicks work unchanged across depths.
--pick-teamaddressing across hierarchy levels (path-based sectionidentifiers) and CLI wiring are intentionally out of scope here — tracked by
issues #181 and #182.
Closes #180
How to test
bun test src/render.test.ts src/render/mouse-hit.test.tsNew tests cover: one row per
sectionPathentry, no repeated ancestor headingfor sibling leaves, pending heading carried across a filtered-out first repo,
and per-level indentation (0/1/2 levels) in the rendered output.
Validation
bun test(917 pass)bun run lintbun run format:checkbun run knipbun run build.ts