Skip to content

fix(ui): the selected radio option shows an empty circle - #329

Merged
sydevs-bot merged 8 commits into
mainfrom
claude/fix-323-radio-mark
Oct 25, 2026
Merged

sydevs-bot merged 8 commits into
mainfrom
claude/fix-323-radio-mark

Conversation

@sydevs-bot

@sydevs-bot sydevs-bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • The checked radio takes its card's on-colour, so the chosen date reads as chosen in both themes.
  • Joined: Ladle held every story in the light palette, which is what made dark-mode review of this impossible.

Change outline

Components — one recipe paints the card and its mark

The mark's accent was a constant; it is now a slot of the recipe that already decides the card's fill, so the two cannot disagree.

 RadioGroup                                    src/components/atoms/RadioGroup/RadioGroup.tsx
-  radioOption({ checked, highlight, isInvalid })            → <label> class
-  <input class="h-4 w-4 shrink-0 accent-primary">           # one accent, every state
+  radioOption({ checked, highlight, isInvalid })            → { card, mark }
+    checked           card bg-primary-9     mark accent-primary-foreground
+    unchecked         card border-gray-7    mark accent-primary
+    unchecked+tinted  card bg-primary-2     mark accent-primary
+    checked+invalid   card bg-danger-9      mark accent-danger-foreground

Flow — which element declares the palette in Ladle

The scoping pass emits the palette block's :root arm as a bare :where(.sy-atlas), so a second scope element re-declared the light ramp below <html>.

 <html class="sy-atlas dark">                  .ladle/components.tsx
   :where(.sy-atlas).dark        → --primary-9: 184 58% 60%
-  <main class="sy-atlas">                     # :where(.sy-atlas) → --primary-9: 184 58% 28%
+  <main class="sy-atlas dark">                # the .dark arm wins again, for the subtree
     every story

Preview

App: https://pr-329-sahajatlas.contact-c66.workers.dev — the branch alias, republished on every push. Cloudflare Pages serves the same build at https://claude-fix-323-radio-mark.sahajatlas.pages.dev.

  • The ticket's screen: /gb/south-east/brighton/163/register at 390×844 — the date cards, on real SahajCloud data.
  • ⚠ The route is the pathname there, not ?atlas=. The standalone shell mounts BrowserRouter over real paths (src/main.tsx), and the deploy falls back to the shell for any of them, while ?atlas= is the embed's parameter on a host page — this shell ignores it and shows the base countries view.
  • Playground: the design site publishes a branch preview too — Atoms / Inputs → Radio Group, where the theme toggle is step 2 below.

Test results

  • Lean gate: ✓ lint, typecheck, 148 files / 1758 tests
  • pnpm build ✓ (assert:css, assert:maps), pnpm size ✓ (standalone 310.6 / embed 312.4 / loader 2.8 KiB — unchanged), pnpm ladle:build ✓
  • Both new RadioGroup assertions and the scope pin watched failing against their reintroduced defects
  • Tailwind generates both new utilities: accent-color: var(--color-primary-foreground) and var(--color-danger-foreground) are in the emitted sheet

Manual verification

  1. On a deployed preview, open a class's /register at 390×844 and confirm the first date's mark is filled, in light and dark.
  2. In the playground, flip the theme toggle on any story and confirm the canvas and its components follow it.
  3. Submit the registration form with no date chosen: the cards go danger-red and the mark stays visible.

Notes for reviewer

  • Verified on the deploy, in both themes. The preview's /gb/south-east/brighton/163/register at 390×844, real data: the checked mark computes accent-color: rgb(255,255,255) on card rgb(30,107,113) in light, and rgb(0,0,0) on rgb(94,204,212) with atlas.theme set to dark. No console errors. (A routine checkout has no VITE_SAHAJCLOUD_API_KEY, so the local pass ran against the built playground's Views / Registration story instead.)
  • Why the Ladle commit is here: before it, <html> resolved --primary-9 to 184 58% 60% while the card below it resolved 184 58% 28% — the ticket asks for both themes, and the dark half could not be looked at.
  • Dismissed: accent-current on the input, which would follow the card for every future state too. It also recolours the unselected marks from brand teal to the card's text colour, which this ticket does not ask for. Worth considering separately.
  • Declined for the same reason: making Ladle's wrapper the published theme root via setThemeRoot. It moves the theme singleton for every story to fix a dev-only cascade.
Detail

