Skip to content

DeployCreatePage: private deploys + IP allow-list UI (Pro+)#44

Merged
mastermanas805 merged 1 commit into
mainfrom
feat/private-deploy-ui-fresh
May 12, 2026
Merged

DeployCreatePage: private deploys + IP allow-list UI (Pro+)#44
mastermanas805 merged 1 commit into
mainfrom
feat/private-deploy-ui-fresh

Conversation

@mastermanas805
Copy link
Copy Markdown
Member

Summary

Track B for the private-deploy feature (Track A ships the backend in parallel). Adds an opt-in "Private deploy" toggle on /app/deployments and the privacy state + Pro+ inline editor on /app/deployments/:id. Hobby / free / anonymous see a feature-specific UpgradePromptCard for the new private_deploy key.

  • New API helpers: createDeploy() and updateDeploymentAccess() lock the wire shape (private: boolean, allowed_ips: string[]) for both the agent prompt and the future PATCH path. DashboardDeployment gains private (defaults false) + allowed_ips (defaults []) so older API responses never silently inherit stale privacy state.
  • IpAllowList (new reusable tag input): Enter / comma / space commits, Backspace-on-empty pops the last chip, × on each chip removes, loose IPv4 + IPv6 + CIDR regex gives red-border feedback on bogus entries (server has the real validator), 32-entry cap matches the backend.
  • DeploymentsPage: Pro+ tier renders the PrivateDeployConfigurator (toggle + IP allow-list + PromptCard whose body mirrors createDeploy()'s wire shape — keeps the dashboard's read-only / agent-driven pattern). Hobby / free / anonymous render UpgradePromptCard feature="private_deploy".
  • DeployDetailPage: header gains a private badge; PrivacyPanel surfaces the public / private state; Pro+ tier gets an inline editor (toggle + IpAllowList + save/cancel). The editor calls updateDeploymentAccess() and on 404 surfaces "edits pending backend" copy (Track A's PATCH is still rolling out) — no fake confirmation when the change didn't land.
  • upgradeCopy.ts: new private_deploy key per U2 pattern.

Test plan

  • npm test — 329 / 329 pass, 3 pre-existing skips (45 new tests added)
  • npm run build clean
  • IpAllowList unit tests: add/remove/Backspace/validate/max-32/disabled mode
  • DeploymentsPage tier-gate + toggle behaviour tests
  • DeployDetailPage privacy panel: public hint, private + allow-list display, edit flow, 404 hint, disabled save when private+empty
  • createDeploy + updateDeploymentAccess contract tests (status codes 200/400/402/404, field names, URI encoding)

Backend assumptions (Track A)

  • POST /deploy/new accepts { private?: boolean, allowed_ips?: string[] }
  • GET /api/v1/deployments/:id returns { private: boolean, allowed_ips: string[] }
  • PATCH /api/v1/deployments/:id with same body for updates (this PR returns 404 → friendly hint until shipped)
  • 402 on hobby / anonymous / free with agent_action for upgrade
  • 400 on invalid IPs / empty allowed_ips when private=true

🤖 Generated with Claude Code

Track B for the private-deploy feature. Surfaces an opt-in "Private deploy"
toggle on /app/deployments and renders the privacy state + Pro+ editor on
/app/deployments/:id. Pro/Team/Growth get the live configurator; hobby /
free / anonymous get the feature-specific UpgradePromptCard via the new
`private_deploy` key in upgradeCopy.ts.

- api: createDeploy() + updateDeploymentAccess(); private/allowed_ips on
  DashboardDeployment + adapter. private defaults to false on older API
  builds so the UI never silently inherits stale state. PATCH endpoint is
  Track A's responsibility — a 404 surfaces a friendly "edits pending
  backend" hint instead of a raw error.
- IpAllowList: reusable tag input. Enter / comma / space commits; Backspace
  on empty pops; chips with × removal; loose IPv4 + IPv6 + CIDR regex with
  red-border feedback (server has the real validator); max 32 entries
  matching backend cap.
- DeploymentsPage: PrivateDeployConfigurator (Pro+) builds a precise agent
  prompt mirroring the createDeploy() wire shape — consistent with the
  read-only / agent-driven dashboard pattern.
- DeployDetailPage: header gains a `private` badge; PrivacyPanel section
  on the Overview tab shows public-hint or allowed_ips list; Pro+ edit
  affordance with save / cancel + tier + 404 error handling.
- Tests: 45 new tests across IpAllowList (19), DeploymentsPage tier-gate
  + toggle behaviour (5), DeployDetailPage privacy panel (6), and api
  contract coverage for createDeploy + updateDeploymentAccess (10).
  329/329 pass; 3 pre-existing skips. Build clean.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@mastermanas805 mastermanas805 merged commit f05493e into main May 12, 2026
1 of 2 checks passed
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