Skip to content

Conversation

albertchae
Copy link
Contributor

@albertchae albertchae commented Jul 20, 2025

Summary of the problem

Follow up to UX issues noted in #10982 (comment)

  • reader / member / manager does not affect visibility of the contract tool
  • select dropdown has 3 options, one of them being to select despite being a binary option.
    • the select option shows the email box and should probably be removed
    • this same behavior occurs on the create event page

Describe your changes

reader / member / manager does not affect visibility of the contract tool

Now we only show the contract sub form if the invited user is a manager. This raises a small issue where you could have Manager selected, then set them to be a contract signee, then change the role to Reader or Member and try to submit. This would do the right thing and result in an error, but I think is confusing UX, so I changed the backend to only honor the is_signee field when Manager is the selected role.

Screenshot 2025-07-20 at 9 49 31 AM

An alternative would have been to clear the contract signee form in the frontend when switching roles, but I think sanitizing params in the backend was easier in this case.

I didn't realize we were using alpinejs for this form, we might want to consider removing the stimulus controller I added for hiding and using alpinejs for that too.

the select option shows the email box and should probably be removed

We now only show the cosigner option when "Contract Signee" is selected. This was implemented by changing form_hide_field_controller to take the option we want to show the conditional field on, not the ones we want to hide on.

select dropdown has 3 options, one of them being to select despite being a binary option.

This one I left as is for now as it might be intentional/desired behavior.

  • On the regular organizer invite flow, we are not setting a default option which would prompt the user to pick one.
  • In create event, we default to contract signee since the first member of an event is probably a signee. Arguably we could remove the prompt option here but that seems like unnecessary complexity.
Screenshot 2025-07-20 at 10 03 21 AM

@garyhtou can you confirm whether this is fine, or should we consider setting a default option for the regular invite flow? This would make it easier to remove the prompt option in both places we are using this

This way we can show the cosigner email field only when "Contract Signee" is selected
and not when the prompt option (or "won't sign the contract") is currently selected
We were still protected from this issue by
https://github.com/hackclub/hcb/blob/9c9a8cbca4c8b5b512e998d07b1597030e8f9cd9/app/models/concerns/organizer_position/has_role.rb#L21-L26

But now that the UI hides the contract signee question unless you are
inviting a manager, this improves the UX if you happen to be on manager,
selected contract signee, then change to reader or member without
changing the contract signee status.
@garyhtou
Copy link
Member

That behavior is perfect! Thank you

@garyhtou garyhtou requested a review from Luke-Oldenburg July 21, 2025 16:01
Copy link
Contributor

@Luke-Oldenburg Luke-Oldenburg left a comment

Choose a reason for hiding this comment

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

lgtm!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants