HOLD: Tint scholarship and CE credit cards to match their toggle state#1861
Draft
maebeale wants to merge 1 commit into
Draft
HOLD: Tint scholarship and CE credit cards to match their toggle state#1861maebeale wants to merge 1 commit into
maebeale wants to merge 1 commit into
Conversation
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>
maebeale
commented
Jun 22, 2026
| @@ -13,11 +15,20 @@ export default class extends Controller { | |||
| } | |||
|
|
|||
Collaborator
Author
There was a problem hiding this comment.
🤖 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the goal of this PR and why is this important?
How did you approach the change?
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.hasCheckboxTargetand leaves the static themed tint in place.Anything else to add?
border-teal-200is the one new Tailwind utility; the rest were already in use. It's referenced from the ERB, so production/CI asset builds compile it.