Skip to content

Add toggle UX for workshop selection on story ideas#1030

Open
Copilot wants to merge 6 commits intomainfrom
copilot/enhance-workshop-dropdown-ux
Open

Add toggle UX for workshop selection on story ideas#1030
Copilot wants to merge 6 commits intomainfrom
copilot/enhance-workshop-dropdown-ux

Conversation

Copy link
Contributor

Copilot AI commented Feb 15, 2026

What is the goal of this PR and why is this important?

Users need an intuitive way to enter custom workshop titles when submitting story ideas. Previously, both dropdown and text field were always visible, causing confusion about which to use.

How did you approach the change?

Frontend: Stimulus controller manages toggle between dropdown and text input

  • "New Workshop" option triggers field swap
  • X button clears and returns to dropdown
  • State preserved when editing records with external titles

Backend: Controller prepends virtual "New Workshop" option, converts workshop_id: "new" to nil

Validation: Custom validator ensures either workshop_id or external_workshop_title present

Code organization: Extracted view conditionals to helpers (workshop_selected_value, show_external_workshop_field?)

# Controller adds virtual option
new_workshop_option = OpenStruct.new(id: "new", type_name: "New Workshop")
@workshops = [ new_workshop_option ] + Workshop.order(:title).to_a

# Params handler converts sentinel value
permitted_params[:workshop_id] = nil if permitted_params[:workshop_id] == "new"

Anything else to add?

Model tests confirm validation logic. Request spec verifies "new" value handling. CodeQL scan clean.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 5 commits February 15, 2026 15:29
Co-authored-by: maebeale <7607813+maebeale@users.noreply.github.com>
Co-authored-by: maebeale <7607813+maebeale@users.noreply.github.com>
Co-authored-by: maebeale <7607813+maebeale@users.noreply.github.com>
Co-authored-by: maebeale <7607813+maebeale@users.noreply.github.com>
Co-authored-by: maebeale <7607813+maebeale@users.noreply.github.com>
Copilot AI changed the title [WIP] Add nice UX for Workshop dropdown on story ideas Add toggle UX for workshop selection on story ideas Feb 15, 2026
Copilot AI requested a review from maebeale February 15, 2026 15:46
@maebeale maebeale marked this pull request as ready for review February 15, 2026 21:36
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.

2 participants