-
Notifications
You must be signed in to change notification settings - Fork 2
feat: add description in boolean field #75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,6 +24,7 @@ export type BooleanFieldRadioProps = Simplify< | |
| >; | ||
|
|
||
| export const BooleanFieldRadio = ({ | ||
| description, | ||
| disabled, | ||
| error, | ||
| label, | ||
|
|
@@ -55,11 +56,12 @@ export const BooleanFieldRadio = ({ | |
| value={stringifyBoolean(value)} | ||
| onValueChange={handleValueChange} | ||
| > | ||
| <FieldGroup.Description description={description} /> | ||
| <FieldGroup.Row> | ||
| <RadioGroup.Item id={`${name}-true`} value="true" /> | ||
| <Label | ||
| aria-disabled={disabled || readOnly} | ||
| className="font-normal text-muted-foreground" | ||
| className="text-muted-foreground font-normal" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Undocumented className changes. The PR title and AI summary indicate only adding description functionality, but these lines introduce Also applies to: 74-74 🤖 Prompt for AI Agents |
||
| htmlFor={`${name}-true`} | ||
| > | ||
| {options?.true ?? t('form.radioLabels.true')} | ||
|
|
@@ -69,7 +71,7 @@ export const BooleanFieldRadio = ({ | |
| <RadioGroup.Item id={`${name}-false`} value="false" /> | ||
| <Label | ||
| aria-disabled={disabled || readOnly} | ||
| className="font-normal text-muted-foreground" | ||
| className="text-muted-foreground font-normal" | ||
| htmlFor={`${name}-false`} | ||
| > | ||
| {options?.false ?? t('form.radioLabels.false')} | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent placement compared to BooleanFieldRadio.
In this component,
FieldGroup.Descriptionis rendered insideFieldGroup.Rowafter the Label, but inBooleanFieldRadio.tsx(line 59), it's placed before theFieldGroup.Rowelements. This creates inconsistent visual layouts between the two variants.Apply this diff to align with the radio variant's placement (before FieldGroup.Row):
<FieldGroup name={name}> + <FieldGroup.Description description={description} /> <FieldGroup.Row> <Checkbox checked={Boolean(value)} disabled={disabled || readOnly} id={name} name={name} onCheckedChange={(value) => { if (typeof value === 'boolean') { setValue(value); } }} /> <Label htmlFor={name}>{label}</Label> - <FieldGroup.Description description={description} /> </FieldGroup.Row>📝 Committable suggestion
🤖 Prompt for AI Agents