Repository navigation
feat(output)!: mandatory/essential columns and explicit --fields opt-out - #120
Merged
Merged
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Two exported renderer signatures are source-breaking, and the row-selection implementation unnecessarily duplicates retained payload data.
Review effort: Balanced
Findings: 2
Open (3)
What changed in this PR
Adds essential human-output columns and honors explicit --fields selections without terminal-width fitting.
Changes:
- Adds
TableColumn::essentialand index-based column fitting. - Propagates explicit field-selection state through rendering.
- Splits and expands human-output tests and documentation.
| File | Description |
|---|---|
cli-engine/tests/foundation.rs |
Updates renderer calls. |
cli-engine/tests/exhaustive_output.rs |
Updates renderer calls. |
cli-engine/tests/custom_human_views.rs |
Updates registry rendering call. |
cli-engine/src/output/human/tests/width_fitting.rs |
Tests width and essential-column behavior. |
cli-engine/src/output/human/tests/value_format.rs |
Houses value-format tests. |
cli-engine/src/output/human/tests/nested.rs |
Houses nested-output tests. |
cli-engine/src/output/human/tests/mod.rs |
Declares split test modules. |
cli-engine/src/output/human/tests/footer.rs |
Houses footer tests. |
cli-engine/src/output/human/tests/field_selection.rs |
Tests field ordering and selection. |
cli-engine/src/output/human/tests/alignment.rs |
Houses alignment tests. |
cli-engine/src/output/human/tests.rs |
Removes the monolithic test module. |
cli-engine/src/output/human/mod.rs |
Adds essential columns and explicit-selection APIs. |
cli-engine/src/output/human/columns.rs |
Implements index-based width fitting. |
cli-engine/src/output/human/body.rs |
Applies essential and explicit-field behavior. |
cli-engine/src/middleware/run.rs |
Passes explicit-selection state to rendering. |
cli-engine/docs/concepts.md |
Documents width-fitting semantics. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
mguerrero3-godaddy
approved these changes
Oct 5, 2026
mguerrero3-godaddy
left a comment
Collaborator
There was a problem hiding this comment.
I see this has merge conflicts. Let me know If this get stalled and needs reapproval.
…th fitting Add `TableColumn::essential`: essential columns are never hidden or truncated to fit the terminal width. An explicit (user-typed) `--fields` disables all width-based column hiding and truncation; both only apply to the default view. Hide the view-rendering internals and add `preview_human_view` as the stable, test-oriented way to render a view from a command module's tests. BREAKING CHANGE: `render_human_with_view` and `render_human_with_registry_selected` are now crate-internal (no longer exported from the crate root or `output`); `render_human_with_registry` and `render_human_with_registry_for_schema` are removed entirely. Any consumer calling these directly (expected mainly in command-module tests) should switch to `preview_human_view(data, columns)`. Co-Authored-By: Claude Code <noreply@anthropic.com>
jpage-godaddy
force-pushed
the
column-dropping-tweaks
branch
from
October 5, 2026 15:45
995a54e to
03c784e
Compare
jpage-godaddy
requested review from
axburgess-godaddy,
qcai-godaddy,
rts1-godaddy and
runruh-godaddy
as code owners
October 5, 2026 15:45
Merged
jpage-godaddy
pushed a commit
that referenced
this pull request
Oct 5, 2026
🤖 I have created a release *beep* *boop* --- <details><summary>cli-engine: 0.10.0</summary> ## [0.10.0](cli-engine-v0.9.5...cli-engine-v0.10.0) (2026-10-05) ### ⚠ BREAKING CHANGES * **output:** `render_human_with_view` and `render_human_with_registry_selected` are now crate-internal (no longer exported from the crate root or `output`); `render_human_with_registry` and `render_human_with_registry_for_schema` are removed entirely. Any consumer calling these directly (expected mainly in command-module tests) should switch to the new `preview_human_view(data, columns)`. ### Features * **output:** mandatory/essential columns and explicit --fields opt-out ([#120](#120)) ([4ff2418](4ff2418)) ### Bug Fixes * **ci:** unblock Rust CI on newer clippy/rustdoc lints and pin the toolchain ([#122](#122)) ([6fe18d7](6fe18d7)) ### Documentation * propose cursor-first pagination (--limit/--continue) ([#114](#114)) ([d67f9d0](d67f9d0)) </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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
TableColumn::essential(bool): a column marked essential is never hidden or truncated for terminal width, even if it alone exceeds the display width (still capped atNO_TRUNCATE_MAX_WIDTHfor pathological values). Use it for fields a view is useless without — e.g. a DNS record list needstype/name/dataat minimum.--fieldsselection (as opposed to a command'sdefault_fieldsfallback) now disables width-based hiding and truncation entirely for the columns it selects, regardless of theiressentialflag — the user named exactly what they want to see, so the row simply overflows the terminal if it must. Hiding/truncation remain a convenience reserved for the default view, where cli-engine (not the user) picked the field set.output/human/{columns,body}.rsfrom a contiguous-prefix model to an index-set model so essential columns can be exempted regardless of their declared priority position.render_human_with_view,render_human_with_registry_selected, and the two now-dead registry wrapper functions (render_human_with_registry,render_human_with_registry_for_schema, deleted outright) are now crate-internal (pub(crate)). They had no production callers beyond middleware's single internal use — their only other callers were command-module tests reaching past the engine to render a view against fixture data, which is exactly howessential/fields_explicitended up breaking those call sites in the first place.preview_human_view(data, columns)as the one stable, intentionally minimal public entry point for that test use case: render aTableColumnview against fixture data the way a default view would, noEnvelopeor CLI run required. It's deliberately decoupled from the internal renderers so future rendering-behavior changes won't need to break it the way this one did. Migrated cli-engine's own tests and the downstreamgddyconsumer's ~12 call sites to it; moved the handful of tests that genuinely exercise internal registry/custom-renderer dispatch contracts into crate-internal unit tests instead.output/human/tests.rsinto atests/directory module (grouped by concern: footer, alignment, field_selection, width_fitting, nested, value_format, registry) since it grew past the 1000-line module cap.docs/concepts.mdto document the essential/explicit-fields behavior and the newpreview_human_viewtesting entry point.Test plan
cargo fmt --all --checkcargo clippy --all-targets -- -D warnings(default and--features pkce-auth)cargo test --all-targets(293 passed; 338 with--features pkce-auth)cargo test --doc(default and--features pkce-auth)RUSTDOCFLAGS='-D warnings' cargo doc --no-deps(default and--features pkce-auth)cargo rustdoc --lib -- -W missing-docs(zero missing docs)./cli-engine/scripts/check-module-size.shmain(rustc 1.99.0, as pinned byrust-toolchain.toml)gddy dns list) in a sibling worktree: 17-column view withtype/name/dataessential correctly hides 7 non-essential columns at 80-column width while the three essential ones always survivegddyconsumer's ~12render_human_with_viewcall sites againstpreview_human_view— all 991 of its tests passBREAKING CHANGE:
render_human_with_viewandrender_human_with_registry_selectedare now crate-internal (no longer exported from the crate root oroutput);render_human_with_registryandrender_human_with_registry_for_schemaare removed entirely. Any consumer calling these directly (expected mainly in command-module tests) should switch to the newpreview_human_view(data, columns).🤖 Generated with Claude Code