Skip to content

AO3-4052 Require choosing a pseud option when orphaning - #6009

Open
pmonfort wants to merge 2 commits into
otwcode:masterfrom
pmonfort:AO3-4052
Open

pmonfort wants to merge 2 commits into
otwcode:masterfrom
pmonfort:AO3-4052

Conversation

@pmonfort

Copy link
Copy Markdown
Contributor

Pull Request Checklist

Issue

https://otwarchive.atlassian.net/browse/AO3-4052

Purpose

The orphan page preselected "Take my pseud off as well", so it was easy to orphan without reading the options. This PR:

  • Removes the default, so neither option is checked when the page loads.
  • Makes OrphansController#create reject the form when no option (or an unexpected value) is submitted, with an error and a redirect back to the orphan page.
  • Reworded the options to "Remove my pseud" / "Keep my pseud", as suggested in the issue comments, and gave the group a visible prompt ("What should happen to your pseud?") plus a legend for screen readers, following the pattern used in the work form.

The partial is shared by the work, series, pseud and account orphan pages, so all four are affected.

Testing Instructions

  1. Log in, open a work you created, click Edit, then "Orphan Work".
  2. Neither option should be selected. The group should read "What should happen to your pseud?" with the options "Remove my pseud" and "Keep my pseud".
  3. Click "Yes, I'm sure" without choosing: you should stay on the orphan page with the error "You must choose whether to remove or keep your pseud." and the work should still be yours.
  4. Choose "Keep my pseud" and confirm: the work is orphaned with a copy of your pseud (<pseud> (orphan_account) in the byline, unless the work is in an anonymous collection).
  5. Repeat with another work and "Remove my pseud": the byline shows orphan_account.
  6. The same check applies on the series, pseud and whole-account orphan pages.
Screenshot 2026-08-28 at 9 47 23 PM

Credit

Pablo Monfort (he/him)

@sarken

sarken commented Sep 21, 2026

Copy link
Copy Markdown
Collaborator

Assigning myself as reviewer on this since I have started, but it might be a few days because I want to poke at the form layout a bit!

@sarken sarken left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for realizing the form needed some context with this change! 😆 I looked at it a bit and I think I found a slightly simpler design pattern to use for it, even though it involves a little more work.

Comment on lines +153 to +155
And I view the work "Undecided"
And I follow "Edit"
And I follow "Orphan Work"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think the three of these can be replaced with this step:

When /^I begin orphaning the work "([^"]*)"$/ do |name|
step %{I wait 1 second}
step %{I edit the work "#{name}"}
step %{I follow "Orphan Work"}
step %{I should see "Orphan Works"}
end

@@ -1,11 +1,11 @@
When /^I choose to take my pseud off$/ do
step %{I choose "Take my pseud off as well"}
step %{I choose "Remove my pseud"}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

How about updating these step definitions to use choose("use_default_false") and choose("use_default_true") while we're here? We do prefer the user-facing label text in the feature files themselves, but the IDs are fine and usually less brittle for the step definitions.

Comment on lines +4 to +16
<fieldset>
<legend><%= t(".prompt") %></legend>
<ul>
<li>
<%= radio_button_tag "use_default", "true" %>
<%= label_tag "use_default_true", t(".remove_pseud") %>
</li>
<li>
<%= radio_button_tag "use_default", "false" %>
<%= label_tag "use_default_false", t(".keep_pseud") %>
</li>
</ul>
</fieldset>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think we can simplify this form considerably by just using this fieldset and no dl (and changing the .prompt key to .legend while we're there).

In order to make the legend visible, though, we'll need to add the classes single simple post to the form elements that use this partial.

Here's a preview of how the form should look once those changes are made:
The form for choosing a pseud, with a white background, grey border, and visible legend text.

Lastly, we should update the comment on the CSS for our single design pattern to say /* mods: SINGLE for prominent simple forms consisting of one text input (e.g., on the blocked user page) or group of checkboxes or radios (e.g., on the orphan work page) */

Comment on lines +213 to +220
it "rejects values other than true or false" do
post :create, params: { work_ids: [work], use_default: "maybe" }

it_redirects_to_with_error(
new_orphan_path(work_ids: [work.id]), error
)
expect(work.reload.users).to include(user)
end

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Since this is slightly different from providing no option, let's pull this out into its own context, like context "when invalid pseud option is provided".

This branch has not been deployed

No deployments
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.

2 participants