Skip to content

trail list: name active status filter in empty state; align statuses with server#1425

Open
matthiaswenz wants to merge 6 commits into
mainfrom
fix-trail-list-empty-state
Open

trail list: name active status filter in empty state; align statuses with server#1425
matthiaswenz wants to merge 6 commits into
mainfrom
fix-trail-list-empty-state

Conversation

@matthiaswenz

@matthiaswenz matthiaswenz commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Four related changes to entire trail list:

Empty-state message names the active filter. A bare entire trail list applies a default status filter, so the old flat "No trails found." misleadingly suggested the repo had no trails at all when trails existed in other statuses. The empty state now names the filter ("No open trails found."), appends the author filter when set, and hints at --status any.

Trail statuses aligned with the server's simplified set. The server folded in_progress and in_review into open (migration 20260603120300_simplify_repo_trail_status in entire.io); the API now accepts and emits exactly draft, open, merged, closed. The CLI still carried the six-value set, and trail list defaulted to in_progress — a status the server can no longer return, which would have made the default listing permanently empty. The retired statuses are dropped from the trail package, trail list now defaults to open. create/update/--status validation all derive from ValidStatuses(), so they reflect the new set automatically.

Truncated counts render as shown/total. When --limit (default 10) cut the list short, the header read "Recent trails · 10" — suggesting 10 was the total match count. It now renders "shown/total" (e.g. "Recent trails · 10/137") whenever rows were dropped, with the header noun pluralized by the total. Untruncated lists keep plain counts. Also fixes the --json flag help, which claimed only --status is respected when JSON output also honors --author and --limit.

Filtering, sorting, and truncation pushed to the server. The list endpoint paginates (default 50 rows, max 200), but the CLI fetched it bare and filtered client-side — so only trails among the 50 most recently updated were ever visible, capping every listing at whatever subset of that page matched the filters, and the shown/total counts were computed against the page instead of the real match count. The CLI now sends status (comma-separated), author, and limit as query params and reads the server's total for the shown/total display. --limit above 200 is clamped, with an explicit note when matches exceed the page ("Note: --limit 500 exceeds the server maximum of 200 trails per request."). The grouped-by-status view is replaced by a flat list with a STATUS column whenever more than one status can appear (no client-side aggregation; unknown server statuses render verbatim instead of an "Other" bucket). findTrail (backing trail show/update lookups) had the same first-page blindness and now requests the 200-row server max as a stopgap.

Follow-up

findTrail lookups by branch/number are still blind past 200 trails — a real fix needs a server-side branch filter param on the list endpoint, or using the by-number detail endpoint for number lookups.

Test plan

  • New unit tests for the empty-state rendering (filter named, --status any hint, author suffix)
  • Updated status validation tests: in_progress/in_review are now rejected by Status.IsValid() and the --status parser
  • New unit tests for trailListQuery (param encoding, --status any omitting the status param, 200 cap) and for truncated shown/total headers
  • New unit tests for the STATUS column (shown for multi/any-status, omitted for single-status)
  • mise run check (fmt, lint, unit + integration + e2e canary) passes

🤖 Generated with Claude Code

matthiaswenz and others added 3 commits June 5, 2026 22:53
`entire trail list` defaults to the in_progress status filter, so a repo
with trails in other statuses (open, merged, etc.) rendered a bare "No
trails found." that read as "this repo has no trails." Extract the
empty-state into printTrailListEmpty, which names the active status
filter and the author when set, and hints at `--status any` whenever a
status filter narrowed the results.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The server folded in_progress and in_review into open
(migration 20260603120300_simplify_repo_trail_status); the API now
accepts and emits exactly draft, open, merged, closed. Drop the two
retired statuses from the trail package and default `trail list` to
open instead of in_progress, which the server can no longer return.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Entire-Checkpoint: 0a6a3860cd0c
@matthiaswenz matthiaswenz requested a review from a team as a code owner June 12, 2026 15:01
Copilot AI review requested due to automatic review settings June 12, 2026 15:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates the entire trail command set to match the server’s simplified trail status vocabulary and to make trail list less misleading when the default status filter yields no results.

Changes:

  • Aligns trail status constants/validation with the server’s allowed set (draft, open, merged, closed) and updates the trail list default status to open.
  • Improves trail list empty-state output to name the active status filter (and author filter when set) and to suggest --status any when a status filter is active.
  • Updates unit tests to reflect the new status set, ordering/grouping, and empty-state rendering behavior.

Reviewed changes

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

Show a summary per file
File Description
cmd/entire/cli/trail/trail.go Removes retired statuses and constrains ValidStatuses() to the server-aligned set.
cmd/entire/cli/trail/trail_test.go Updates status validation/ordering tests to match the new 4-status set.
cmd/entire/cli/trail/store_test.go Adjusts store tests to use open instead of the removed in_progress.
cmd/entire/cli/trail_review_cmd_test.go Updates review dashboard tests to use open instead of in_review.
cmd/entire/cli/trail_cmd.go Switches default list status to open, updates grouping order, and adds printTrailListEmpty() to render filter-aware empty states.
cmd/entire/cli/trail_cmd_test.go Updates status parsing/list rendering expectations and adds tests for the new empty-state output.

matthiaswenz and others added 3 commits June 13, 2026 00:23
A capped page rendered "Recent trails · 10", reading as the total
number of matches rather than the page size. Header, per-status group
counts, and the Other bucket now render "shown/total" when --limit
dropped rows, and the header noun pluralizes by the total. Also fix
the --json flag help, which claimed only --status is respected.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Entire-Checkpoint: 72bbfd94df45
The list endpoint paginates (default 50 rows, max 200), but the CLI
fetched it bare and filtered client-side, so only trails among the 50
most recently updated were ever visible and the shown/total counts
were computed against that page instead of the real match count.

Send status, author, and limit as query params, read the server's
total for the shown/total display, and drop the client-side
filter/sort/limit machinery. --limit above 200 is clamped with a note
when matches exceed the page. The grouped-by-status view is replaced
by a flat list with a STATUS column whenever more than one status can
appear, so unknown server statuses stay visible without aggregation.

findTrail (trail show/update lookups) had the same first-page
blindness; as a stopgap it now requests the 200-row server max.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Entire-Checkpoint: 6b684484518f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants