Skip to content

WAIT: Add toggle UX for workshop selection on story ideas#1853

Draft
maebeale wants to merge 7 commits into
mainfrom
copilot/enhance-workshop-dropdown-ux
Draft

WAIT: Add toggle UX for workshop selection on story ideas#1853
maebeale wants to merge 7 commits into
mainfrom
copilot/enhance-workshop-dropdown-ux

Conversation

@maebeale

Copy link
Copy Markdown
Collaborator

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.

Warning

WAIT — do not merge yet. Rebased onto latest main. During the rebase a conflict surfaced: main has since migrated the story-idea workshop selector to a dynamic remote-select (TomSelect remote search) field, while this PR is built on the older static @workshops dropdown. The rebase resolution kept this PR's static-dropdown + toggle approach and dropped main's remote-select for that field. This needs a product/architecture decision before merge — see the PR conversation for the recap.

Copilot AI and others added 7 commits June 22, 2026 07:55
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>
Resolve trailing whitespace from merge, remove duplicate closing tags
in form view, and update tests to use build instead of create where
workshop validation now prevents nil workshop + nil external title.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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