Skip to content

v6: Restyle editor tabs with dirty state and close affordance#4292

Merged
trevor-scheer merged 3 commits into
graphiql-6from
trevor/restyle-editortabs
May 17, 2026
Merged

v6: Restyle editor tabs with dirty state and close affordance#4292
trevor-scheer merged 3 commits into
graphiql-6from
trevor/restyle-editortabs

Conversation

@trevor-scheer
Copy link
Copy Markdown
Contributor

@trevor-scheer trevor-scheer commented May 16, 2026

Summary

This PR restyles the editor tab strip for v6 and introduces dirty-state and save affordances. Each tab now shows an accent dot when its query differs from the last saved snapshot, and hovering a tab reveals a close button. A new save action, bound to Cmd-S / Ctrl-S, snapshots the active tab's query, and the right side of the strip gains prettify, copy, and save buttons that surface the existing actions inline.

A note on save: today saveQuery() just updates the lastSavedQuery snapshot to clear the dirty dot. Tab content already auto-persists to localStorage, so save isn't writing anything new. The hook is in place so collections (planned as a follow-up package) can give save real semantics, snapshotting the active tab into the current collection entry. Until that lands, the indicator is a cosmetic baseline.

Test plan

  • Open the deploy preview with at least two tabs. Edit the query in one tab and confirm the accent dot appears next to its label.
  • Press Cmd-S (macOS) or Ctrl-S (Windows/Linux); confirm the dot disappears.
  • Click the Save button in the tab strip's right-side action area; confirm the dot also clears.
  • Hover over a dirty tab; confirm the close button appears and the dirty dot shifts left so it doesn't overlap the close icon.
  • Close an inactive tab via the close button; confirm the active tab stays active. Close the active tab; confirm focus moves to an adjacent tab.
  • Drag tabs to reorder them; confirm the dirty state follows the correct tab.
  • Tab through the strip with the keyboard; confirm both tab labels and the right-side action buttons are reachable in a logical order.

Refs: #4219

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 16, 2026

🦋 Changeset detected

Latest commit: 81dc3bb

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

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

@github-actions
Copy link
Copy Markdown
Contributor

The latest changes of this PR are not available as canary, since there are no linked changesets for this PR.

@trevor-scheer trevor-scheer force-pushed the trevor/restyle-editortabs branch 2 times, most recently from c91fcac to 05951d7 Compare May 17, 2026 18:46
Migrates the editor tab strip to v6 OKLCH tokens. Adds a `lastSavedQuery`
field to the tab store; dirty state is computed by comparing `query` against
that snapshot. Saves update the snapshot via a new `saveQuery` action bound
to `Ctrl-S` / `Cmd-S`. Adds a 5x5 blue dirty-state dot (top-right of tab)
and a hover-only close button per tab. Adds prettify, copy, and save buttons
to the right side of the tab strip.
@trevor-scheer trevor-scheer force-pushed the trevor/restyle-editortabs branch from 05951d7 to cd7679d Compare May 17, 2026 18:56
@trevor-scheer trevor-scheer marked this pull request as ready for review May 17, 2026 21:10
@trevor-scheer trevor-scheer enabled auto-merge (squash) May 17, 2026 21:11
@trevor-scheer trevor-scheer merged commit f5968fe into graphiql-6 May 17, 2026
13 checks passed
@trevor-scheer trevor-scheer deleted the trevor/restyle-editortabs branch May 17, 2026 21:15
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