Skip to content

v6: Add a check-mark confirmation to the Settings Clear Data button#4401

Merged
trevor-scheer merged 2 commits into
graphiql-6from
trevor/settings-clear-data-confirm
Jul 11, 2026
Merged

v6: Add a check-mark confirmation to the Settings Clear Data button#4401
trevor-scheer merged 2 commits into
graphiql-6from
trevor/settings-clear-data-confirm

Conversation

@trevor-scheer

@trevor-scheer trevor-scheer commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Summary

The Settings dialog's "Clear data" button was unstyled, and clicking it turned the whole button green. This restyles it to match the segmented controls it sits beside — same typography (font-size-small, weight 500, letter-spacing-ui), bg-subtle fill + border-muted border, and the same height as a full segmented bar (4px vertical padding = a segment cell's 3px plus the track's own 1px). It no longer reads as a foreign element in that row.

On click, the label cross-fades to a green checkmark in place and back after ~1.5s — rather than the check appearing beside the label. The label stays in the DOM (at opacity: 0) so the button keeps a fixed width and its accessible name, and an sr-only live region announces "Data cleared" for screen-reader users. The swap respects prefers-reduced-motion.

Test plan

  • Open Settings. The "Clear data" button should read as a sibling of the Density/Font size segmented controls — same font, weight, and height — not a larger, heavier button.
  • Click "Clear data". The label should swap to a green checkmark in place (no sideways shift, no reflow), then revert to "Clear data" after ~1.5s.
  • Confirm the stored settings (theme, density, font size, etc.) are actually cleared after clicking.
  • Check both Dark and Light themes — the button and checkmark should look right in each.
  • With a screen reader, clicking should announce "Data cleared".

Refs: #4219

Uses the standard Button component instead of unstyled markup. On click,
shows a brief green checkmark next to the label instead of turning the
whole button green, matching the collections plugin's share confirmation.

Refs: #4219
@changeset-bot

changeset-bot Bot commented Jul 10, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 294df48

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages
Name Type
@graphiql/react Patch
@graphiql/plugin-code-exporter Patch
@graphiql/plugin-collections Patch
@graphiql/plugin-doc-explorer Patch
@graphiql/plugin-explorer Patch
@graphiql/plugin-history Patch
@graphiql/plugin-query-builder Patch
graphiql Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

…n place

Restyle the Settings "Clear data" button to the segmented-control scale
(`font-size-small`, weight 500, `letter-spacing-ui`, `bg-subtle` +
`border-muted`) with 4px vertical padding so it matches a full segmented
bar's height. On click the label cross-fades to a green check in place and
back, keeping a fixed footprint and the button's accessible name, plus an
`sr-only` live region announcing "Data cleared". Respects
`prefers-reduced-motion`.
@trevor-scheer trevor-scheer marked this pull request as ready for review July 11, 2026 05:47
@trevor-scheer trevor-scheer enabled auto-merge (squash) July 11, 2026 05:47
@trevor-scheer trevor-scheer merged commit a8254bc into graphiql-6 Jul 11, 2026
12 checks passed
@trevor-scheer trevor-scheer deleted the trevor/settings-clear-data-confirm branch July 11, 2026 05:50
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.

1 participant