Skip to content

fix(list): align JSON status symbols with terminal output - #4335

Merged
max-sixty merged 6 commits into
mainfrom
agent-ac13bd90fb67815af
Oct 1, 2026
Merged

max-sixty merged 6 commits into
mainfrom
agent-ac13bd90fb67815af

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

wt list JSON appended worktree state after the main and upstream symbols, while the rendered Status column places it first. Both JSON schemas now use the status model’s shared gate ordering and operation priority, so a row with symbols !⚐↑⇡* serializes in that same order.

Raw JSON retains its existing rename/delete glyphs and marker text. Regression coverage compares both schemas with a real rendered row and checks unresolved gates, operation priority, and the raw working-tree glyphs. The shared snapshot normalizer also accounts for Git 2.56’s ambiguous remote-branch diagnostic.

Validation: the full project pre-merge gate passed: 5,021 tests, one skipped, plus lint, formatting, documentation, doctests, and lockfile checks. Independent review found no remaining issues.

This was written by Codex on behalf of max-sixty

max-sixty and others added 6 commits September 1, 2026 16:25
`format_raw_symbols` appended the gates in the order it happened to read the
fields — working tree, main state, upstream divergence, worktree state, user
marker — while `StatusSymbols::styled_symbols` (positions 0-6) and the list
page's "Status symbols" section both put the worktree gate third, ahead of the
default-branch and remote gates. A row rendering `⚑_` serialized as `"_⚑"`, a
locked worktree as `"_⊞"`, a bisecting one as `"_↻"`, and a conflicted rebase
as `"✗✘"`. Both JSON schemas read the one builder, so both were wrong.

The renderer is the side the docs describe and the table prints, so the builder
moves to match it: working tree (0-2), worktree state (3), main state (4),
upstream divergence (5), user marker (6). The marker was already last and stays
there.

A unit test pins the raw string against `format_compact()` — the compact
rendering derived from `styled_symbols`, with its ANSI stripped — so a reorder
on either side fails rather than silently diverging. An integration test builds
one row that populates every gate (an off-template worktree path, commits the
default branch lacks, a commit the upstream lacks, an uncommitted edit, a
marker) and asserts both schemas' `symbols` equal the rendered Status cell.

Also corrects the schema-1 field doc, whose example carried spaces the raw
string never contains and a `✖` that is in no symbol vocabulary.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
# Conflicts:
#	tests/integration_tests/list.rs
#	tests/snapshots/integration__integration_tests__list__list_bisect_json.snap
#	tests/snapshots/integration__integration_tests__list__list_json_with_git_operation.snap
@max-sixty
max-sixty merged commit 85e685e into main Oct 1, 2026
38 checks passed
@max-sixty
max-sixty deleted the agent-ac13bd90fb67815af branch October 1, 2026 20:01
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.

2 participants