Review passes: /simplify (4 lenses — all four converged on folding the second recipe into a slot, applied; the test-helper and read-hoisting nits applied in part), /code-review high (1 finding: the scope pin was not anchored to the wrapper element, fixed in 65b0913), /security-review (triggered by the scripts/[^/]*css path rule; no findings — no input, sink, origin or credential is touched). pr-review-toolkit is not installed here.

Why the accent is a token, not white: --primary-on is derived per tenant by the palette engine (buildScale's .contrast()), so a brand whose step 9 is pale gets a black mark rather than an invisible white one. --color-danger-foreground is a literal #ffffff, which is right against red-9 in both themes.

What the browser actually draws: Chromium paints a checked radio as a ring plus a disc in accent-color. With the accent equal to the card's fill, the disc vanishes and only the ring remains — the "empty circle" of the report, not a missing dot.

Closes #323

🤖 Generated with Claude Code

https://claude.ai/code/session_01SpTpcsB4MdWM9htwQxbWsh

The native mark is painted in `accent-color`, and the checked card fills with
the same `primary-9` solid the mark was accented with. Chromium then draws the
disc in the card's own colour, leaving a ring with nothing in it: the chosen
date read as highlighted but not chosen.

The accent now follows the card — `primary-foreground` on the primary solid,
`danger-foreground` on the danger one — which the tenant palette already
derives to be readable against step 9, so it holds in both themes and under a
tenant palette.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SpTpcsB4MdWM9htwQxbWsh
…lass

The scoping pass emits the palette block's `:root` arm as a bare
`:where(.sy-atlas)`, so any element carrying the scope class and no theme class
re-declares the LIGHT palette for everything below it. Ladle puts the scope
class on both `<html>` and the story wrapper, so the wrapper overrode the
`dark` class on `<html>`: every story rendered light whatever the toolbar said,
and dark-mode review was impossible.

Measured on the radio story before this: `<html>` resolved `--primary-9` to
`184 58% 60%`, the card below it to `184 58% 28%`.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SpTpcsB4MdWM9htwQxbWsh
The review pass found the mark's colours restating a matrix the card recipe
already declared, 10 lines apart, with `highlight` present in one and absent
from the other. One slotted recipe is the shape every other atom with a mark
uses (Checkbox, ToggleGroup, Chip), and it leaves no way for the two halves to
disagree.

The specs read the marks off the rendered `checked` attribute rather than a
fixture index, and the scope pin reads the wrapper's whole class list rather
than two adjacent arguments, so a re-wrap or a reordering cannot redden it.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SpTpcsB4MdWM9htwQxbWsh
Read unanchored, the pin took the file's first `clsx(` call. In a file that is
about theming, another one naming a theme would answer for the wrapper and let
the deleted class pass.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SpTpcsB4MdWM9htwQxbWsh
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Deploying sahajatlas with  Cloudflare Pages  Cloudflare Pages

Latest commit: 173b84b
Status: ✅  Deploy successful!
Preview URL: https://9824e31d.sahajatlas.pages.dev
Branch Preview URL: https://claude-fix-323-radio-mark.sahajatlas.pages.dev

View logs

@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Oct 25, 2026
@sydevs-bot

sydevs-bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 no session running

recent dispatches
  • 20:23Z address-review · attempt 1 · session · done
  • 20:23Z address-review · attempt 1 · session
  • 20:14Z review-pr · attempt 1 · session · done
  • 20:14Z review-pr · attempt 1 · session

Written by the sydevs dispatcher. Sessions never edit this comment.

@sydevs-bot sydevs-bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🧐 Adversarial review

The diff matches the ticket. One colour bug, fixed where the colour is decided. Making the mark a slot of the card's own recipe is the right shape — the two cannot disagree again, and it is the tv slots idiom ToggleGroup, Slider and the Switch already use. The Ladle commit earns its place: :where(.sy-atlas) does emit a bare light arm, so the second scope element re-declared the light palette, and the ticket's dark half could not be looked at without it.

One gap has no diff line. The body says "Preview pending" and names a pr-329 Workers alias, but this PR's live preview is Cloudflare Pages: https://1c62b1bc.sahajatlas.pages.dev, green at 20:11Z. should-fix — put that link in the body. It serves real data, so the ticket's /register check is reachable there, not only in a local Chromium. But ?atlas=/gb/south-east/brighton/163/register left me on the base countries view, so that route needs another form. The playground has no per-PR preview.

Findings

  • consider — RadioGroup.tsx:26, the comment's last line restates the recipe under it.

What was checked. #323 and the body against the diff (5 files, +86/-13). Read: RadioGroup.tsx, .ladle/components.tsx, use-theme.ts, palette.ts, the @theme block. --primary-on is foregroundFor(colord({ h, s, l: l9 })), WCAG black-or-white against step 9 itself, so the mark contrasts under any tenant palette. The deployed sheet carries .accent-primary{accent-color:var(--color-primary)}, which is hsl(var(--primary-9)). Both new utilities generate too. Every accent-* and bg-primary-9/bg-danger-9 call site: RadioGroup is the only native mark, so no sibling stayed outside. CHANGELOG sits under [Unreleased] / Fixed. No embedding.md surface moved. The accent-current dismissal holds — it recolours unselected marks too.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot sydevs-bot added bot:working Lock: a cloud session is running on this item. Removed when it ends. and removed bot:working Lock: a cloud session is running on this item. Removed when it ends. labels Oct 25, 2026
The last sentence restated the recipe below it: each fill already declares
its mark accent beside the card's, so a reader can see that one palette
repaints both. Lines 22-25 carry the `accent-color` mechanism, which is
the part nobody can re-derive from the code.

Addresses the review thread on RadioGroup.tsx:26.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01GVn6kFa2oGBDdYoKrLkp8r
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
sahajatlas-design 173b84b Oct 25 2026, 08:33 PM

@sydevs-bot

sydevs-bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor Author

Base merge — origin/main in clean, 51489b3. Generated types only.

Adopted — RadioGroup.tsx:26: the comment ends at (#323). now (173b84b).

Review body (should-fix) — "put that link in the body… that route needs another form." Both done in the body. The preview is the branch alias https://pr-329-sahajatlas.contact-c66.workers.dev, and the route is the pathname /gb/south-east/brighton/163/register — the standalone shell mounts BrowserRouter (src/main.tsx), so ?atlas=, the embed's parameter on a host page, lands on the countries view. Checked there at 390×844 on real data: the checked mark computes accent-color: rgb(255,255,255) on card rgb(30,107,113) in light and rgb(0,0,0) on rgb(94,204,212) in dark.

Rebutted — the playground does publish a branch preview. The body links its Radio Group story.

Lean gate green on the merged head.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Oct 25, 2026
@sydevs-bot
sydevs-bot marked this pull request as ready for review October 25, 2026 20:37
@sydevs-bot
sydevs-bot requested a review from Ardnived October 25, 2026 20:37
@sydevs-bot
sydevs-bot enabled auto-merge October 25, 2026 20:37
@sydevs-bot
sydevs-bot added this pull request to the merge queue Oct 25, 2026
Merged via the queue into main with commit 5bf8186 Oct 25, 2026
43 checks passed
@sydevs-bot
sydevs-bot deleted the claude/fix-323-radio-mark branch October 25, 2026 20:54
@sydevs-bot sydevs-bot moved this from Revising to Done in SYDevelopers Technical Roadmap Oct 25, 2026
sydevs-bot pushed a commit that referenced this pull request Oct 25, 2026
#329 landed its own `### Fixed` entry and link reference at the same two
positions this branch writes to. Both entries are wanted: the radio mark and
the drawer scroll are unrelated host-visible fixes. Kept both, #329 first to
hold the section's descending PR order.

No other file overlaps — #329 touched RadioGroup, the ladle wrapper and the
scope spec, none of which this branch reads.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015WGofpx29gVMbk8UboQ8eB
sydevs-bot pushed a commit that referenced this pull request Oct 25, 2026
CHANGELOG.md was the only conflict: both sides appended a Fixed entry
and a link reference at the same position. Kept both, #329 first to hold
the section's descending order.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01YSji2Rg7xCVgqHownjnZzu
sydevs-bot pushed a commit that referenced this pull request Oct 25, 2026
One conflict, in CHANGELOG.md § Unreleased → Fixed: both sides added a new
entry at the head of the section. Both entries are kept, this PR's #324 above
main's #329, since this one lands later.

main's #329 adds a case to scripts/postcss-scope-widget.test.ts through a
readRepoSource call that spec already made, so it takes no further slot in the
per-edit selection this branch moved to its ceiling of 16.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012fXJ8cXFDNxJUqYbjzhsTm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

fix(ui): the selected radio option shows an empty circle

3 participants