Skip to content

fix(web): restore deploy state across drawer open-close cycles#399

Open
arielshad wants to merge 2 commits intomainfrom
feat/drawer-deploy-state
Open

fix(web): restore deploy state across drawer open-close cycles#399
arielshad wants to merge 2 commits intomainfrom
feat/drawer-deploy-state

Conversation

@arielshad
Copy link
Copy Markdown
Contributor

Summary

  • Move deploy target UI from inline feature-drawer-client into BaseDrawer header — the deploy play/stop button and status badge are now passed via a deployTarget prop to BaseDrawer, removing ~40 lines of duplicated deploy UI from feature-drawer-client.tsx
  • Add initial deployment status fetch on mount in useDeployAction — when the drawer opens, the hook now calls getDeploymentStatus() to discover any already-running dev server, preventing the "lost" deploy state bug when closing and reopening the feature drawer
  • Update tests for new initial-fetch behavior — 7 new tests covering initial status fetch (mount recovery, polling start, stopped/null states, unmount cancellation), plus existing test adjustments to account for the initial fetch call

Root Cause

When the feature drawer was closed and reopened, useDeployAction was called fresh with no knowledge of any previously started dev server. The deploy state (Booting/Ready + URL) was only tracked in-memory during the hook's lifecycle, so closing the drawer destroyed it.

Fix

On mount (or when input.targetId changes), the hook now proactively fetches the current deployment status via getDeploymentStatus(). If a non-Stopped deployment is found, the hook restores the status and URL and starts polling to keep the state fresh.

Evidence

  • Control center with deploy status badges visible on canvas nodes
    Control center

  • Feature drawer with deploy target play button in BaseDrawer header
    Feature drawer

  • Feature drawer with active deployment persisted across open/close
    Active deployment

  • Unit tests: 28 tests passing across 2 test files (25 in use-deploy-action including 7 new initial-status-fetch tests, 3 in control-center with getDeploymentStatus mock)

Test plan

  • All 4069 unit tests pass (313 test files)
  • Build compiles without errors
  • Lint passes with zero warnings
  • Pre-commit hooks pass (eslint, prettier, typecheck)

🤖 Generated with Claude Code

arielshad and others added 2 commits March 16, 2026 19:15
Move deploy target UI from inline feature-drawer-client into BaseDrawer
header prop and add initial deployment status fetch on mount so
useDeployAction picks up already-running dev servers when the drawer
reopens. Adds 7 new unit tests for initial status fetch behavior.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@github-actions
Copy link
Copy Markdown
Contributor

Dev Release Published

Artifact Version Install
npm 1.123.0-pr399.41eb3f6 npm install -g @shepai/[email protected]

Published from commit ac88862 | View CI

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