11import { Link , NavLink , Outlet , useLocation } from 'react-router-dom'
22import { Brand , ExpiryWarningBanner , ScopePill , useExpiryTick } from '../components/Common'
33import { useEffect , useState , type ReactNode } from 'react'
4- import { addEnv , setEnv , useDashboardCtx , type DashboardCtx } from '../hooks/useDashboardCtx'
4+ import { useDashboardCtx , type DashboardCtx } from '../hooks/useDashboardCtx'
55import * as api from '../api'
66import type { TeamSummary } from '../api'
77import { UserMenu } from './UserMenu'
@@ -53,9 +53,9 @@ function computeMeta(routeKey: string, pathname: string, ctx: DashboardCtx): Pag
5353function computeCrumb ( routeKey : string , pathname : string , ctx : DashboardCtx ) : string {
5454 switch ( routeKey ) {
5555 case '/' :
56- return ctx . env
56+ return 'overview'
5757 case '/resources' :
58- return `${ ctx . env } · ${ ctx . counts . resources } active`
58+ return `${ ctx . counts . resources } active`
5959 case '/resources/:id' : {
6060 // Try to resolve resource_type from the loaded resource list (the
6161 // detail page id appears in the URL). Fall back to em-dash if we
@@ -66,11 +66,11 @@ function computeCrumb(routeKey: string, pathname: string, ctx: DashboardCtx): st
6666 return `resources / ${ kind } `
6767 }
6868 case '/deployments' :
69- return `${ ctx . env } · ${ ctx . counts . deployments } active`
69+ return `${ ctx . counts . deployments } active`
7070 case '/deployments/:id' :
7171 return 'deployments / live'
7272 case '/vault' :
73- return `${ ctx . env } · ${ ctx . counts . vault } entries`
73+ return `${ ctx . counts . vault } entries`
7474 case '/team' :
7575 return 'members & invites'
7676 case '/billing' :
@@ -209,8 +209,11 @@ export function AppShell() {
209209 < div className = "av" > { teamInitial } </ div >
210210 < div className = "org-info" >
211211 < div className = "org-name" data-testid = "org-name" > { teamSlug } </ div >
212+ { /* Global env switcher intentionally removed (2026-06-03): the
213+ multi-environment UX is unfinished, so it's hidden to avoid
214+ surfacing a half-built capability. Per-env vault tabs live
215+ on VaultPage where isolation is real. */ }
212216 < div className = "org-env" >
213- < EnvSwitcher value = { ctx . env } options = { ctx . envs } />
214217 < span className = "switch-hint" > { tier } </ span >
215218 </ div >
216219 </ div >
@@ -467,56 +470,3 @@ function routeIdToKey(_id: string, pathname: string): string {
467470 if ( / ^ \/ d e p l o y m e n t s \/ [ ^ / ] + $ / . test ( stripped ) ) return '/deployments/:id'
468471 return stripped
469472}
470-
471- // ──────────────────────────────────────────────────────────────────────────
472- // EnvSwitcher — pill-shaped <select> wired to the dashboard ctx. Selecting
473- // "+ new env" opens a tiny inline input that creates an env locally; the
474- // next API call carries the new env in the query string.
475- function EnvSwitcher ( { value, options } : { value : string ; options : string [ ] } ) {
476- const [ creating , setCreating ] = useState ( false )
477- const [ draft , setDraft ] = useState ( '' )
478- if ( creating ) {
479- return (
480- < span className = "env-pill prod" style = { { display : 'inline-flex' , gap : 4 , padding : '2px 6px' } } >
481- < input
482- autoFocus
483- value = { draft }
484- onChange = { ( e ) => setDraft ( e . target . value ) }
485- onBlur = { ( ) => { if ( draft . trim ( ) ) addEnv ( draft ) ; setCreating ( false ) ; setDraft ( '' ) } }
486- onKeyDown = { ( e ) => {
487- if ( e . key === 'Enter' && draft . trim ( ) ) { addEnv ( draft ) ; setCreating ( false ) ; setDraft ( '' ) }
488- if ( e . key === 'Escape' ) { setCreating ( false ) ; setDraft ( '' ) }
489- } }
490- placeholder = "staging"
491- data-testid = "env-create-input"
492- style = { {
493- background : 'transparent' , border : 0 , outline : 'none' , color : 'var(--accent)' ,
494- font : 'inherit' , width : 80 , fontFamily : 'var(--font-mono)' , fontSize : 11 ,
495- } }
496- />
497- </ span >
498- )
499- }
500- return (
501- < select
502- data-testid = "env-switcher"
503- className = "env-pill prod"
504- value = { value }
505- onChange = { ( e ) => {
506- if ( e . target . value === '__new__' ) setCreating ( true )
507- else setEnv ( e . target . value )
508- } }
509- style = { {
510- appearance : 'none' , WebkitAppearance : 'none' , cursor : 'pointer' ,
511- border : '1px solid var(--accent-glow)' , background : 'var(--accent-soft)' ,
512- color : 'var(--accent)' , fontFamily : 'var(--font-mono)' , fontSize : 11 ,
513- padding : '2px 8px' , borderRadius : 4 ,
514- } }
515- >
516- { options . map ( ( o ) => (
517- < option key = { o } value = { o } > { o } </ option >
518- ) ) }
519- < option value = "__new__" style = { { color : 'var(--violet)' } } > + new env…</ option >
520- </ select >
521- )
522- }
0 commit comments