Skip to content

refactor(playground): rename AppBuilder internals to Playground#2310

Merged
chelojimenez merged 1 commit into
mainfrom
marcelo/rename-app-builder-to-playground
May 28, 2026
Merged

refactor(playground): rename AppBuilder internals to Playground#2310
chelojimenez merged 1 commit into
mainfrom
marcelo/rename-app-builder-to-playground

Conversation

@chelojimenez
Copy link
Copy Markdown
Contributor

@chelojimenez chelojimenez commented May 28, 2026

Summary

Final follow-up to #2301 (App Builder removal) and #2308 (chat-v2 tab removal). App Builder (tab) and chat-v2 (tab) are both gone; Playground is the only consumer of the orchestration hook, context, skeleton, and onboarding state that still carried "AppBuilder" names. Pure mechanical rename — no behavior change.

Naming changes

Current New
useAppBuilderState usePlaygroundState
AppBuilderStateProvider / useAppBuilderStateContext PlaygroundStateProvider / usePlaygroundStateContext
UseAppBuilderStateOptions / UseAppBuilderStateReturn UsePlaygroundStateOptions / UsePlaygroundStateReturn
AppBuilderLoadingState PlaygroundLoadingState
APP_BUILDER_FIRST_RUN_PROMPT PLAYGROUND_FIRST_RUN_PROMPT
appBuilderOnboarding / setAppBuilderOnboarding (App.tsx) playgroundOnboarding / setPlaygroundOnboarding
AppBuilderSkeleton PlaygroundSkeleton
"app-builder-send-nux-hint" testid "playground-send-nux-hint"
File: use-app-builder-state.ts use-playground-state.ts
File: components/app-builder/AppBuilderSkeleton.tsx components/playground/PlaygroundSkeleton.tsx
File: components/app-builder/PostConnectGuide.tsx components/ui-playground/PostConnectGuide.tsx (no identifier rename)

components/app-builder/ directory deleted.

Other changes

  • Drop the "app-builder" arm from surface literal unions in shared/inspector-command.ts (ToolInvocationPayload, RenderToolResultInspectorCommand, SnapshotAppInspectorCommand). The CLI ships "playground" already; no in-tree caller emits "app-builder".
  • Drop the now-unused surface option from UsePlaygroundStateOptions. The only call site (PlaygroundTab.tsx) always passed "playground" — single-value union was dead weight.
  • Update the two legacy-compat surface checks in the orchestration hook to only accept "playground".
  • Two beyond-plan comment cleanups in ActiveServerSelector.tsx and ui-playground/PlaygroundLeft.tsx so the catch-all grep is clean.

Preserved (analytics continuity)

PostHog event names stay as-is:

  • app_builder_tab_viewed
  • app_builder_tool_executed
  • app_builder_send_message

Each fire site has a comment explaining the carry-over.

⚠️ One thing for reviewers

The surface: property on the app_builder_tab_viewed PostHog event payload was dropped along with the option. It was only meaningful when there were two surfaces (App Builder vs Playground). If any PostHog dashboard or query filters/breakdowns on that property, this is a small downstream analytics change — let me know and I'll restore it as a hardcoded surface: "playground".

