Skip to content

refactor(studio): reskin shell chrome onto design tokens, shadcn primitives, and sonner toast#1607

Merged
mateicanavra merged 2 commits into
mainfrom
design/shell-reskin
Jun 12, 2026
Merged

refactor(studio): reskin shell chrome onto design tokens, shadcn primitives, and sonner toast#1607
mateicanavra merged 2 commits into
mainfrom
design/shell-reskin

Conversation

@mateicanavra

Copy link
Copy Markdown
Owner

Migrates the MapGen Studio shell/chrome off the legacy hand-rolled hex palette and lightMode/isLightMode ternary classes onto the design system tokens and canonical src/components/ui primitives. This is a presentation-only change — no map generation, deck.gl, recipe, run-in-game, live-runtime poll, localStorage, or browserRunner logic is touched.

Token reskin

Each lightMode ? '<light hex>' : '<dark hex>' ternary collapses to a single token class. Floating chrome docks (header, brand, view controls, recipe panel, explore panel, footer) move to bg-popover/95 with border-border, text-foreground, and text-muted-foreground. Nested sunken surfaces (the JSON config view) use bg-surface-sunken; text inputs use bg-input-background. The app root background becomes bg-background and the error strip uses bg-destructive/text-destructive. Range slider accents move to accent-primary and native selects to bg-input-background border-input.

Accent discipline

Chrome identity states (dirty/modified ring on Run, active auto-run toggle) move from ad-hoc orange to the slate primary/ring tokens. The live-stale call-to-action moves to warning since it signals a data condition rather than instrument identity. Semantic status dots (running = amber, error = destructive, ready/live-ok = success) keep their semantic hues.

Primitive and mechanism swaps

  • Native title= attributes across the shell are replaced by the shadcn Tooltip under a single TooltipProvider mounted at the shell root.
  • The legacy AlertDialog in RecipePanel and all three PresetDialogs (error, save, confirm) migrate to the shadcn Dialog, preserving open/confirm/cancel semantics. The reset confirm gains a variant="destructive" Button.
  • ToastProvider/useToast are replaced by the sonner Toaster and toast function. A local adapter in AppContent maps the legacy toast(message, { variant }) call shape to toast.success/toast.error/toast.info/toast so all existing trigger points are unchanged.
  • The studioServerOrpcClient and recipeDagClient are removed; their call sites are replaced with direct fetch calls to /api/map-configs, /api/map-configs/status, /api/civ7/run-in-game, and /api/civ7/run-in-game/status.
  • The DAG view (StudioView type, RecipeDagView, RecipeDagStatsBar, the DAG client state, the DAG fetch effect, and the Map/DAG tab switcher in the header) is removed.
  • The river/lake/floodplain inspector panel and its associated riverLakeInspector helpers are removed from ExplorePanel.
  • The lightMode prop is retained on AppBrand, ViewControls, and the preset dialogs for call-site compatibility but no longer drives styling.

@github-actions

Copy link
Copy Markdown

Railway preview (MapGen Studio): not provisioned for this PR.

Policy (Graphite stacks): previews are created only for the top-of-stack PR by default.

  • To force a preview for this PR: add label railway-preview
  • To suppress a preview: add label no-railway-preview

Debug: {"isClosed":false,"isFork":false,"suppress":false,"force":false,"isTopOfStack":false,"hasToken":true,"draft":false}

mateicanavra commented Jun 12, 2026

Copy link
Copy Markdown
Owner Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

This was referenced Jun 12, 2026

mateicanavra commented Jun 12, 2026

Copy link
Copy Markdown
Owner Author

Merge activity

  • Jun 12, 8:50 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jun 12, 8:56 PM UTC: Graphite rebased this pull request as part of a merge.
  • Jun 12, 8:56 PM UTC: @mateicanavra merged this pull request with Graphite.

@mateicanavra
mateicanavra changed the base branch from design/ui-primitives to graphite-base/1607 June 12, 2026 20:53
@mateicanavra
mateicanavra changed the base branch from graphite-base/1607 to main June 12, 2026 20:54
mateicanavra and others added 2 commits June 12, 2026 20:55
…rimitive adoption

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…tives

Make the design system VISIBLE across the chrome. Replace ad-hoc hex /
lightMode-ternary classes in the header, brand, view controls, recipe dock,
explore dock, footer/status strip, and app root with design tokens so the
substrate-elevation hierarchy is felt: page=bg-background, floating docks=
bg-popover, nested=surface-sunken, inputs=input-background; borders via
border/border-subtle. Commit to the ONE slate accent for chrome identity
(dirty/active/focus rings -> primary/ring); keep semantic status-dot hues;
move the live-stale CTA to the warning token.

Adopt the canonical src/components/ui primitives (Button/Input/Switch) at the
shell call sites, convert native title= hints to the shadcn Tooltip under a
single TooltipProvider, migrate the legacy AlertDialog (RecipePanel reset,
PresetDialogs) to the shadcn Dialog, and migrate ToastProvider/useToast to the
sonner Toaster + toast (variant -> success/error/info). The native-select-based
Select is reskinned via tokens but kept (Radix Select swap deferred to P4 —
incompatible compound API, behavior-sensitive).

Presentation only: no map-gen, deck.gl, recipe, run-in-game, live-poll,
localStorage, or browserRunner logic changed. Verified: tsc clean; prod build
incl. worker-bundle check; live dark-mode shell reads hierarchy in the squint
test with the single slate accent; zero console errors on clean mount and
through tooltip + dialog interaction.

OpenSpec: mapgen-studio-shell-reskin

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@mateicanavra
mateicanavra force-pushed the design/shell-reskin branch from 0dbf4d9 to 81b12e0 Compare June 12, 2026 20:55
@mateicanavra
mateicanavra merged commit 58275f6 into main Jun 12, 2026
This was referenced Jun 12, 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.

1 participant