mirror of
https://github.com/we-promise/sure.git
synced 2026-05-24 21:14:56 +00:00
CodeRabbit P1+P2 review on #1840:
1. button.rb: `merged_opts.delete(:href)` always returned nil because
Buttonish#initialize strips :href from opts into @href, so the
`if href.blank?` guard was ALWAYS true. Every DS::Button rendered via
button_to (the href branch) got `type="button"` on the inner button,
breaking submission of those button_to-generated forms (e.g.
imports/_ready.html.erb publish button, imports/_failure.html.erb
try-again button). Drop the local `href = merged_opts.delete(:href)`
so the guard now reads the @href reader, leaving the href branch's
HTML default intact.
2. settings/profiles/show.html.erb: the Save button is rendered with
`render DS::Button.new(...)` inside `styled_form_with` (not via
form.submit), so the StyledFormBuilder#submit type-pin from
624e9794 doesn't cover it. Pass `type: :submit` explicitly so the
profile form submits again under the default-type-button policy.
3. base.css: replace raw `outline-gray-900` / `outline-white` with the
established alpha-ring focus pattern
(focus-visible:ring-alpha-black-300 + theme-dark:ring-alpha-white-300)
already used by app/components/settings/provider_card.html.erb and
sure-design-system/components.css. Keeps a11y focus ring while using
DS tokens.
38 lines
873 B
CSS
38 lines
873 B
CSS
@layer base {
|
|
button {
|
|
@apply cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-alpha-black-300;
|
|
|
|
@variant theme-dark {
|
|
@apply focus-visible:ring-alpha-white-300;
|
|
}
|
|
}
|
|
|
|
hr {
|
|
@apply text-gray-200;
|
|
}
|
|
|
|
/* We control the sizing through DialogComponent, so reset this value */
|
|
dialog:modal {
|
|
max-width: 100dvw;
|
|
max-height: 100dvh;
|
|
}
|
|
|
|
details>summary::-webkit-details-marker {
|
|
@apply hidden;
|
|
}
|
|
|
|
details>summary {
|
|
@apply list-none;
|
|
}
|
|
|
|
input[type='radio'] {
|
|
@apply border-gray-300 text-indigo-600 focus:ring-indigo-600;
|
|
/* Default light mode */
|
|
|
|
@variant theme-dark {
|
|
/* Dark mode radio button base and checked styles */
|
|
@apply border-gray-600 bg-gray-700 checked:bg-blue-500 focus:ring-blue-500 focus:ring-offset-gray-800;
|
|
}
|
|
}
|
|
}
|