Skip to content

AO3-7524 Site skin dropdown shows Default when using a parent-only skin - #5961

Open
evanwhitt wants to merge 3 commits into
otwcode:masterfrom
evanwhitt:fix-parent-only-skin-preferences
Open

AO3-7524 Site skin dropdown shows Default when using a parent-only skin#5961
evanwhitt wants to merge 3 commits into
otwcode:masterfrom
evanwhitt:fix-parent-only-skin-preferences

Conversation

@evanwhitt

@evanwhitt evanwhitt commented Aug 3, 2026

Copy link
Copy Markdown

Pull Request Checklist

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

  1. Log in and create a site skin with some valid CSS (e.g. a { color: #639; }).
  2. Open the "Edit skin" page for the skin in a new tab.
  3. Open Advanced skin options, enable the "Parent only" condition, and submit.
  4. Return to the first tab and click "Use".
  5. Go to Preferences (Hi, username! > My Preferences).
  6. Verify the "Your site skin" select shows the skin being used, not "Default".
  7. Verify selecting a different skin from the dropdown and saving still works as before.

Credit

Evan W (he/him) [b1ume]

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.
Copilot AI review requested due to automatic review settings August 3, 2026 02:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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_skins to 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)
@evanwhitt evanwhitt changed the title AO3-7524 Show current skin in preferences even when parent-only AO3-7524 Site skin dropdown shows Default when using a parent-only skin Aug 3, 2026
@evanwhitt

Copy link
Copy Markdown
Author

sorry didnt know how to disable this stupid GitHub feature

@sarken

sarken commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

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.

@evanwhitt

Copy link
Copy Markdown
Author

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!

@sarken

sarken commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

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.)

@evanwhitt

Copy link
Copy Markdown
Author

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

Comment thread app/controllers/preferences_controller.rb Outdated
Co-authored-by: Pablo Monfort <pmonfort@gmail.com>
@evanwhitt
evanwhitt force-pushed the fix-parent-only-skin-preferences branch from 6ce473a to cff9e4d Compare August 15, 2026 23:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants