Skip to content

fix(admin): sort plugins by last updated newest first - #8536

Merged
JohnMcLear merged 1 commit into
developfrom
fix/admin-plugin-sort-direction
Nov 23, 2026
Merged

JohnMcLear merged 1 commit into
developfrom
fix/admin-plugin-sort-direction

Conversation

@JohnMcLear

Copy link
Copy Markdown
Member

Follow-up to #8531.

On /admin/plugins, choosing "Last updated" in the sort dropdown listed the oldest plugin first, because changing the field always reset the direction to ascending.

Each field now starts in its own default direction:

  • Name: ascending (A to Z)
  • Version: descending (highest first), compared numerically so 10.0.0 ranks above 9.0.0
  • Last updated: descending (newest first)

The asc/desc toggle still reverses the order. Plugins with no publish date go last in both directions.

The admin catalog spec gains fixture-backed sorting tests (the socket results are stubbed, so they don't depend on the live feed).

🤖 Generated with Claude Code

https://claude.ai/code/session_01TcYAoDMav4BPPE9JrMtSvw

Picking a field in the available-plugins sort dropdown always reset the
direction to ascending, so "Last updated" listed the oldest plugin first.
Each field now starts in a sensible direction: name A to Z, version and
last updated highest/newest first. The toggle still flips it. Plugins
without a publish date sort last in both directions, and versions compare
numerically so 10.0.0 ranks above 9.0.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TcYAoDMav4BPPE9JrMtSvw
@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

PR Summary by Qodo

Fix default sorting in the admin plugin catalog

🐞 Bug fix 🧪 Tests 🕐 10-20 Minutes

Grey Divider

AI Description

• Default names to ascending order and versions and publish dates to descending order when selected.
• Compare versions numerically and keep undated plugins last in either date-sort direction.
• Add fixture-backed browser tests for sort defaults, ordering, and the direction toggle.
Merge Risk 🟢 Low

Blast radius 🟢 Low 💥 1 capability

  • 1 affected end-to-end capability after fault-specific containment; implementation boundaries do not widen its functional scope.
  • The changed comparator and default direction are applied to the available-plugin rows rendered by HomePage after catalog search results arrive.
  • Browsing, sorting, and choosing an available plugin are one bounded admin catalog behavior; the server search endpoint supplies the same catalog data but is an implementation hop in this path, not an independent capability.
Sources

admin/src/pages/HomePage.tsx[383-383]

                  sortDir: defaultSortDir[sortBy],
Behavioral complexity 🟢 Low 🧩 Straightforward

  • Before: the page used ordinary field-specific string comparison and always initialized a newly selected field to ascending order.
  • After: it adds a small mapping from sort field to initial direction, numeric-aware version comparison, and an explicit missing-date ordering rule.
  • The new correctness conditions are direct: each supported field must map to the intended initial direction, numeric versions must compare as users expect, and undated plugins must remain last in either direction.
  • These are straightforward local rules; there is no new persistence protocol, concurrency, migration, coordinated invariant, or nontrivial algorithm.
Sources

admin/src/pages/HomePage.tsx[383-383]

                  sortDir: defaultSortDir[sortBy],
Potential damage 🟢 Low 🩹 Cosmetic

  • The direct failure is an incorrectly ordered catalog display.
  • It can make a plugin harder to find or make the displayed order inconsistent with the selected sort, but it does not alter plugin metadata or persist a bad value.
  • Installation is a separate explicit user action, so no automatic downstream installation consequence is attributed to this scenario.
  • Reversible by changing the sort field/direction, refreshing the catalog, or reverting the UI change.
  • No persistent state repair or external compensation is required for the ordering fault itself.
Sources

admin/src/pages/HomePage.tsx[383-383]

                  sortDir: defaultSortDir[sortBy],
Assessed commit d56a408
Diagram

graph TD
  Admin["Admin"] --> Controls["Sort controls"] --> Params["Search params"] --> Field{"Sort field"} --> Table["Plugin table"]
  Socket["Catalog socket"] --> Results["Plugin results"] --> Field
  Params --> Socket
Loading
High-Level Assessment

Keep sorting in the existing client-side catalog flow. Field-specific defaults and comparator fixes address the behavior without introducing a separate sorting path or changing the catalog service; fixture-backed browser tests cover the visible result.

Files changed (2) +95 / -9

Bug fix (1) +14 / -2
HomePage.tsxSet field-specific sort defaults and correct catalog comparisons +14/-2

Set field-specific sort defaults and correct catalog comparisons

• Selecting a field now starts names ascending and versions or publish dates descending, while the direction toggle still reverses the order. Version comparison uses numeric collation, and plugins without publish dates remain last in either date-sort direction.

admin/src/pages/HomePage.tsx

Tests (1) +81 / -7
admin_plugin_catalog.spec.tsCover catalog sorting with fixture-backed browser tests +81/-7

Cover catalog sorting with fixture-backed browser tests

• Moves the existing hygiene setup into its describe block and adds a sorting suite. The suite substitutes fixed Socket.IO search results and checks name, version, and publish-date ordering, direction indicators, and the date-sort toggle.

src/tests/frontend-new/admin-spec/admin_plugin_catalog.spec.ts

@JohnMcLear
JohnMcLear merged commit c0aeb2e into develop Nov 23, 2026
34 checks passed
@JohnMcLear
JohnMcLear deleted the fix/admin-plugin-sort-direction branch November 23, 2026 11:01
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.

1 participant