Skip to content

fix(content): size the small loading dots to an icon, and let a loader name itself to screen readers (#1403 follow-up) - #1446

Merged
gkhngyk merged 1 commit into
ansvisor:mainfrom
cihan-gyk:fix/loading-dots-label
Oct 24, 2026
Merged

gkhngyk merged 1 commit into
ansvisor:mainfrom
cihan-gyk:fix/loading-dots-label

Conversation

@cihan-gyk

Copy link
Copy Markdown
Collaborator

Summary

These are the two low follow-ups from the #1403 review (items 2 and 3).

  1. The label no longer shifts when the dots replace an icon.
    • The sm dots are now 16 px wide: w-4 justify-center, three 4 px dots with 2 px gaps. 16 px is the width of the icon they most often stand in for (h-4, 9 of 16 swaps).
    • Before, they were 18 px, so a button's label moved when its work started.
    • Swaps with 14 px and 12 px icons still move by 2–4 px, much less than before.
    • No sm caller sets a width of its own.
  2. Five loaders now tell a screen reader something.
    • LoadingDots takes an optional label. With it, the dots sit in a role="status" wrapper with the label as sr-only text, and className goes on the wrapper. Without it, nothing changes: the dots stay aria-hidden.
    • It is used on the five loaders the review named:
      • the webhook dialog (content.webhook.loading);
      • the Content page (content.loadingOpportunities);
      • an opportunity's detail (content.loadingOpportunity);
      • the basket's Send button (content.sending);
      • the file picker (contentEditor.newContent.content.reading).
    • Inside a button, the label becomes the button's accessible name while it works.

Related issue

Follow-up to #1403 (review items 2 and 3).

Type of change

  • feat — New feature
  • fix — Bug fix
  • chore — Maintenance / dependencies
  • docs — Documentation only
  • refactor — Code change that neither fixes a bug nor adds a feature
  • test — Adding or updating tests

How to test

  1. Open Content: while the opportunities load, a screen reader (VoiceOver: Cmd+F5) reads "Loading the opportunities".
  2. Open an opportunity, add an asset to the basket and click Send. The button keeps its width, and its accessible name is "Sending..." while it works.
  3. In the Content Editor header, click Mark ready: the label beside the dots doesn't move.
  4. cd web && yarn test src/components/ui/loading-dots.test.tsx covers the 16 px box, and the label read as a status with the dots still hidden.

I haven't checked this in the browser yet; the Mac was under memory pressure. I'll add light and dark screenshots at 1024 px in the next local test session.

Checklist

  • Branch follows the naming convention (feature/, fix/, chore/, docs/) — see CONTRIBUTING.md
  • Commits follow Conventional Commits
  • yarn lint passes (run from web/)
  • yarn typecheck passes (run from web/)
  • yarn format:check passes (run from web/)
  • Changes are focused — one concern per PR

Tests: 3,341 pass. One fails in the full run: main's _export-dialog.test.tsx "downloads Word and Markdown…", which checks focus right after an arrow key. It fails the same way on other branches under load, and passes on its own. The build passes.

🤖 Generated with Claude Code

…r name itself to screen readers

- the sm dots are 16 px wide (w-4, 2 px gaps), the icon they most often
  stand in for, so a button's label doesn't move when its work starts
- LoadingDots takes an optional label, said as a status (sr-only), for the
  five loaders nothing else named: the webhook dialog, the Content page,
  an opportunity's detail, the basket's Send and the file picker

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@gkhngyk gkhngyk 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.

Looks good. One note on the test plan, fine as a follow-up.

What I checked:

  • Item 2 (label shift): the sm box is now 16 px (w-4: three 4 px dots and two 2 px gaps), the width of an h-4 icon. No sm caller passes a width or gap of its own. The callers with mr-1.5 / ml-1.5 keep their spacing.
  • Item 3 (silent loaders): all five now pass a label, and each key resolves in its component's namespace: content.webhook.loading, content.loadingOpportunities, content.loadingOpportunity, content.sending and contentEditor.newContent.content.reading.
    • Without a label, the markup is the same as before.
    • With one, className moves to the role="status" wrapper. So text-muted-foreground still colors the dots through bg-current, and the sr-only text adds no width.
  • The two new tests cover the 16 px box and the labelled status, with the dots still aria-hidden.
  1. (low) Step 2 of How to test won't hold as written. The basket's Send button (web/src/components/content/opportunity-basket.tsx:302) replaces its text "Send" with the dots, not an icon, so it gets about 10 px narrower while it sends. If the width should stay, keep the text in the button as invisible and lay the dots over it. That also keeps "Sending..." as the only accessible name, because hidden text isn't read. Otherwise, drop "The button keeps its width" from the test plan.

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