Skip to content

New app interface: three-panel layout, AI tasks, and embedded browser#2961

Draft
shaunandrews wants to merge 79 commits intotrunkfrom
new-app-interface
Draft

New app interface: three-panel layout, AI tasks, and embedded browser#2961
shaunandrews wants to merge 79 commits intotrunkfrom
new-app-interface

Conversation

@shaunandrews
Copy link
Copy Markdown
Contributor

@shaunandrews shaunandrews commented Apr 2, 2026

image image image image image image image

How AI was used in this PR

Claude Code (Opus) was used extensively as a pair-programming partner throughout this branch — designing the panel architecture, building the AI agent integration, implementing the browser panel, and iterating on the UI. All code was reviewed and directed by the author.

Proposed Changes

This is a Proof of Concept for a ground-up redesign of the Studio desktop app interface. It replaces the existing single-sidebar layout with a flexible three-panel architecture, adds AI-powered tasks, and embeds a live browser preview — all in a single cohesive experience.

Three-Panel Layout

  • Navigation panel (left) — Tasks and Sites sections with drag-and-drop site reordering, start/stop controls, task creation, and archiving. Collapsible via Cmd+B.
  • Primary panel (center) — Renders site content tabs or the AI task chat panel depending on what's selected. Chat toolbar and input float over content with progressive backdrop blur.
  • Secondary panel (right) — Embedded browser preview of the active site with auto-authentication, back/forward/reload, and an editable URL bar. Collapsible via Cmd+Shift+B.

All panels are resizable with drag handles, and sizes/collapsed state persist across sessions.

AI Tasks

  • The desktop app delegates agent execution to the CLI via fork() with an IPC channel — matching the established CliServerProcess pattern. A new hidden studio ai agent command runs the Claude Agent SDK in a headless child process, communicating SDK messages, permission requests, and control signals over Node IPC.
  • Gets the CLI's full tool set for free: 13 MCP tools including site_list, site_info, site_start, site_stop, wp_cli, post_blocks_read, post_block_update, site_create, site_delete, preview_*, take_screenshot, validate_blocks.
  • Plus Claude Code's built-in file tools (Read, Write, Edit, Glob, Grep, Bash) scoped to the site directory.
  • Full chat UI with streaming indicators, expandable tool cards, and inline permission prompts for filesystem operations outside the site root.
  • Task metadata persists in appdata; chat history persists in localStorage.
  • Auth provider auto-resolved by the CLI: WordPress.com → Claude auth → API key.

Embedded Browser

  • iframe-based preview with auto-login via /studio-auto-login so the WP admin bar is always visible.
  • CSP headers stripped in the main process to allow framing localhost.
  • Context-aware: shows the site associated with the selected task, or the selected site.
  • Loading states with indeterminate progress bar during in-page navigation.

Other Changes

  • Design token systemchrome-* and frame-* CSS custom properties with light/dark mode, mapped to Tailwind classes.
  • Settings window — Moved to its own BrowserWindow with General, Account, Skills, and MCP tabs (plus dev-only tabs for color reference, component library, and platform switching).
  • Removed: old settings modal, DevController overlay, theme screenshot preview/Customize section.

Full architecture details in the companion docs checked into this branch:

  • NEW-UI.md — Panel layout, color system, settings window, navigation
  • NEW-AGENT.md — Tasks, AI agent, MCP tools, data model, IPC interface
  • NEW-BROWSER.md — Browser panel, auto-auth, CSP, loading states

Testing Instructions

  • npm install && npm start
  • Verify the three-panel layout loads with nav, primary, and secondary panels
  • Resize panels by dragging handles; collapse/expand with Cmd+B and Cmd+Shift+B
  • Click a site in the sidebar — primary panel shows site content tabs, browser shows the site
  • Start a site and verify the browser auto-authenticates (WP admin bar visible)
  • Click + in the Tasks section to create a task — requires a Claude auth provider (wpcom token, Claude auth, or API key)
  • Send a message and verify the agent responds with tool usage visible as expandable cards
  • Verify panel sizes and collapsed state persist after reload

