Skip to content

feat: polish Layers DevTools UI and add playground#23

Merged
SutuSebastian merged 3 commits into
mainfrom
feat/devtools-ui-polish
Jul 18, 2026
Merged

feat: polish Layers DevTools UI and add playground#23
SutuSebastian merged 3 commits into
mainfrom
feat/devtools-ui-polish

Conversation

@SutuSebastian

@SutuSebastian SutuSebastian commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Polish the Layers TanStack DevTools panel: docs-aligned brand tokens/logo, TanStack UI primitives, host-owned theme (Settings), plugin label "Layers"
  • Add private apps/devtools-playground Vite harness (bun run playground:dev) for demos + visual QA
  • Patch changeset for @stainless-code/layers-devtools / @stainless-code/react-layers-devtools; OS prefers-color-scheme fallback when host omits theme

Test plan

  • bun run playground:dev → open TanStack DevTools → Layers; toggle theme via host Settings
  • Empty state shows Layers mark + ensureStack tip; opening demos populates stacks/actions
  • Soft/force dismiss / cancel queued / dismiss-all still work from the panel
  • bun test packages/devtools/src packages/react-devtools/src and bun run --filter '@stainless-code/react-layers-devtools' test:dom
  • bun run --filter '@stainless-code/layers-devtools-playground' typecheck (after workspace builds)

Summary by CodeRabbit

  • New Features

    • Added a private Layers DevTools Playground showcasing modals, drawers, toasts, wizards, progress overlays, validation, and nested interactions.
    • Added workspace commands to build, run, and preview the playground locally.
    • Added polished Layers branding, themed UI components, and improved stack and payload displays.
    • DevTools now follows the host’s light or dark color preference by default.
    • Renamed the DevTools panel to “Layers.”
  • Documentation

    • Added playground setup, usage, and local preview instructions.
  • Chores

    • Added a patch release entry for the DevTools packages.

Ship docs-aligned panel branding with host-owned theme, TanStack UI
primitives, a private Vite demo harness, and a patch changeset.
@changeset-bot

changeset-bot Bot commented Jul 18, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2a90512

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

This PR includes changesets to release 2 packages
Name Type
@stainless-code/layers-devtools Patch
@stainless-code/react-layers-devtools 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

@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@SutuSebastian, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 53 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a8172714-0105-431e-a586-c9b10195e3d0

📥 Commits

Reviewing files that changed from the base of the PR and between 35af2d2 and 2a90512.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (2)
  • apps/devtools-playground/package.json
  • packages/react-devtools/package.json
📝 Walkthrough

Walkthrough

Adds a runnable DevTools playground showcasing layered UI behaviors and updates the Layers DevTools panel with branded, themed TanStack UI components. React DevTools now follows host color-scheme defaults and uses “Layers” as its plugin label.

Changes

DevTools playground

