feat(tui): sort the credential table by field with a cycle key - #141
Merged
Conversation
Add a session-only sort control to the TUI credential table. Sort state (field + direction) lives in AppState, defaulting to Service ascending so existing behavior is preserved. - `o` cycles the sort field: Service -> Username -> Last Used -> Service - `O` reverses the sort direction (ascending/descending) table.Refresh() applies the selected field and direction, with a Service tie-break so ordering stays deterministic on equal keys, and the table title shows the current sort (e.g. "Credentials (12) · Last Used ↓"). Refresh is driven through the existing OnFilterChanged callback, so no new wiring is needed. The Help modal documents both keys. Sorting applies to the main table only; the category-grouped sidebar stays alphabetical. Persistence across restarts is intentionally out of scope for this change. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014kVLjbUL4F4CkoA7RbMYy8
arimxyer
added a commit
that referenced
this pull request
Jul 2, 2026
Promote the [Unreleased] entries to [0.19.0] and add the two sort PRs that shipped without changelog entries: - TUI sort-by-field toggle (#141) under Added - consistent case-insensitive ordering everywhere (#139) under Fixed 0.19.0 collects the background agent (#116), the env-injection epic (#115: export/inject/exec --env-file/manifest, plus value filters #138), the configurable sync probe timeout (#137), the TUI sort toggle (#141), consistent ordering (#139), and the sync failure-backoff (#133). Claude-Session: https://claude.ai/code/session_014kVLjbUL4F4CkoA7RbMYy8 Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.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.
Adds a session-only sort control to the TUI credential table, addressing the "sort by specific fields" ask from discussion #89.
Summary
Sort state (field + direction) lives in
AppStateand defaults to Service ascending, so current behavior is unchanged until the user acts.o— cycle the sort field: Service → Username → Last Used → ServiceO— reverse the sort direction (ascending/descending)The current sort is shown in the table title, e.g.
Credentials (12) · Last Used ↓, and both keys are documented in the Help modal.Design notes
OnFilterChangedcallback.ochosen overs—sis alreadytoggle_sidebar.o= "order by".Test
TestAppStateSortState— default is Service ↑; field cycling wraps; direction toggles.TestSortFieldString— title labels.TestCredentialTableSortByField— table honors field + direction across Service/Username/Last Used, verifies reverse, and the Service tie-break (includes a lowercase entry and a "Never" last-used entry).go test ./...✓ ·go vet ./...✓ ·golangci-lint run ./cmd/...→ 0 issues ✓ · build ✓Follow-ups (not in this PR)
🤖 Generated with Claude Code