Skip to content

FIX: Allow themes index to resort when adding new themes #34314

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

martin-brennan
Copy link
Contributor

Follows the same pattern as the color palette index, where we
sort the themes once, and then resort only when the themes array
from the model changes. This fixes the issue where if you installed
a new theme, it would not show up on the grid until you refreshed.

Follows the same pattern as the color palette index, where we
sort the themes once, and then resort only when the themes array
from the model changes. This fixes the issue where if you installed
a new theme, it would not show up on the grid until you refreshed.
<template>
<span {{didUpdate this.resetSortedThemes @themes}}></span>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like this...but didUpdate will not work if I put it on AdminFilterControls

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all this logic… sounds like a job for @cached decorator? 👀

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works partially, but still doesn't address the original issue, which is that we didn't want the default theme to jump around in the list when you change it:

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually...I just saw that we reload the whole page now when we change the default theme, so it doesn't matter anyway 🤦 Will just use cached

@martin-brennan martin-brennan requested a review from CvX August 15, 2025 01:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants