dashboard: env-aware deployments — real env + family grid#34
Merged
Conversation
Pairs with the agent-API workstream that lands env + parent_stack_id
on the list endpoint and adds GET /api/v1/stacks/:slug/family.
- listStacks now reads the real env from the API response. Stops
hardcoding 'production' on every stack. Legacy stacks without env
still fall back to 'production' so the UI is back-compat.
- NEW: fetchStackFamily(slug) — typed wrapper around the family
endpoint. Returns a discriminated union so the UI can branch on
upgrade_required (render PromoteUpsell), not_found, and unknown
without leaking APIError into page components.
- DeployDetailPage gains an EnvironmentsGrid section above the
Promote / Copy-vault PromptCards (Pro+ only). One card per env:
env pill, status, URL, last-deploy timestamp. Non-root members get
an inline "Promote <env> → production" PromptCard so the agent
prose stays adjacent to the source env.
- Hobby / free tier path unchanged — the existing PromoteUpsell card
still renders, the new grid is rendered above only for Pro+.
Tests:
- 7 new api/index.test.ts cases (listStacks env, fetchStackFamily
happy path + 402 + 404 + 500 + URL-encoding)
- 6 new DeployDetailPage.test.tsx cases (loading, multi-env render,
single-env render, upgrade_required + unknown silent failure,
empty-family fallback)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Pairs with the agent-API workstream (InstaNode-dev/api#23) that ships
env+parent_stack_idon the list endpoint and addsGET /api/v1/stacks/:slug/family.listStacksnow reads the realenvfrom the API response. Stops hardcoding'production'on every stack. Legacy rows without env still fall back so the UI stays back-compat.fetchStackFamily(slug)— typed wrapper around the family endpoint. Returns a discriminated union ({ok:true,family}/{ok:false,reason:'upgrade_required'|'not_found'|'unknown'}) so the UI can branch on 402 / 404 / 500 without leaking APIError into page components.DeployDetailPagegains anEnvironmentsGridsection above the Promote / Copy-vault PromptCards (Pro+ only). One card per env: env pill, status, URL, last-deploy timestamp. Non-root members get an inline "Promote → production" PromptCard so the agent prose stays adjacent to the source env.PromoteUpsellstill renders, the grid is rendered above only for Pro+ teams (mirrors the server-side 402 contract).Test plan
npx tsc --noEmitcleannpm test -- --run— 183/186 pass (3 pre-existing skips, no new skips)api/index.test.tscases — env field plumbed through listStacks, full fetchStackFamily coverage incl. 402/404/500/URL-encodingDeployDetailPage.test.tsxcases — loading, multi-env render, single-env render, silent-failure modes, empty-family fallback🤖 Generated with Claude Code