Skip to content

feat: add print appendix presets#45

Merged
apstndb merged 7 commits into
mainfrom
issue-43-44-print-presets
May 17, 2026
Merged

feat: add print appendix presets#45
apstndb merged 7 commits into
mainfrom
issue-43-44-print-presets

Conversation

@apstndb
Copy link
Copy Markdown
Owner

@apstndb apstndb commented May 17, 2026

Summary

  • Add intent-based print presets for scalar appendices: basic, enhanced, full, and none.
  • Let ParsePrintSections and rendertree --print accept those presets while preserving comma-separated low-level section names.
  • Add reference.NewPrintSections so config bridges can preserve the nil/default versus explicit-empty distinction for RenderConfig.PrintSections.
  • Document the presets in cmd/rendertree/README.md.

Issue handling

Verification

  • go test ./internal/scalarappendix ./plantree/reference ./cmd/rendertree/impl
  • go test ./...
  • mise x -- golangci-lint run --timeout=5m
  • git diff --check
  • review-router: copilot-gpt-5.4, gemini-3.1-pro-preview, codex-gpt-5.4

Copilot AI review requested due to automatic review settings May 17, 2026 13:39
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces intent-based print presets for scalar appendix output (basic, enhanced, full, none) and wires them into the existing print-section parsing used by both the public reference API and the rendertree --print CLI flag, while preserving the nil-vs-explicit-empty RenderConfig.PrintSections semantics via a new helper.

Changes:

  • Add preset names/types and parsing for scalar appendix printing, and allow ParsePrintSections to accept presets in addition to comma-separated section names.
  • Add reference.NewPrintSections to make it easy for config bridges to preserve explicit-empty vs default (nil) behavior.
  • Update tests and CLI/README documentation to cover and describe presets and explicit empty parsing.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
plantree/reference/reference.go Documents how to map preset names into RenderConfig.PrintSections while preserving nil vs explicit-empty semantics.
plantree/reference/reference_test.go Extends parsing tests for presets and enforces non-nil empty slices for explicit empty/preset none; adopts NewPrintSections in config tests.
plantree/reference/appendix.go Exposes PrintPreset, ParsePrintPreset, PrintPreset.Sections, and NewPrintSections; updates ParsePrintSections behavior/docs.
internal/scalarappendix/appendix.go Implements preset parsing/expansion and updates section-list parsing to accept presets.
internal/scalarappendix/appendix_test.go Adds test cases for preset parsing and explicit-empty non-nil behavior.
cmd/rendertree/README.md Documents presets and the --print="" explicit-empty behavior.
cmd/rendertree/impl/impl.go Updates --print flag help text to mention presets.
cmd/rendertree/impl/impl_test.go Adds preset test cases for CLI print-section parsing and enforces non-nil explicit-empty behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/scalarappendix/appendix.go Outdated
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces intent-based presets (basic, enhanced, full, none) for the --print flag in rendertree, simplifying how users select appendix sections. The changes include new Preset types and parsing logic in internal/scalarappendix and plantree/reference, along with updated documentation and tests. Feedback focuses on improving the robustness of the ParseSections parser by consistently handling trimmed input and clarifying the documentation for NewPrintSections to better guide API consumers on error handling and variadic usage.

Comment thread internal/scalarappendix/appendix.go Outdated
Comment thread plantree/reference/reference.go Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.

@apstndb
Copy link
Copy Markdown
Owner Author

apstndb commented May 17, 2026

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces intent-based presets (basic, enhanced, full, none) for the --print flag, simplifying how users select appendix sections in rendertree. The changes include new Preset types, parsing logic, and updated documentation and tests. Feedback suggests improving the robustness of the ParseSections logic to allow mixing presets with individual sections in comma-separated lists. Additionally, it is recommended to ensure all parsing paths pass through the final validation step and to provide better CLI usage guidance when logical errors occur.

Comment thread internal/scalarappendix/appendix.go Outdated
Comment thread internal/scalarappendix/appendix.go Outdated
@apstndb
Copy link
Copy Markdown
Owner Author

apstndb commented May 17, 2026

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces intent-based presets (basic, enhanced, full, none) for the --print flag in rendertree, simplifying how users select appendix sections. It includes updates to the CLI implementation, internal parsing logic, public API in plantree/reference, and comprehensive test coverage. The documentation has also been updated to reflect these changes and clarify that presets cannot be combined with individual section lists. I have no feedback to provide.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Comment thread cmd/rendertree/impl/impl.go Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.

@apstndb
Copy link
Copy Markdown
Owner Author

apstndb commented May 17, 2026

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces intent-based presets—basic, enhanced, full, and none—to the rendertree appendix output, simplifying how users select groups of scalar links and sections. The changes include new parsing logic in the internal/scalarappendix and plantree/reference packages, updated CLI flag defaults, and expanded documentation and test coverage. Review feedback recommends refining the parser to treat empty input strings as an explicit empty state and using the %q verb in error messages to improve clarity and consistency with the existing codebase.

Comment thread internal/scalarappendix/appendix.go Outdated
Comment thread internal/scalarappendix/appendix.go Outdated
@apstndb
Copy link
Copy Markdown
Owner Author

apstndb commented May 17, 2026

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces intent-based presets (basic, enhanced, full, none) for the --print flag, simplifying the selection of appendix sections in rendertree. The changes include updated parsing logic in the scalarappendix and plantree packages to handle these presets and prevent them from being mixed with individual section lists. Feedback from the review focused on improving documentation clarity to explicitly mention that blank input strings are treated as empty lists, ensuring the documentation accurately reflects the implementation's behavior.

Comment thread internal/scalarappendix/appendix.go Outdated
Comment thread plantree/reference/appendix.go Outdated
@apstndb apstndb requested a review from Copilot May 17, 2026 19:29
@apstndb
Copy link
Copy Markdown
Owner Author

apstndb commented May 17, 2026

/gemini review

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces intent-based presets (basic, enhanced, full, none) for the --print flag in rendertree, simplifying the selection of appendix sections. The changes include updates to the documentation, CLI flag defaults, and internal parsing logic in internal/scalarappendix and plantree/reference to support these presets and prevent their combination with individual section lists. Additionally, the PR includes comprehensive test coverage for the new functionality. I have no feedback to provide.

@apstndb apstndb merged commit e50d371 into main May 17, 2026
6 checks passed
@apstndb apstndb deleted the issue-43-44-print-presets branch May 17, 2026 19:41
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.

Clarify explicit empty PrintSections parsing semantics Consider intent-based print section presets

2 participants