Skip to content

v6: Add theme / density / font-size controls to settings dialog#4338

Draft
trevor-scheer wants to merge 2 commits into
graphiql-6from
trevor/pr-37
Draft

v6: Add theme / density / font-size controls to settings dialog#4338
trevor-scheer wants to merge 2 commits into
graphiql-6from
trevor/pr-37

Conversation

@trevor-scheer
Copy link
Copy Markdown
Contributor

Summary

The settings dialog now exposes segmented controls for theme, density, and font size, backed by the useGraphiQLSettings hook that landed in #4322. Concrete CSS variable values fill in the [data-density] and [data-font-size] token blocks in tokens.css, so toggling a preset instantly reshapes spacing and typography across the whole UI. The Monaco editor's font size is kept in sync with the active preset via editor.updateOptions. The SettingsDialog component lives in @graphiql/react and is wired into the graphiql package's activity bar, replacing the previous inline settings UI there.

Test plan

  • Open the settings dialog via the gear icon; confirm Theme, Density, and Font size sections appear.
  • Toggle each theme option (Auto / Light / Dark) and verify the container's data-theme attribute updates.
  • Toggle each density option and verify layout tokens change (e.g. top-bar height, rail width).
  • Toggle each font-size option and verify --font-size-body and Monaco editor font size update.
  • Reload the page; confirm all three settings persist from localStorage.

Fills in concrete preset values for `[data-density]` and
`[data-font-size]` token blocks in `tokens.css`. Adds a new
`SettingsDialog` component to `@graphiql/react` with
`SegmentedControl`s for each axis, wired to `useGraphiQLSettings`.
Settings persist via `localStorage`. The Monaco editor's font size
follows the active preset. Wires `SettingsDialog` into the
`graphiql` package's `ActivityBar`, replacing the inline settings
UI there.

Removes `forcedTheme` and `showPersistHeadersSettings` from
`GraphiQLInterfaceProps`; both were deprecated props with no effect.
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jun 6, 2026

🦋 Changeset detected

Latest commit: a7baf11

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

This PR includes changesets to release 6 packages
Name Type
@graphiql/react Minor
graphiql Major
@graphiql/plugin-code-exporter Major
@graphiql/plugin-doc-explorer Major
@graphiql/plugin-explorer Major
@graphiql/plugin-history Major

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

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