shaunandrews and others added 30 commits April 1, 2026 15:34
Settings now opens in its own BrowserWindow instead of an in-app
overlay. The renderer entry point routes to SettingsRoot or Root
based on ?view=settings. Menu shortcut (Cmd+,) calls
openSettingsWindow directly. Sentry and logging init stripped
from renderer for now — will be restored when wiring up the
full app.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
New CSS custom properties (--color-chrome-*) for window chrome
surfaces, matching the existing frame token pattern. Light mode
uses a warm gray bg with dark text; dark mode uses near-black
with white text at various opacities. Mapped to Tailwind as
bg-chrome, text-chrome-text, etc.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replaces the legacy sidebar+content layout with a PanelNavigation /
PanelPrimary / PanelSecondary structure using react-resizable-panels.
Panels collapse via Cmd+B / Cmd+Shift+B or toolbar buttons, with
animated transitions. Toolbar component provides start/middle/end
slots with a truly centered middle. Primary toolbar adapts with an
inset for macOS traffic lights when nav is collapsed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Placeholder components for the redesigned UI panels. Settings window
includes General, Account, Colors (token reference), and a component
library tab. These are scaffolding — functional wiring comes later.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Dev-only floating controller to switch between macOS/Windows modes
for testing UI adaptation. Main window background color now reads
from nativeTheme to match chrome tokens in light/dark mode.
Traffic light position tweaked to y:18.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Wire the existing SiteMenu and RunningSites components into the new
sidebar instead of bespoke buttons. Add start/stop all toggle to the
Sites section header.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace hardcoded hex colors with chrome-* tokens for light/dark mode
support. Rewrite drag-and-drop to animate items into position using
translateY transitions instead of static indicators.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Use react-resizable-panels' useDefaultLayout to save/restore panel
sizes via localStorage. Separately persist collapsed state so panels
restore correctly on reload. Sync navCollapsed when panels collapse
via drag so the macOS traffic light inset updates. Wire settings
button and separator color tokens.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Rename Components tab to WP Components. Add Studio Components tab
with MockProviders wrapping SiteMenu and Sidebar so they render
with fake site data in the settings window.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove redundant ContentHeader from site-details (now handled by
panel-layout toolbar). Set toolbar min-height instead of border-bottom
for consistent spacing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace SiteContent with SiteContentTabs in the primary panel.
Reduce content tab top padding. Fix settings toolbar formatting.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The settings window was a stub with only a color scheme picker.
Now it has the full set: appearance, language, editor, terminal,
CLI toggle, account, skills, and MCP — all instant-save. Adds
Redux/I18n/Auth providers and tab deep-linking via URL param.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Callers now use openSettingsWindow with tab deep-linking instead
of the old showUserSettings IPC event that targeted a modal that
no longer renders in the new UI.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Platform switching now lives in the settings window. The main window
listens for cross-window localStorage changes instead of custom events.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…sktop

