Skip to content

fix(ui-text-input,ui-file-drop,ui-number-input): small visual error state fixes - #2825

Merged
matyasf merged 3 commits into
masterfrom
fix/error-state-visuals
Dec 3, 2026
Merged

matyasf merged 3 commits into
masterfrom
fix/error-state-visuals

Conversation

@matyasf

@matyasf matyasf commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Select and SimpleSelect shows now red error border all the time there is an error.
  • FileDrop shows now red error border in error state.
  • NumberInput: shows now red error focus ring in error state.

Test Plan

  • Open the Error messages example in docs/guides/forms.md and check that SimpleSelect, FileDrop and NumberInput show the red border or focus ring, including in dark mode.
  • Drag a file over a FileDrop and check the accepted and rejected borders. Check a disabled FileDrop looks dimmed.

Fixes INSTUI-5276

🤖 Generated with Claude Code

@matyasf matyasf self-assigned this Nov 27, 2026
@github-actions

github-actions Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.2

QR code for preview link

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

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

github-actions Bot pushed a commit that referenced this pull request Nov 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Visual regression report

Cypress suite: ✅ Passing

Visual diff: ⚠️ Changes detected.

Status Count
Unchanged 102
Changed 9
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 (9)

filedrop-canvas.png — 5533 pixels differ

filedrop-dark.png — 6032 pixels differ

filedrop-light.png — 6008 pixels differ

form-errors-canvas.png — 1046 pixels differ

form-errors-dark.png — 557 pixels differ

form-errors-light.png — 558 pixels differ

select-canvas.png — 1896 pixels differ

select-dark.png — 1794 pixels differ

select-light.png — 1792 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.

Comment on lines -42 to -51
params: StyleParams,
_sharedTokens: SharedTokens
props: FileDropProps,
_sharedTokens: SharedTokens,
state: FileDropStyleProps
): FileDropStyle => {
const {
height,
functionallyDisabled,
visuallyDisabled,
dragRejected,
dragAccepted
} = params

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.

this component was buggy, tried to read state from props

@matyasf
matyasf requested review from HerrTopi and balzss November 27, 2026 15:39

@balzss balzss left a comment

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.

Some of the prop combinations seem to work incorrectly:

1. Readonly success border

<TextInput
  renderLabel="Username"
  interaction="readonly"
  forceMessages
  messages={[{ type: 'success', text: 'Username is available' }]}
/>

Expected: a green border, the same as an enabled input with a success message.
Actual: the success message shows, but the border stays the gray readonly color.

2. Readonly focus ring and aria-invalid

<TextInput
  renderLabel="Email"
  interaction="readonly"
  messages={[{ type: 'error', text: 'Enter a valid email' }]}
/>

Tab into the field.
Expected: the message is hidden, so no error state: a normal focus ring and no aria-invalid.
Actual: no message and a gray border, but the focus ring is red and the input has aria-invalid="true", so screen readers announce "invalid" with nothing explaining why.

3. Where case 2 happens in real code

<TextInput
  renderLabel="Email"
  interaction={isEditing ? 'enabled' : 'readonly'}
  messages={errors.email}
/>

A form with a view mode. If errors.email still holds an error when the form switches to view mode, the field ends up in the half-invalid state from case 2.

@matyasf
matyasf force-pushed the fix/error-state-visuals branch from d87e139 to 518e747 Compare December 1, 2026 15:19
@matyasf
matyasf requested a review from balzss December 1, 2026 15:19
@matyasf

matyasf commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator Author

@balzss I could not repro case 1.

I could repro case 2, its fixed now

github-actions Bot pushed a commit that referenced this pull request Dec 1, 2026
@balzss

balzss commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

PR Preview Action v1.8.2
QR code for preview link

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

Built to branch gh-pages at 2026-12-01 15:23 UTC.

Preview will be ready when the GitHub Pages deployment is complete.

image image

in readonly+success mode the border is grey. in normal success mode the border is green

matyasf and others added 3 commits December 3, 2026 13:16
…ssages

A Select without onInputChange, and so every SimpleSelect, renders its TextInput as readonly with
forceMessages. The error border color was only applied for interaction "enabled", so these fields
showed the error message but kept a gray border.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
withStyleNew passes component state to generateStyle as the fourth argument, but FileDrop v2 read
it from the props argument. dragRejected, dragAccepted and the disabled flags were always
undefined, so the error border never rendered.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
TextInput already switches its focus ring to danger or success. NumberInput did not pass a
focusColor, so the ring stayed blue in the error state.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@matyasf
matyasf force-pushed the fix/error-state-visuals branch from 518e747 to d19941d Compare December 3, 2026 12:16
@matyasf
matyasf merged commit abb86df into master Dec 3, 2026
9 of 10 checks passed
@matyasf
matyasf deleted the fix/error-state-visuals branch December 3, 2026 12:17
matyasf added a commit that referenced this pull request Dec 3, 2026
…tate fixes (#2825)

## Summary
- `Select` and `SimpleSelect` shows now red error border all the time
there is an error.
- `FileDrop` shows now red error border in error state.
- `NumberInput`: shows now red error focus ring in error state.

## Test Plan
- Open the Error messages example in `docs/guides/forms.md` and check
that SimpleSelect, FileDrop and NumberInput show the red border or focus
ring, including in dark mode.
- Drag a file over a FileDrop and check the accepted and rejected
borders. Check a disabled FileDrop looks dimmed.

Fixes INSTUI-5276

🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-actions Bot pushed a commit that referenced this pull request Dec 3, 2026
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.

3 participants