PR 19877: sort and search the CRD list by its Resource column

rancher/dashboard#19877 by codyrancher, fixes issue 19742 (richard-cox), milestone v2.17.0. Head 2516d88 on base 55438bb; master is 300e0de and has no changes to the 4 touched files. +235 / -5: one config change in explorer.js:584-594, plus unit and e2e tests. Reviewed 2026-11-17 in two passes: Cody's process from codyrancher/ai-skills at c04c11a (A) and ours as a fresh agent (B). I rechecked every point at the head commit. Nothing is posted.

Preview: https://rancherpr19877r.mf-created-dashboard.ui.rancher.space/dashboard/, built from 2516d88, backend the mf Rancher (v2.16.0-7758e3e-head, which has the rancher/rancher#55811 indexes; a direct Steve call sorts and filters on both fields for local and the downstream c-m-bmsk94st). Baseline: dashboard-master, rebuilt at the upstream tip 300e0de, same backend.

Verdict: commentboth passes agree

Before and after: the issue's walk (sort by Resource, then search auditpolicy)
Before this change: dashboard-master at 300e0de. The Resource header doesn't sort, and auditpolicy finds no rows.
With this change: the PR build sorts ascending, then descending, and finds auditpolicies.auditlog.cattle.io.

The same script ran on both builds, in the light theme. In these copies for GitHub, the URL band is cropped off.

How it was, how it is now
Case (local cluster, mf admin)master 300e0dePR 2516d88
Resource headernot sortable (tabindex=-1)sortable, tabindex=0, Enter sorts, aria-sort follows
Click Resourcenothingsort=spec.group,spec.names.singular: acme.cert-manager.io.challenge, …order, addons.cluster.x-k8s.io…
Click it againnothing-spec.group,-spec.names.singular: upgrade.cattle.io.plan, ui.cattle.io.tableconfiguration…
Search auditpolicy (and auditpol)0 rows1 row, auditpolicies.auditlog.cattle.io
Search cert-manager6 rows6 rows (the name always contains the group)
Search the full auditlog.cattle.io.auditpolicy, paginated0 rows0 rows (the miss the issue accepts)
The same, client-side list0 rows1 row
Resource cell and linkauditlog.cattle.io.auditpolicy (4) → Audit Log Policiesthe same
Downstream c-m-bmsk94stnot sortable, 0 rowssorts, 1 row, link opens its list
Table views off (old search box)0 rows, not sortable1 row, sorts
View > Group ByNone, State, Name, Ageadds Resource: one heading per row, no count
Console on sort / searchno pagination warnings1 warning per sort, 2 per search

Green is the fix, grey is the same on both, red is the point to post. The client-side list and the table-views-off runs override ui-performance or the feature flag in the test browser only; nothing changed on mf.

The point to post
1

Every Resource sort and every search logs a false "Pagination API does not support…" warning

Suggestion
both passes Dev evidence: live

What happens

On the PR preview, each click on Resource logs Pagination API does not support sorting 'apiextensions.k8s.io.customresourcedefinition' by the requested fields: spec.group, spec.names.singular. Each search logs the filtering variant twice: once for the page request and once for the count request. Master logs neither, because it never sends those fields. It happens with table views on or off.

Why

VALID_FIELDS[CRD] is the dashboard's list of fields the API can sort and filter on. It still has both entries commented out as "blocked on rancher/rancher#55811", and the column now sorts and searches on them. The API answers both with 200 on 2.16. Afterwards the two files disagree, and the warning fires on every search of this list for fields that work, which hides the real ones.

The author's note

The description says it was left this way because open PRs edit that list. I checked: the only open PR that touches steve-pagination-utils.ts and its VALID_FIELDS is 19219 (aeltai, Pods sorted by IP). Its hunk is in the Pod block, about 125 lines above the CRD entries. Draft 18229 touches the imports and the store defaults, not this block.

In the merge

Both passes found it and proved it live. In Pass A, refinement rated the user impact "none" but kept it, because a false warning on every request plus a stale record of what the API supports is a trap for the next person debugging this list. It is introduced by this PR.
Your call
2

Group By > Resource: inside an API group the headings follow Name, not the Resource sort

explorer.js:589 · mechanism groupSortFor in resource-table-views.js (master)
Optional, your call
Pass B Dev evidence: live

What happens

Picking View > Group By > Resource requests sort=spec.group,metadata.name. As a result, addons.cluster.x-k8s.io.clusterresourcesetbinding comes above addons.cluster.x-k8s.io.clusterresourceset, the reverse of sorting the Resource column.
CRD list grouped by Resource: the clusterresourcesetbinding heading sits above the clusterresourceset heading
PR preview, View > Group By > Resource.

Whose it is

The mechanism is master's table-views code. groupSortFor takes only the first sort entry, and its comment says later entries are tie breakers. That holds for the other groupable columns. The PR's Resource column is the first whose heading combines two sort fields, so the PR is the first place it shows. Master doesn't offer this grouping at all.

Why it's your call

Each CRD has its own group.singular (mf: 183 CRDs, 0 shared), so grouping by Resource gives one heading per row anyway. The PR says that is intended ("one heading per resource, without the count"). The order is only off where one singular name is a prefix of another. I'd post it only as Optional, or not at all. Pass A saw the same order and didn't file it.
Q