Test plan

  • npm run typecheck:client clean
  • Inspector client: 353 test files / 3456 tests pass (2 skipped, unchanged)
  • Shared workspace: 10 files / 129 tests pass
  • Residual greps:
    • useAppBuilderState | AppBuilderStateProvider | AppBuilderLoadingState | AppBuilderSkeleton | APP_BUILDER_FIRST_RUN_PROMPT | appBuilderOnboarding | app-builder-send-nux-hint0
    • "app-builder" literal in client/shared .ts/.tsx0
    • components/app-builder/ import paths → 0
    • Catch-all AppBuilder | app-builder | appBuilder | APP_BUILDER across client/shared → 0 (PostHog event strings use underscores, so they're excluded)
  • Manual smoke (reviewer): loading skeleton renders during Playground cold-start; post-connect guide appears on first run; typewriter NUX hint shows the send affordance

Net diff: 18 files, +91 / −107.

🤖 Generated with Claude Code


Note

Medium Risk
Inspector commands or dashboards that still send or filter on "app-builder" or the dropped surface property on tab-view events will break or skew analytics; otherwise this is a rename with narrow contract tightening.

Overview
Renames the Playground orchestration layer from App Builder naming to Playground across hooks, context, skeleton, onboarding state in App.tsx, exports, and tests (usePlaygroundState, PlaygroundStateProvider, PLAYGROUND_FIRST_RUN_PROMPT, playground-send-nux-hint, etc.), including moving PostConnectGuide under ui-playground.

Tightens shared inspector command types by removing "app-builder" from surface unions in shared/inspector-command.ts; Playground handlers now accept only "playground", and the optional surface option on the state hook (and its PostHog payload on app_builder_tab_viewed) is removed.

PostHog event names (app_builder_tab_viewed, etc.) are unchanged for analytics continuity.

Reviewed by Cursor Bugbot for commit 75d2031. Bugbot is set up for automated code reviews on this repo. Configure here.

…ound

App Builder (tab) and chat-v2 (tab) are both removed; Playground is the
only consumer of the orchestration hook, context, skeleton, and onboarding
state that still carried "AppBuilder" names. Pure mechanical rename — no
behavior change.

- useAppBuilderState -> usePlaygroundState (+ co-exports, types, file rename)
- AppBuilderStateProvider / useAppBuilderStateContext -> Playground-prefixed
- APP_BUILDER_FIRST_RUN_PROMPT -> PLAYGROUND_FIRST_RUN_PROMPT
- appBuilderOnboarding state in App.tsx -> playgroundOnboarding
- AppBuilderSkeleton -> PlaygroundSkeleton (moved to components/playground/)
- PostConnectGuide moved to components/ui-playground/ (no identifier rename)
- "app-builder-send-nux-hint" testid -> "playground-send-nux-hint"
- Drop the "app-builder" arm from surface literal unions in
  shared/inspector-command.ts (no in-tree caller sends it; CLI ships
  "playground")
- Delete the now-empty components/app-builder/ directory

PostHog event names (app_builder_tab_viewed etc.) preserved for analytics
continuity; comments updated to explain the carry-over.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label May 28, 2026
@chelojimenez
Copy link
Copy Markdown
Contributor Author

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 28, 2026

Review Change Stack

Walkthrough

This PR performs a systematic migration from App Builder state management to Playground state management. The core hook is renamed from useAppBuilderState to usePlaygroundState with updated options, return types, and context exports. Inspector command handlers are tightened to target only the Playground surface and use buildPlaygroundSnapshot. App-level onboarding state is rewired to pass playgroundOnboarding instead of appBuilderOnboarding through the route context. All downstream components—PlaygroundTab, PlaygroundCenter, PlaygroundLeftRail, and MultiServerToolsPane—are updated to consume the new Playground state via the renamed context. Inspector command types are narrowed to remove app-builder surface support, and UI component test IDs and test assertions are updated accordingly.

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


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 and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
mcpjam-inspector/client/src/components/ui-playground/hooks/use-playground-state.ts (1)

228-241: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Propagate onboarding start to the parent callback.

This effect updates the local sidebar state, but onOnboardingChange is only ever called with false on Line 224 and Line 245. Any parent state wired through this callback never observes onboarding begin, so the app-level Playground onboarding gating added in this rename will stay off.

Suggested fix
   useLayoutEffect(() => {
     // NUX: collapse the tools sidebar for the whole first-run connect + guided
     // flow. While the server is still connecting, `isGuidedPostConnect` is
     // false; checking phase too avoids flashing the sidebar open until
     // connect completes.
     const collapseToolsForNux =
       onboarding.phase === "connecting_excalidraw" ||
       onboarding.isGuidedPostConnect;
+    onOnboardingChange?.(collapseToolsForNux);
     if (collapseToolsForNux) {
       setSidebarVisible(false);
     } else {
       setSidebarVisible(true);
     }
-  }, [onboarding.phase, onboarding.isGuidedPostConnect, setSidebarVisible]);
+  }, [
+    onboarding.phase,
+    onboarding.isGuidedPostConnect,
+    onOnboardingChange,
+    setSidebarVisible,
+  ]);
🤖 Prompt for 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.

