Skip to content

fix(output): render truncation footer for nested tables via a pagination sibling - #87

Merged
jpage-godaddy merged 1 commit into
mainfrom
nested-truncation
Aug 5, 2026
Merged

fix(output): render truncation footer for nested tables via a pagination sibling#87
jpage-godaddy merged 1 commit into
mainfrom
nested-truncation

Conversation

@jpage-godaddy

Copy link
Copy Markdown
Collaborator

Summary

  • TableColumn::nested arrays never rendered a "(N of M rows, offset O, limit L)" truncation/pagination footer — render_nested_value hardcoded None regardless of what data sat next to the nested array (DEVEX-985).
  • A nested array's parent object can now carry a pagination sibling field shaped like PaginationMeta (total/offset/limit/count/has_more) — the exact same type Envelope::pagination already uses at the top level — which gets deserialized and threaded through render_table's existing footer logic. No new bespoke convention, no TableColumn/Envelope/PaginationMeta API changes.
  • A parent object with no pagination sibling, or one that fails to deserialize as PaginationMeta, keeps today's plain "(N rows)" footer.

Test plan

  • cargo fmt --all --check
  • cargo clippy --all-targets -- -D warnings
  • RUSTDOCFLAGS='-D warnings' cargo doc --no-deps
  • cargo test --all-targets (0 failed across all binaries)
  • cargo test --doc
  • cargo rustdoc --lib -- -W missing-docs (zero warnings)
  • New unit tests in cli-engine/src/output/human.rs covering resolve_field_parent, resolve_nested_pagination (present/absent/malformed sibling), and end-to-end render_object_with_columns footer text
  • New integration test in cli-engine/tests/consumer_cli.rs proving the fix through Cli::run

Jira: DEVEX-985

🤖 Generated with Claude Code

…ion sibling

Nested TableColumn::nested arrays hardcoded None for render_table's
pagination argument, so they could never show the "(N of M rows, ...)"
footer a top-level paginated array gets. A nested array's parent object
can now carry a `pagination` sibling field shaped like PaginationMeta
(the same type Envelope::pagination already uses), which gets
deserialized and threaded through render_table's existing footer logic.

Fixes DEVEX-985.

Copilot AI 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.

Pull request overview

This PR fixes human-output rendering so TableColumn::nested(...) child tables can show the same truncation/pagination footer as top-level paginated tables, by reading a pagination sibling (deserializable as PaginationMeta) on the object that owns the nested array.

Changes:

  • Thread nested pagination metadata into nested-table rendering by resolving a pagination sibling next to the nested array field.
  • Add unit tests in human.rs for resolving the parent object, deserializing nested pagination, and verifying footer output (present/absent/malformed).
  • Add an integration test proving the footer renders correctly through Cli::run, and update docs to describe the pagination sibling convention.

Reviewed changes

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

File Description
cli-engine/src/output/human.rs Resolves a nested array’s parent object, deserializes an optional pagination sibling as PaginationMeta, and passes it into existing table footer rendering; adds unit tests.
cli-engine/tests/consumer_cli.rs Adds an integration test ensuring nested child tables render the (N of M rows, offset O, limit L) footer when pagination is provided.
cli-engine/docs/concepts.md Updates nested-table documentation and example output to reflect the new pagination sibling behavior.

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

@jpage-godaddy
jpage-godaddy merged commit d448ce3 into main Aug 5, 2026
3 checks passed
@jpage-godaddy
jpage-godaddy deleted the nested-truncation branch August 5, 2026 21:55
@github-actions github-actions Bot mentioned this pull request Aug 5, 2026
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.

3 participants