AO3-7524 Site skin dropdown shows Default when using a parent-only skin - #5961
AO3-7524 Site skin dropdown shows Default when using a parent-only skin#5961evanwhitt wants to merge 3 commits into
Conversation
The 'Your site skin' select on the preferences page is populated from skins matching the usable scope, which excludes parent-only (unusable) skins. If the user's current skin preference points to a parent-only skin, the select falls back to displaying 'Default' even though the skin is actually in use. Include the user's current preference skin in the available skins list even if it is unusable, so the select shows the skin actually in use.
There was a problem hiding this comment.
Pull request overview
Updates preferences skin selection behavior so the “Your site skin” dropdown correctly reflects a user’s currently selected skin even when that skin is marked parent-only (and therefore normally filtered out of the chooser options).
Changes:
- Adjust
PreferencesController#available_skinsto append the user’s current site skin to the available options when it’s not otherwise included. - Add controller spec coverage to ensure a parent-only current skin is still present in
@available_skins.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| app/controllers/preferences_controller.rb | Includes the current skin in the available skins list even if it’s parent-only. |
| spec/controllers/preferences_controller_spec.rb | Adds a regression test ensuring the current parent-only skin appears in available skins. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| skins = (@user.skins.site_skins.usable + | ||
| Skin.approved_skins.site_skins.usable).uniq | ||
| current_skin = @user.preference.skin | ||
| skins << current_skin if current_skin&.type.nil? && skins.exclude?(current_skin) |
|
sorry didnt know how to disable this stupid GitHub feature |
|
Hi, Evan W! Thank you so much for this pull request. Someone will be along to review it soon. (Since we generally don't allow the use of AI, we've now disabled Copilot reviews for this project, so hopefully you won't run into any issues with it going forward.) I've updated the Jira issue status to In Review so no one mistakenly creates a duplicate pull request. If you'd like the ability to comment on, assign, and transition issues in the future, you're welcome to create a Jira account! It makes things a bit easier for us on the organizational side if the Full Name on your Jira account either closely matches the name you'd like us to credit in the release notes or includes it in parentheses, e.g. "Nickname (CREDIT NAME)." Once you've done that (or if you've already done it -- Jira has been unreliable about showing us new accounts in the admin panel lately), you can either reply here or send an email to otw-coders@transformativeworks.org with your account name and email address and we'll set up the permissions for you. Thanks again for contributing! If you have any questions, you can contact us at the same email address listed above. |
|
Thank you so much! I didn't know how to disable it — it's been clogging up my PR requests recently. Here's my account info, hopefully this is enough:
Thanks you so much once again! |
|
I've assigned this issue to you and your Jira permissions should be all set next time you log in! And just as a heads up, if you're having trouble with Copilot reviews on other repositories, you might be able to disable them for your account by going here: https://github.com/settings/copilot/features (It depends on whether you have it enabled for your account or if it's they're coming from the projects you're contributing to.) |
|
Oh thank you so much! I appreciate it dearly, I disabled it now and hopefully all my future PRs will no longer have this issue. Thank you so much again |
Co-authored-by: Pablo Monfort <pmonfort@gmail.com>
6ce473a to
cff9e4d
Compare
Pull Request Checklist
AO3-1234 Fix thing)Issue
https://otwarchive.atlassian.net/browse/AO3-7524
Purpose
The "Your site skin" dropdown shows "Default" whenever your current skin is parent-only, even though you're actually using a different one.
Parent-only skins get filtered out of the dropdown options, but your preference can still point to one. Since it's not in the list, the browser just shows the first option ("Default").
Fix: include your current skin in the dropdown even when it's parent-only.
Testing Instructions
a { color: #639; }).Credit
Evan W (he/him) [b1ume]