Repository navigation
fix(theming): persist primary color changes/resets and invalidate stylesheet cache - #66772
Open
saiyyedfardeen wants to merge 1 commit into
Open
saiyyedfardeen wants to merge 1 commit into
saiyyedfardeen wants to merge 1 commit into
Conversation
saiyyedfardeen
requested review from
CarlSchwan,
icewind1991,
kristian-zendato and
pringelmann
and removed request for
a team
November 18, 2026 18:24
6 of 9 tasks
susnux
reviewed
Nov 18, 2026
susnux
left a comment
Contributor
There was a problem hiding this comment.
this looks like multiple unrelated things mashed up in on PR.
Also the frontend change does not really solve the problem but just moves it from wait 1s to being forced pressing the button.
So I would say its even worse now because 1s waiting is more likely than remember to press the button
Contributor
There was a problem hiding this comment.
The problem here is you can close the picker and the colors stays - thats by design but in this usage its now confusing because the color is changed but not saved.
Author
There was a problem hiding this comment.
Thanks for the review @susnux! I've updated the PR to address all your feedback:
- Focused scope: Reverted the unrelated
ThemingControllerandUserThemeControllerchanges and keptBeforePreferenceListenerstrictly scoped toprimary_colorcache invalidation. - Frontend picker behavior (
UserSectionPrimaryColor.vue): Restored the debouncedwatch(primaryColor, ...)alongside@submit="onUpdate"so closing the picker without pressing "Choose" still auto-saves after 1s, while pressing "Choose" saves immediately. - Reset race condition: Guarded
onReset()with anisResettingflag anddebouncedUpdate.clear?.()so resettingprimaryColorback todefaultPrimaryColordoesn't trigger a follow-upPOSTthat overwrites theDELETErequest.
Comment on lines
-140
to
142
| $this->appConfig->setAppValueBool('disable-user-theming', $value === 'yes' || $value === 'true'); | ||
| $this->themingDefaults->set(ConfigLexicon::USER_THEMING_DISABLED, $value); | ||
| $saved = true; |
saiyyedfardeen
force-pushed
the
fix-66706
branch
from
November 18, 2026 21:35
2828c8c to
927c228
Compare
…lesheet cache Signed-off-by: Fardeen Saiyyed <fardinsaiyyed@hotmail.com>
saiyyedfardeen
force-pushed
the
fix-66706
branch
from
November 18, 2026 21:36
927c228 to
68a3dbd
Compare
This branch has not been deployed
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.
Summary
Users were unable to permanently change or reset their primary color under User > Appearance and accessibility.
Root Causes
@submithandler (UserSectionPrimaryColor.vue):<NcColorPicker>lacked a@submitevent listener, relying solely on a 1000ms debounced watcher. Navigating away or refreshing before 1000ms lost the update, and clicking Reset primary color triggeredonUpdate(null)(DELETE) followed 1000ms later by the watcher re-postingdefaultPrimaryColor, preventing the preference from ever resetting.BeforePreferenceListener.php): Theme stylesheets are served withCache-Control: max-age=86400, keyed byUtil::getCacheBuster()(userCacheBuster). Updating or deletingprimary_colordid not incrementuserCacheBuster, causing browsers to serve the cached stylesheet with the old color on reload.Changes
apps/theming/src/components/UserSectionPrimaryColor.vue: Added@submit="onUpdate"to<NcColorPicker>for immediate saving when clicking "Choose", retained the debouncedprimaryColorwatcher so closing the picker without clicking the button still autosaves, and guardedonReset()withisResetting+debouncedUpdate.clear?.()so resetting cleanly sends only theDELETErequest without being overwritten.apps/theming/lib/Listener/BeforePreferenceListener.php: IncrementeduserCacheBusterwhenprimary_coloris set (valid) or deleted so the stylesheet URL cache buster updates immediately.apps/theming/tests/Listener/BeforePreferenceListenerTest.phpcoveringprimary_colorvalidation anduserCacheBusterincrementation.Checklist
3. to review, feature component)stable32)AI (if applicable)