The system prompt has zero dependencies and is needed by both the CLI
agent and the new desktop agent integration. CLI now re-exports from
the shared location.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
TaskMetadata type with id, siteId, title, status, archived, sessionId.
Task CRUD handlers (create/get/update/archive/delete) plus agent
lifecycle handlers (start/send/interrupt/respond-to-permission).
Tasks persisted in appdata-v1.json alongside site data. Six new IPC
events for main->renderer communication.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Manages task list, selected task, messages per task, streaming state,
and pending permission requests. Merges tool results onto invocations
by tool_use_id. Listeners for task-updated, task-message,
task-status-changed, task-permission-request, and task-error events.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace sidebar Tasks placeholder with TaskList component. Primary
panel conditionally renders TaskChatPanel vs SiteContentTabs based on
selectedTaskId. Site list clears task selection on click and suppresses
highlight when a task is active. New Task button on site overview.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
AgentManager runs Claude Agent SDK in Electron main process with
desktop-native MCP tools (site_list, site_info, site_start, site_stop,
wp_cli) using SiteServer directly. Provider resolver with wpcom/claude/
api-key fallback. Message serializer converts SDKMessages including
tool results. Chat UI with expandable tool call cards showing full
input/output, permission prompts, and streaming indicators.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The message serializer was creating assistant messages from both
'assistant' SDK events and the final 'result' event, which contains
the same text. Only surface errors from result messages now.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Messages were lost on app refresh or restart because they only lived
in Redux memory. Now messagesByTask is saved to localStorage on every
change and restored on init, matching the existing chat persistence
pattern.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
wp post update replaces entire page content, making targeted block
edits risky. These tools use WordPress parse_blocks/serialize_blocks
to let the agent read individual blocks by index and replace them
surgically. Markup is base64-encoded to avoid PHP escaping issues.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Tasks can now be archived via a hover button on each item. An archive
toggle in the header switches between active and archived views. The
archived view shows a count and Clear all button that batch-deletes
all archived tasks via a new clearArchivedTasks IPC handler.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The agent often uses the directory basename from its cwd (e.g.
"my-serene-website") instead of the display name ("Next to Kin"),
causing a failed lookup followed by a site_list round-trip. Now all
MCP tool lookups try display name first, then path basename.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replaces the secondary panel placeholder with a functional browser
that previews the active site. Auto-authenticates via /studio-auto-login
so the WP admin bar is always visible. Strips framing headers from
localhost responses so wp-admin pages load in the iframe.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
shaunandrews and others added 10 commits April 2, 2026 20:48
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Images exceeding the 4MB base64 threshold (API limit is 5MB) are
now auto-resized via canvas before being sent. Applied at file
picker/paste (task-chat-input) and browser screenshot capture
(use-area-screenshot). Also sends ai:done after ai:error in the
headless agent so the desktop properly cleans up and follow-ups
can resume via session ID.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Titles are generated in the background after the first message.
Summaries are generated after the agent's first turn completes.
Both use a lightweight Haiku call through the headless agent's
IPC channel to reuse existing auth resolution.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Messages sent during streaming are queued in Redux and auto-sent
when the agent finishes its current turn. Queued messages appear
as dismissible chips above the input.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Tool messages are filtered from the conversation view. A new
activity indicator above the input shows the agent's current
state with an expandable log of all activity.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Chat input now accepts areaScreenshot for in-task browser captures,
auto-imports screenshots as image attachments, resizes oversized
images, and supports queuing messages while the agent is streaming.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Shows task title, summary, and status in a tooltip-style card
when hovering sidebar task items. Uses delayed show with fast
re-entry to feel responsive without being distracting.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Toolbar buttons reordered: nav controls, tabs, then select/capture
at the end. Added iframe URL polling for SPA navigation detection.
Sidebar gains an Add Site button; tab label simplified to URL only.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
shaunandrews and others added 15 commits April 6, 2026 09:51
The separate Electron BrowserWindow for site creation is superseded
by the Task-based project creation flow running in the main window.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
New users see a full-width creation flow (sidebar hidden). The
chooser and new-project chat live in the primary panel. Setup
tasks use a SETUP_SITE_ID placeholder and migrate to the real
site after site_create completes. Cmd+N triggers create-project
IPC event instead of opening a separate window.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
AskUserQuestion now routes through a dedicated question IPC channel
instead of reusing permission prompts. Questions render as interactive
cards in the chat with clickable options and a free-text fallback.
Also fixes buildContentBlocks to handle empty text gracefully.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Local file paths from browser_navigate are served via an HTTP
server (CSP blocks file:// in iframes). Browser panel gains
hasContent flag, open-tab event support, and handles setup
tasks without a running site.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Shortcuts now show actual app icons (VS Code, Terminal, Finder,
phpMyAdmin) instead of generic WordPress icons. Tasks section
with inline chat input added to overview. Publish section moved
above shortcuts. phpMyAdmin opens in browser panel tab.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Tasks for deleted sites are hidden. Setup tasks (SETUP_SITE_ID)
appear at the top without a site group header.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Non-modal tooltip that points to DOM elements with a message.
Used to introduce sidebar and project detail after first build.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Expands site-spec to 5 rounds (name, goals, structure, stack, tone).
NEW-SITE-CREATION.md rewritten for Task-based creation with design
previews. browser_navigate docs updated for local file support.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replaces the two-section sidebar (scrollable tasks + fixed projects) with
a single ProjectList where each project row has a toggle chevron, clickable
name for navigation, hover + button for new tasks, and status indicator.
Includes project preview card on hover and preserves drag reorder, context
menus, and archive functionality.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The custom implementation used a Popover with hardcoded dark background and
a broken fade animation. Now wraps @wordpress/components Tooltip directly,
keeping the disabled/icon prop API for compatibility.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ration

Tasks can now be renamed inline via an EditableTaskTitle component, triggered
from a new Rename option in the task menu. TaskNewPanel auto-creates when only
one site exists. Browser floating input generates a title from the first message.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Browser collapsed state now syncs correctly on drag resize. Task title in
the toolbar is editable. Auto-start creation flow only triggers when there
are no tasks either. Updated NEW-SITE-CREATION.md with implementation status
and revised site-spec skill.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…chive icon

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
shaunandrews and others added 3 commits April 8, 2026 15:16
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… lifecycle

Renames Select Element to Add Notes. The floating input now appears in both
task-chat and project-detail modes. In task chat, notes are numbered, queued
while the agent responds, and shown as labeled overlays that turn green on
completion and fade away.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant