Repository navigation
Conversation
The default branch of sortItems now orders by a lowercased display label: Data.Label when it is set, otherwise Name. Equal labels fall back to Name. Pin handling is unchanged. New tests cover mixed sources in one category, case folding, a label tie broken by name, and a pinned item staying first. Fixes almeidapaulopt#517
|
The |
|
Thanks for this! Quick note on the red |
|
Friendly ping on this one: the dashboard name sort is ready, and the only red check is still the Lint step you traced to the pre-existing errcheck findings on main. Happy to rebase once the lint config is sorted on your side. |
|
Thanks for the ping @mvanhorn — and sorry for the wait. Confirmed: the Lint red here is the pre-existing errcheck findings in older test files on main, not your change. The fix is staged in #551; once it merges, this PR's Lint step should go green — your head already stacks an equivalent errcheck test fix, so no rebase should be needed unless a conflict shows up after #551 lands. |
Why
Alphabetical order on the dashboard starts over for each source. Docker Compose cards sort A–Z as one block and external.yaml cards sort A–Z as another, including when they share a category, so the titles on the cards are not one alphabet.
The default name sort compared each proxy’s internal name. Compose entries use generated names such as stack-wizarr-1, while external entries use the config key, so those strings cluster by origin instead of by the label shown on the card. The comparison was also case-sensitive.
What changed
The default branch of sortItems now orders by a lowercased display label: Data.Label when it is set, otherwise Name. Equal labels fall back to Name. Pin handling is unchanged. New tests cover mixed sources in one category, case folding, a label tie broken by name, and a pinned item staying first.
Testing
Go test ./internal/dashboard/... passed. The tests in
internal/dashboard/dashboard_test.gofail without the fix in the tsdproxy sortItems change (checked by reverting the source changes).Fixes #517