Skip to content

fix(ui-form-field): always display messages at the top of form groups - #2733

Open
matyasf wants to merge 1 commit into
masterfrom
fix_group_message
Open

matyasf wants to merge 1 commit into
masterfrom
fix_group_message

Conversation

@matyasf

@matyasf matyasf commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • The v2 FormFieldLayout now shows every message type above the controls in a group, not just errors. This covers RadioInputGroup, CheckboxGroup, and FormFieldGroup.

Test Plan

  • In the docs app, open RadioInputGroup, CheckboxGroup, and FormFieldGroup. Check that hint and success messages show above the controls in both stacked and inline layouts.
  • Check that error messages still show above the controls and keep the small gap before the first control.
  • Check that non-group form fields (e.g. TextInput) still show messages below the input.

Fixes INSTUI-5199

🤖 Generated with Claude Code

@matyasf matyasf self-assigned this Sep 29, 2026
@matyasf matyasf changed the title fix(ui-form-field): always display messages at the top of form groups (radio group, checkbox group, formFieldGroup) fix(ui-form-field): always display messages at the top of form groups Sep 29, 2026
@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://instructure.design/pr-preview/pr-2733/

Built to branch gh-pages at 2026-09-30 15:12 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Visual regression report

Cypress suite: ✅ Passing

Visual diff: ⚠️ Changes detected.

Status Count
Unchanged 92
Changed 7
New 0
Removed 0

Accessibility (axe): ✅ No violations.

📊 View full report — click a screenshot's ⚠ badge to see each violation boxed on the image, with the offending element named and contrast failures shown as color swatches.

Diff images (7)

badge-canvas.png — 1573 pixels differ

checkboxgroup-canvas.png — 5379 pixels differ

checkboxgroup-dark.png — 5249 pixels differ

checkboxgroup-light.png — 4787 pixels differ

form-errors-canvas.png — 37228 pixels differ

form-errors-dark.png — 38391 pixels differ

form-errors-light.png — 37548 pixels differ

Baselines come from the visual-baselines branch. They refresh on every merge to master. The Cypress suite line covers the a11y and console-error assertions — a ❌ there means the suite found real issues even if the visual diff is clean.

github-actions Bot pushed a commit that referenced this pull request Sep 29, 2026
@matyasf
matyasf requested a review from git-nandor September 29, 2026 12:32
gridArea: 'controls',
// add a small margin between the message and the controls
...(hasMessages && hasErrorMsgAndIsGroup && { marginTop: '0.375rem' }),
...(hasMessages && hasMsgAndIsGroup && { marginTop: '0.375rem' }),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In index.tsx:100, hasMsgAndIsGroup = hasMessages && !!isGroup will now apply to all message types, causing the layout of the screenreader-only variant to shift.

The example below demonstrates this:

<Flex gap="large" alignItems="start">
  <div>
    <RadioInputGroup name="fruit1">
      <RadioInput label="Apple" value="apple" />
    </RadioInputGroup>
  </div>
  <div>
    <RadioInputGroup
      name="fruit2"
      messages={[
        { type: 'screenreader-only', text: 'Pick one option' }
      ]}
    >
      <RadioInput label="Apple" value="apple" />
    </RadioInputGroup>
  </div>
</Flex>

suggestion:

      ...(hasNonEmptyMessages && hasMsgAndIsGroup && { marginTop: '0.375rem' }),

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

good catch, I've fixed this case (also refactored the logic here, it was getting chaotic)

github-actions Bot pushed a commit that referenced this pull request Sep 30, 2026
… (radio group, checkbox group, formFieldGroup)

Before, a grouped field only moved its messages above the controls when one of them was an
error. Hint and success messages stayed below. Now any message in a group renders above the
controls, so the layout stays the same whatever the message type.

Fixes INSTUI-5199

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@matyasf
matyasf requested a review from git-nandor September 30, 2026 15:11
github-actions Bot pushed a commit that referenced this pull request Sep 30, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants