Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/components/Form/BooleanField/BooleanFieldCheckbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export type BooleanFieldCheckboxProps = Simplify<
>;

export const BooleanFieldCheckbox = ({
description,
disabled,
error,
label,
Expand All @@ -36,6 +37,7 @@ export const BooleanFieldCheckbox = ({
}}
/>
<Label htmlFor={name}>{label}</Label>
<FieldGroup.Description description={description} />
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Inconsistent placement compared to BooleanFieldRadio.

In this component, FieldGroup.Description is rendered inside FieldGroup.Row after the Label, but in BooleanFieldRadio.tsx (line 59), it's placed before the FieldGroup.Row elements. 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

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<FieldGroup.Description description={description} />
<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>
🤖 Prompt for AI Agents
In src/components/Form/BooleanField/BooleanFieldCheckbox.tsx around line 40, the
FieldGroup.Description is currently rendered inside FieldGroup.Row after the
Label which is inconsistent with BooleanFieldRadio; move the
FieldGroup.Description out of/above the FieldGroup.Row so it is rendered before
the Row (matching the radio variant), preserving the same description prop and
any surrounding conditional rendering or styling so layout and semantics stay
identical to BooleanFieldRadio.

</FieldGroup.Row>
<FieldGroup.Error error={error} />
</FieldGroup>
Expand Down
6 changes: 4 additions & 2 deletions src/components/Form/BooleanField/BooleanFieldRadio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export type BooleanFieldRadioProps = Simplify<
>;

export const BooleanFieldRadio = ({
description,
disabled,
error,
label,
Expand Down Expand Up @@ -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"
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Undocumented className changes.

The PR title and AI summary indicate only adding description functionality, but these lines introduce "text-muted-foreground font-normal" classNames that weren't mentioned. Confirm these styling changes are intentional.

Also applies to: 74-74

🤖 Prompt for AI Agents
In src/components/Form/BooleanField/BooleanFieldRadio.tsx around lines 64 and
74, two className additions ("text-muted-foreground font-normal") were
introduced without documentation or mention in the PR; either confirm these
styling changes are intentional and document them in the component/PR
description, or revert them. If the style should be optional, expose a prop
(e.g., descriptionClassName or muted) and apply the new classes conditionally,
and update the component JSDoc/README and PR summary to reflect the styling
change.

htmlFor={`${name}-true`}
>
{options?.true ?? t('form.radioLabels.true')}
Expand All @@ -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')}
Expand Down