feat(transports/cli): pin table column order via Config#68
Merged
Conversation
The cli transport's slice-of-map table renderer sorted columns purely
lexicographically, which works for ad-hoc tables but produces a
readability regression when an *identifier* column should anchor the
row. monorel migrated to the cli transport and lost its hand-coded
column ordering this way: `bump | changeset | package | summary`
instead of `CHANGESET PACKAGE BUMP SUMMARY`.
Add a `Config.TableColumnOrder []string` knob:
cli.New(cli.Config{
TableColumnOrder: []string{"package", "changeset"},
})
Keys named here render in the listed order at the front of the table;
remaining keys sort lexicographically and follow. The knob is additive
(pin only the leading columns; rest sort). Pinned keys absent from
every row are silently skipped, so the same `TableColumnOrder` is safe
to reuse across call sites with different row shapes. Empty / nil
falls back to the prior fully-lexicographic behavior.
Tests cover the four cases enumerated in #66:
- Empty TableColumnOrder produces full lex output (regression cover).
- Pinned keys lead in listed order regardless of row insertion order.
- Pinned key absent from every row is silently dropped.
- Un-pinned keys still lex-sort among themselves after the pinned ones.
Resolves #66.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The "When You Add a New Feature" rule listed a manual `## [Unreleased]` edit to the root `CHANGELOG.md`, and the "Versioning Note" claimed the repo was a single Go module that shouldn't have per-package CHANGELOGs. Both predate the monorel migration and contradict the current AGENTS.md guidance: - The repo is multi-module; every transport, plugin, and integration has its own CHANGELOG.md. - Both root and per-package CHANGELOGs are written from `.changeset/*.md` files by `monorel release` at release time. - Manually adding `[Unreleased]` entries races the monorel pipeline and produces drift. Replace the CHANGELOG step with the changeset step, and rewrite the Versioning Note to point at AGENTS.md as the authoritative source. Also fix the floor-bump instruction in the same file that referenced manual `CHANGELOG.md` edits for the same reason. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
3d6b886 to
bacf1fb
Compare
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
Resolves #66.
The cli transport's slice-of-map table renderer sorted columns purely lexicographically, which works for ad-hoc tables but produces a readability regression when an identifier column should anchor the row. `monorel` migrated to the cli transport and lost its hand-coded column ordering this way: `bump | changeset | package | summary` instead of `CHANGESET PACKAGE BUMP SUMMARY`.
Add a `Config.TableColumnOrder []string` knob:
```go
cli.New(cli.Config{
TableColumnOrder: []string{"package", "changeset"},
})
```
Keys named here render in the listed order at the front of the table; remaining keys sort lexicographically and follow. The knob is additive (pin only the leading columns; the rest sort). Pinned keys absent from every row are silently skipped, so the same `TableColumnOrder` is safe to reuse across call sites with different row shapes. Empty / nil falls back to the prior fully-lexicographic behavior — zero behavior change for existing users.
Released as a `:minor` bump on `transports/cli/v2` via `.changeset/cli-table-column-order.md`.
Out of scope
Test plan
🤖 Generated with Claude Code