Layer / File(s) Summary
Playground foundation
apps/devtools-playground/*, package.json, knip.json
Adds the Vite/TypeScript workspace, styling, configuration, documentation, and root scripts.
Runtime wiring and UI primitives
apps/devtools-playground/src/App.tsx, client.ts, portal.tsx, ui.tsx
Mounts the provider, stack outlets, portal behavior, development DevTools plugin, and reusable overlay UI components.
Layer demonstrations
apps/devtools-playground/src/layers.tsx
Implements dialogs, wizards, nested scopes, blockers, async loading, transitions, drawers, toasts, progress, mutations, and payload validation.
Interaction surface
apps/devtools-playground/src/DemoPage.tsx
Adds controls, queue status, event feed, and actions exercising the demonstrated layer capabilities.

DevTools panel polish

Layer / File(s) Summary
Branding and themed layout
packages/devtools/src/brand.ts, packages/devtools/src/components/*, packages/devtools/src/components/index.tsx
Adds light/dark brand tokens, a Layers logo, themed Shell layout, TanStack selectors, and branded empty states.
Controls and stack table
packages/devtools/src/components/StackActions.tsx, packages/devtools/src/components/StackTable.tsx
Replaces native controls with TanStack UI components and updates table tags, payload rendering, sections, and last-action display.
React theme and plugin defaults
packages/react-devtools/src/*
Uses host prefers-color-scheme when no theme is supplied and renames the plugin display label to “Layers,” with tests.
Release metadata
.changeset/devtools-brand-polish.md
Adds patch release metadata for the DevTools packages.

Repository maintenance

Layer / File(s) Summary
Lessons list cleanup
.agents/lessons.md
Removes one lesson entry.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Developer
  participant Playground
  participant LayerClient
  participant StackOutlet
  participant LayersDevtools
  Developer->>Playground: open a capability
  Playground->>LayerClient: create or update layer state
  LayerClient->>StackOutlet: render layer content
  LayerClient->>LayersDevtools: expose stack and snapshot state
  LayersDevtools->>Developer: display themed stack details
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 17.65% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: Layers DevTools UI polish plus the new playground app.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/devtools-ui-polish

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@tailwindcss/vite@4.1.11 nested vite@7.3.1 (high advisories); align with 4.3.3 + plugin-react 6.0.3.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/devtools-playground/src/layers.tsx`:
- Around line 499-503: Update the glyph-only close buttons in the dialog
sections around DialogTitle and the additional matching location to include
aria-label="Close", ensuring assistive technology can identify both controls.
- Around line 102-113: Update delay to check signal.aborted immediately before
or when setting up the timer, rejecting with the existing AbortError behavior
without waiting for a future event. Preserve the current timer cleanup and
abort-listener handling for signals that are not already aborted.

In `@apps/devtools-playground/src/ui.tsx`:
- Around line 89-119: Update ModalShell to provide accessible dialog naming and
keyboard behavior: require or support aria-label/aria-labelledby, move focus
into the shell when opened, contain focus while active, restore the previously
focused element on close, and route Escape through the existing layer dismissal
API. Apply the same behavior to the related drawer shell at the referenced
implementation, preserving status-role behavior where modal semantics do not
apply.

In `@packages/devtools/src/components/Shell.tsx`:
- Around line 121-123: Update the selection flow around selectedStackValue so
the effective fallback stack ID is also used by selectedSnapshot and
StackActions, or synchronize store.selectedStackId to stackIds[0] when selection
is empty. Ensure the displayed selector, snapshot state, and actions all operate
on the same effective stack ID.

In `@packages/react-devtools/src/resolveDefaultTheme.test.ts`:
- Around line 48-50: Update the “returns dark when window is unavailable” test
for resolveDefaultTheme to explicitly remove or stub the window global before
invoking the function, and restore the original global afterward so the test
reliably exercises the unavailable-window branch regardless of the test runtime
environment.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ad7b271f-5981-486b-81ee-90ef29f14914

📥 Commits

Reviewing files that changed from the base of the PR and between 695482d and 35af2d2.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (31)
  • .agents/lessons.md
  • .changeset/devtools-brand-polish.md
  • apps/devtools-playground/README.md
  • apps/devtools-playground/index.html
  • apps/devtools-playground/package.json
  • apps/devtools-playground/src/App.tsx
  • apps/devtools-playground/src/DemoPage.tsx
  • apps/devtools-playground/src/client.ts
  • apps/devtools-playground/src/index.css
  • apps/devtools-playground/src/layers.tsx
  • apps/devtools-playground/src/main.tsx
  • apps/devtools-playground/src/portal.tsx
  • apps/devtools-playground/src/ui.tsx
  • apps/devtools-playground/src/vite-env.d.ts
  • apps/devtools-playground/tsconfig.app.json
  • apps/devtools-playground/tsconfig.json
  • apps/devtools-playground/tsconfig.node.json
  • apps/devtools-playground/vite.config.ts
  • knip.json
  • package.json
  • packages/devtools/src/brand.ts
  • packages/devtools/src/components/LayersLogo.tsx
  • packages/devtools/src/components/Shell.tsx
  • packages/devtools/src/components/StackActions.tsx
  • packages/devtools/src/components/StackTable.tsx
  • packages/devtools/src/components/index.tsx
  • packages/react-devtools/src/ReactLayersDevtools.tsx
  • packages/react-devtools/src/plugin.test.ts
  • packages/react-devtools/src/plugin.tsx
  • packages/react-devtools/src/resolveDefaultTheme.test.ts
  • packages/react-devtools/src/resolveDefaultTheme.ts
💤 Files with no reviewable changes (1)
  • .agents/lessons.md

Comment thread apps/devtools-playground/src/layers.tsx
Comment thread apps/devtools-playground/src/layers.tsx
Comment thread apps/devtools-playground/src/ui.tsx
Comment thread packages/devtools/src/components/Shell.tsx
Comment thread packages/react-devtools/src/resolveDefaultTheme.test.ts
@SutuSebastian
SutuSebastian merged commit 259c859 into main Jul 18, 2026
15 checks passed
@SutuSebastian
SutuSebastian deleted the feat/devtools-ui-polish branch July 18, 2026 08:27
@github-actions github-actions Bot mentioned this pull request Jul 18, 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