Questions for you, kept out of the draft (table views, a UI-team PR)

Pass B, rechecked against the code
Question
The two passes side by side
Pass A: Cody's processPass B: ours
Verdictcomment: 5 of 5 criteria met, 1 comment kept through every phasecomment: 0 blockers, 2 suggestions, 1 optional nit, 4 questions for you
False console warning✓ filed; verified, refined, condensed, and introduced by the PR✓ suggestion 1, with the twice-per-search count
Group By heading orderseen in the side-effects check, not filed✓ suggestion 2
Model test that can't fail today–✓ nit (mutant M10 survived)
Before/after videos✓ same script on master and the PR–
Acceptance table✓ 5 criteria from the issue, each linked–
Client-side list✓✓ and also with table views off
Downstream cluster✓ in the UI✓ through the Steve API
Query-box behavior (crd-cr:, suggestions)–✓ questions for you
Race that overwrites a typed query (on master)✓ found and forced on master– (told to wait 7 s)
Tests26 pass26 pass, 10 mutants (9 caught), CI e2e log read
Outputcriteria + verification, comment file, master file, 2 videosreview, 7-dimension grid, checked list, draft
Costabout 95 min in this session, including the setup and the race investigation38 min, 103 tool calls, 243k tokens

Both passes reached the same answer and found the same point to post. A brought the videos, the sourced criteria and a master race. B brought the mutants, the table-views-off and query-box cases, and the Group By order.

Pass A: Cody's my-pr-full-review
CriterionVerdictHow
AC1Resource sorts by group, then singular, both directions (issue body)Metlocal, downstream, client side
AC2auditpolicy finds the CRD by its singular name (Cody's repro)Met1 row; master 0
AC3Search by groupMetcert-manager 6 rows; the name already contains the group
AC4The cell text, count and link are unchanged (implied)Metlive + unit tests
AC5Paginated and client-side, local and downstream (implied)Metall four

Out of scope per the issue: matching the full group.singular string in the paginated search ("better than nothing").

Pass B: our checklist, fresh agent
Dropped in the merge
PointWhy it is not in the review
B The model test "should not change the list location of the definition itself" can't failIt can't fail today because listLocation builds a new object on every read. That is also the only reason the getter's shallow copy { ...this.listLocation } doesn't leak params. If listLocation were ever cached, this test is the one that would catch the leak, so it guards something real.
B mount instead of shallowMount, (header: any)Our checklist asks for shallowMount, but formatter tests with RouterLinkStub mount in this repo, and the file already uses (header: any). Not raised.
A spec.group in search is redundant with the nameTrue, but the issue asks for both fields, and sort needs the group anyway.
Found on master, not this PR's
WhatDetail
A filtered list can be replaced by an older unfiltered pageAbout 4 s after a paginated list loads, a websocket-driven refetch of the unfiltered page goes out. If a query is typed while it is in flight and the refetch answers last, the table shows the 100 unfiltered rows under the typed query. It happened by chance in 2 of 9 PR runs. Forced on master (300e0de) by holding that response 1.5 s: auditpolicies ended with 100 rows. Both builds send the same two requests in the same order.
aria-sort="None"Unsorted sortable headers carry None; the valid value is lowercase none. Every column on master has it, and the PR just adds one more sortable header.
resourceCount reads all(COUNT)?.[0].countsIt throws if the COUNT list is empty. The model is unchanged by the PR (B).
The appsplus extension on mf PUTs a CRD on every page loadappinstances.appsplus.io gets a GET then a PUT on every dashboard load, on master and the PR alike (B). Nothing to do with this PR, but it is a write on every visit.

The first item is a real bug in paginated lists and could become its own issue; the scripts are in ~/Projects/pr19877-review/pw/peek2*.mjs, the logs in out/peek2*.log.

CI on 2516d88
What I did on mf and the previews
What I'd post

Comment, body:

Tried it on a 2.16 build: sorting by Resource, the auditpolicy search and the link all work, paginated and client side. One thing below.

Inline on explorer.js:587

Every Resource sort and every search on this list now logs "Pagination API does not support sorting/filtering 'apiextensions.k8s.io.customresourcedefinition' by the requested fields: spec.group, spec.names.singular", because VALID_FIELDS[CRD] in steve-pagination-utils.ts still has both commented out as blocked on rancher/rancher#55811. I saw the note in the description, but the warning is wrong on 2.16 and buries the real ones, and the one open PR editing that list (19219) only touches the Pod entries.

Optional, only if you want card 2: inline on explorer.js:589

Optional: grouping by Resource sorts by spec.group,metadata.name, so inside an API group the headings follow Name: addons.cluster.x-k8s.io.clusterresourcesetbinding lands above addons.cluster.x-k8s.io.clusterresourceset, the reverse of sorting by Resource.

Code names go in backticks when posted (VALID_FIELDS[CRD], steve-pagination-utils.ts, the sort paths and resource names). If you post the optional comment, change "One thing below" to "Two things below". Pass A's before/after pair can go under the intro ("Before this change:" then "With this change:", each video on its own line). The copies with the URL band cropped are in ~/Projects/pr19877-review/demos/: before-master-gh.mp4 and after-pr-gh.mp4.