Skip to content

feat: collapse large summary file lists behind <details> block#398

Open
drewbailey wants to merge 8 commits into
dag-andersen:mainfrom
drewbailey:db--collapsible-summary
Open

feat: collapse large summary file lists behind <details> block#398
drewbailey wants to merge 8 commits into
dag-andersen:mainfrom
drewbailey:db--collapsible-summary

Conversation

@drewbailey

@drewbailey drewbailey commented Apr 6, 2026

Copy link
Copy Markdown
Contributor

When the total number of changed files exceeds --summary-threshold (default 20), the per-file listing is moved into a collapsible <details> block so the summary yaml block stays compact. Full list remains accessible on click.

Also reminds users that context lines around diffs are already configurable via --line-count / -c (default 7).

When the total number of changed files exceeds --summary-threshold (default 20),
the per-file listing is moved into a collapsible <details> block so the summary
yaml block stays compact. Full list remains accessible on click.

Also reminds users that context lines around diffs are already configurable
via --line-count / -c (default 7).

Signed-off-by: Drew Bailey <drew.bailey@airbnb.com>
@dag-andersen

Copy link
Copy Markdown
Owner

Hey @drewbailey , thanks for this PR!

I found two main problems with the implementation:

  1. HTML output was using the truncated inline summary, but without having a new dedicated summaryDetails section for it. This means when --summary-threshold was low, the full summary was simply not visible in the HTML output at all.
  2. Didn't handle the edge case of low --summary-threshold combined with small --max-diff-length - When both options are used together and the diff budget is tight, the detailed summary section consumed the entire budget, leaving no room for the inline summary or app diffs.

What I changed:

  • HTML output - Added a proper htmlDetailedSummarySection() helper that renders its own <details> block, matching the pattern in markdown. The HTML output now receives both fullSummary and compactSummary from the generator.go.
  • Format-agnostic generator.go - Moved all <details>/markdown wrapping out of generator.go. The generator now returns (fullSummary, compactSummary) and lets markdown.go and html.go handle format-specific rendering.
  • Integration tests - Added branch-9/target-4 (collapsible summary) and branch-9/target-5 (collapsible summary + tight max-diff-length).
    Still a blocker:

I haven't managed to fix problem 2. Check integration-test/branch-9/target-5/output.md. Here we have the classic space problem. Here the problem is "what if there isn't enough space for the collapsed full detailed summary?" 😄 - Same problems over and over again.

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.

2 participants