Skip to content

HOLD: Tint scholarship and CE credit cards to match their toggle state#1861

Draft
maebeale wants to merge 1 commit into
mainfrom
maebeale/style-toggle-box-color
Draft

HOLD: Tint scholarship and CE credit cards to match their toggle state#1861
maebeale wants to merge 1 commit into
mainfrom
maebeale/style-toggle-box-color

Conversation

@maebeale

Copy link
Copy Markdown
Collaborator

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

  • On the event-registration edit screen, the Scholarship and CE credits cards previously colored only the toggle track when "Requested" was on, leaving the rest of the card neutral white.
  • A requested scholarship or CE credit was easy to miss at a glance; the request status should read from across the card, not just the small switch.

How did you approach the change?

  • Moved each card's Stimulus controller (scholarship-requested, ce-credit-requested) up onto the <section> so it can tint the whole box, not just the toggle.
  • refresh() now mirrors the existing three-state logic onto the card itself: theme color when saved-on (fuchsia for scholarship, teal for CE), amber while the choice is pending (changed but unsaved), neutral white when off.
  • Rendered the initial tint server-side so the correct color shows on load with no flash before Stimulus connects.
  • An already-awarded scholarship has no toggle, so the controller guards on hasCheckboxTarget and leaves the static themed tint in place.

Anything else to add?

  • Purely presentational — no model, controller, or behavior changes.
  • border-teal-200 is the one new Tailwind utility; the rest were already in use. It's referenced from the ERB, so production/CI asset builds compile it.
  • On HOLD pending the registration-edit redesign settling / design sign-off — opened as a draft so it's visible but not yet up for review.

Coloring only the toggle track left the surrounding card neutral, so a
requested scholarship or CE credit was easy to miss at a glance. Mounting
each card's Stimulus controller on the <section> lets it tint the whole
box to mirror the toggle: theme color when saved-on, amber while pending,
neutral when off. An already-awarded scholarship keeps a static themed
tint since its toggle is gone.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@@ -13,11 +15,20 @@ export default class extends Controller {
}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

🤖 From Claude: Controller moved from the <label>/inner div up to the <section> so it can tint the whole card. This hasCheckboxTarget guard matters because an already-awarded scholarship renders no toggle — the controller still mounts, so without the guard refresh() would throw and clobber the server-rendered tint.

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