Improve theme list ordering: sort newest to oldest within each role group - #8192
Open
krjo wants to merge 1 commit into
Open
Improve theme list ordering: sort newest to oldest within each role group#8192krjo wants to merge 1 commit into
krjo wants to merge 1 commit into
Conversation
4 tasks
aswamy
approved these changes
Jul 29, 2026
aswamy
left a comment
Contributor
There was a problem hiding this comment.
Since the current approach just does Role grouping then random ordering, i think this is a fair change. I tested it out too and it looks good 👍
Thank you for your contribution.
graygilmore
approved these changes
Jul 29, 2026
graygilmore
left a comment
Contributor
There was a problem hiding this comment.
Thanks @krjo! Love the change.
Make sure to sign the CLA so that we can merge it once CI passes.
EvilGenius13
approved these changes
Jul 29, 2026
Contributor
|
I like this. The change makes sense. Tested the build as well and worked fine. |
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.
WHY are these changes introduced?
Theme lists shown by the CLI (
theme listand the interactive theme picker usedby
theme push,theme pull,theme open, etc.) display themes in the orderreturned by the Admin API, which is creation order — oldest first. On stores with
many themes (e.g. 100+), the newest themes — the ones developers actually need to
see or push to — are at the very bottom, requiring a lot of scrolling and wasted time.
WHAT is this pull request doing?
Sorts theme lists newest to oldest, while keeping the existing role grouping
(live → unpublished → development).
All theme list displays funnel through
fetchStoreThemesinpackages/theme/src/cli/utilities/theme-selector/fetch.ts, which previouslysorted only by role and let the API's oldest-first order leak through within each
group. The comparator (
byRole→byRoleThenNewest) now adds an ID-descendingtiebreaker — theme IDs increase monotonically, so a higher ID means a newer
theme. No API or schema changes needed.
This changes ordering in one place for both the
theme listoutput and everyinteractive theme picker (
push,pull,open,publish,rename,delete,duplicate,info).How to test your changes?
pnpm shopify theme list --store <store>against a store with severalthemes — themes should appear newest first within each role group, with the
live theme at the top.
pnpm shopify theme open --store <store>without--theme— the pickershould list themes newest first within each role group.
pnpm vitest run src/cli/utilities/theme-selector/fetch.test.tsfrom
packages/theme— includes a new test asserting newest-first orderwithin role groups.
Checklist
patchfor bug fixes ·minorfor new features ·majorfor breaking changes) and added a changeset withpnpm changeset add