Repository navigation
fix(list): align JSON status symbols with terminal output - #4335
Merged
Merged
Conversation
`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
worktrunk-bot
approved these changes
Oct 1, 2026
1 task
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.
wt listJSON 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.