Skip to content

feat(stack): render stack blocks as nested topology - #37

Closed
aryasaatvik wants to merge 3 commits into
kitlangton:mainfrom
aryasaatvik:feat/nested-stack-widget
Closed

feat(stack): render stack blocks as nested topology#37
aryasaatvik wants to merge 3 commits into
kitlangton:mainfrom
aryasaatvik:feat/nested-stack-widget

Conversation

@aryasaatvik

@aryasaatvikaryasaatvik commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Render managed Stack blocks as nested Markdown lists so the visible widget matches the PR/MR target-branch topology. The block still preserves landed history above the open stack, but open siblings from stale flat blocks are no longer mistaken for history.

Examples

Linear stack with the middle PR current:

-#101`stack-a`-**#102** 👈 current `stack-b`-#103`stack-c`

Forked stack with siblings under the same parent:

-#201`stack-root`-#202`storage`-#204`checks`-#205`agent-tools`-**#203** 👈 current `presets`-#206`docs`

Landed history remains above the open stack:

-#90-#101`stack-a`-**#102** 👈 current `stack-b`

Validation

  • bun run test
  • bun run typecheck
  • bun run lint
  • bun run format:check
  • bun run package:smoke
  • bun src/cli.ts --help
  • bun src/cli.ts sync --help

@hungmuhahungmuha left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — nested-topology rendering is correct across fork/deep/cycle/round-trip cases with solid new test coverage. Two minor nits:

  • nitsrc/stackGraph.ts:195displayChainFor no longer has a production caller after Stack.ts switched to displayTreeFor; only its definition, the interface member, the return-object entry, and StackGraph tests reference it. If not intended as retained API, remove it and its stale tests; otherwise note it is test-only.
  • nitsrc/stackBlock.ts:116line() appends a branch-label suffix in backticks, but completedLines parses the branch key via the first backtick group. With showTitles (GitLab), a PR/MR title containing backticks makes the first group match the title fragment instead of the branch, so the next sync resolves the wrong key and strips the title inline code. Low likelihood/cosmetic, but the round-trip is lossy. Consider anchoring the branch-label match to end-of-line.

@klaemo

Copy link
Copy Markdown

oh this would be lovely

Sign up for freeto 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

@aryasaatvik@klaemo@hungmuha