Skip to content

fix: sort dashboard names by display label across sources - #549

Open
mvanhorn wants to merge 2 commits into
almeidapaulopt:mainfrom
mvanhorn:fix/517-dashboard-label-sort
Open

mvanhorn wants to merge 2 commits into
almeidapaulopt:mainfrom
mvanhorn:fix/517-dashboard-label-sort

Conversation

@mvanhorn

Copy link
Copy Markdown
Contributor

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.go fail without the fix in the tsdproxy sortItems change (checked by reverting the source changes).

Fixes #517

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
@almeidapaulopt

Copy link
Copy Markdown
Owner

The build failure here is pre-existing on main, not caused by this change: the lint step (golangci-lint latest, now resolving to v2.15.0) flags three errcheck findings — internal/proxymanager/concurrency_test.go:421, internal/proxymanager/port_test.go:704 and :930 — files this PR doesn't touch. The same lint failure also shows up on #548, which only bumps a web dependency. It will be addressed separately on main; no changes needed here for it.

@almeidapaulopt

Copy link
Copy Markdown
Owner

Thanks for this! Quick note on the red build check: it fails only at the Lint step, and the flagged file (internal/proxymanager/port_test.go, errcheck ~L930) is not touched by this PR — #548 (a daisyui patch bump) fails the identical way, and PRs whose CI ran before mid-October pass. Our CI uses golangci-lint-action with version: latest, so a recent golangci-lint release started flagging pre-existing code. Your build and tests are green; we'll sort out the lint config/version on our side.

@mvanhorn

mvanhorn commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author

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.

@almeidapaulopt

Copy link
Copy Markdown
Owner

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.

This branch has not been deployed

No deployments
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.

Alphabetical sorting order resets from internal and external items

2 participants