Skip to content

Replace remote search selects with static dropdowns on story admin form#1264

Merged
maebeale merged 2 commits intomainfrom
maebeale/admin-story-dropdown
Mar 1, 2026
Merged

Replace remote search selects with static dropdowns on story admin form#1264
maebeale merged 2 commits intomainfrom
maebeale/admin-story-dropdown

Conversation

@maebeale
Copy link
Collaborator

@maebeale maebeale commented Feb 28, 2026

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

  • The remote-select AJAX search for story author and spotlighted facilitator on the admin story form was unreliable
  • Replace with static <select> dropdowns that load all available options upfront for a more dependable experience

How did you approach the change?

  • Added @people and @users instance variables in StoriesController#set_form_variables with alphabetical ordering via Arel.sql
  • @users loads all users with portal access, ordered by person name (nulls last) then email
  • @people loads all people ordered by first/last name (case-insensitive)
  • Replaced the remote-select Stimulus controller inputs with standard SimpleForm collection selects
  • Applied custom caret styling helpers (select_caret_class, custom_caret_style, select_caret_onchange) consistent with other dropdowns in the form

UI Testing Checklist

  • Navigate to admin story new/edit form
  • Verify "Story author" dropdown populates with all users and is alphabetically sorted
  • Verify "Story spotlighted facilitator" dropdown populates with all people and is alphabetically sorted
  • Verify selecting an author and facilitator saves correctly
  • Verify the caret styling updates on selection (gray when blank, dark when selected)

Anything else to add?

  • This removes the dependency on the remote-select Stimulus controller for these two fields

🤖 Generated with Claude Code

maebeale and others added 2 commits February 28, 2026 13:21
The remote-select AJAX search for story author and spotlighted facilitator
was unreliable. Switch to static <select> dropdowns populated with all
users/people, with sensible alphabetical ordering.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The form partial now uses @users and @people for static dropdown
collections. View specs render the partial directly without the
controller, so these instance variables must be assigned in the
test setup.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@maebeale maebeale changed the title Replace remote search selects with static dropdowns on story admin form HOLD: Replace remote search selects with static dropdowns on story admin form Mar 1, 2026
@maebeale maebeale changed the title HOLD: Replace remote search selects with static dropdowns on story admin form Replace remote search selects with static dropdowns on story admin form Mar 1, 2026
@maebeale maebeale merged commit 90b202a into main Mar 1, 2026
9 of 15 checks passed
@maebeale maebeale deleted the maebeale/admin-story-dropdown branch March 1, 2026 14:58
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.

1 participant