In
`@mcpjam-inspector/client/src/components/ui-playground/hooks/use-playground-state.ts`
around lines 228 - 241, The effect that toggles the local sidebar
(useLayoutEffect using onboarding.phase and onboarding.isGuidedPostConnect and
setSidebarVisible) must also notify the parent via onOnboardingChange: when
collapseToolsForNux is true call onOnboardingChange(true) to propagate that
onboarding has started, and when collapseToolsForNux is false call
onOnboardingChange(false) to indicate it ended; add these calls alongside the
existing setSidebarVisible branches so the parent receives both start and stop
events driven by onboarding.phase / onboarding.isGuidedPostConnect.
🤖 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.

Outside diff comments:
In
`@mcpjam-inspector/client/src/components/ui-playground/hooks/use-playground-state.ts`:
- Around line 228-241: The effect that toggles the local sidebar
(useLayoutEffect using onboarding.phase and onboarding.isGuidedPostConnect and
setSidebarVisible) must also notify the parent via onOnboardingChange: when
collapseToolsForNux is true call onOnboardingChange(true) to propagate that
onboarding has started, and when collapseToolsForNux is false call
onOnboardingChange(false) to indicate it ended; add these calls alongside the
existing setSidebarVisible branches so the parent receives both start and stop
events driven by onboarding.phase / onboarding.isGuidedPostConnect.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 86e5d219-a4c2-469d-9c9b-6f60e47d6fc0

📥 Commits

Reviewing files that changed from the base of the PR and between 5107f83 and 75d2031.

📒 Files selected for processing (18)
  • mcpjam-inspector/client/src/App.tsx
  • mcpjam-inspector/client/src/components/ActiveServerSelector.tsx
  • mcpjam-inspector/client/src/components/playground/PlaygroundCenter.tsx
  • mcpjam-inspector/client/src/components/playground/PlaygroundLeftRail.tsx
  • mcpjam-inspector/client/src/components/playground/PlaygroundSkeleton.tsx
  • mcpjam-inspector/client/src/components/playground/PlaygroundTab.tsx
  • mcpjam-inspector/client/src/components/playground/panes/MultiServerToolsPane.tsx
  • mcpjam-inspector/client/src/components/ui-playground/HandDrawnSendHint.tsx
  • mcpjam-inspector/client/src/components/ui-playground/PlaygroundLeft.tsx
  • mcpjam-inspector/client/src/components/ui-playground/PlaygroundMain.tsx
  • mcpjam-inspector/client/src/components/ui-playground/PostConnectGuide.tsx
  • mcpjam-inspector/client/src/components/ui-playground/__tests__/HandDrawnSendHint.test.tsx
  • mcpjam-inspector/client/src/components/ui-playground/__tests__/PlaygroundMain.test.tsx
  • mcpjam-inspector/client/src/components/ui-playground/__tests__/PostConnectGuide.test.tsx
  • mcpjam-inspector/client/src/components/ui-playground/hooks/__tests__/select-connected-active-server-names.test.ts
  • mcpjam-inspector/client/src/components/ui-playground/hooks/index.ts
  • mcpjam-inspector/client/src/components/ui-playground/hooks/use-playground-state.ts
  • mcpjam-inspector/shared/inspector-command.ts

@github-actions
Copy link
Copy Markdown
Contributor

Internal preview

Preview URL: https://mcp-inspector-pr-2310.up.railway.app
Deployed commit: 12504d0
PR head commit: 75d2031
Backend target: staging fallback.
Health: ❌ Convex unreachable — see upsert-preview job logs (staging may need convex deploy)
Access is employee-only in non-production environments.

@chelojimenez chelojimenez merged commit 49abfdc into main May 28, 2026
12 checks passed
@chelojimenez chelojimenez deleted the marcelo/rename-app-builder-to-playground branch May 28, 2026 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant