1010 * - Right segment: Global search placeholder, mode badge, ThemeToggle, UserMenu
1111 */
1212
13- import { useLocation , useParams } from '@tanstack/react-router' ;
13+ import { Link , useLocation , useParams } from '@tanstack/react-router' ;
1414import { useMemo } from 'react' ;
1515import { Separator } from '@/components/ui/separator' ;
1616import {
@@ -24,13 +24,11 @@ import {
2424import { ThemeToggle } from '@/components/theme-toggle' ;
2525import { Badge } from '@/components/ui/badge' ;
2626import { Input } from '@/components/ui/input' ;
27- import { Cpu , Search } from 'lucide-react' ;
27+ import { Boxes , Cpu , Search } from 'lucide-react' ;
2828import { config } from '@/lib/config' ;
2929import { ProjectSwitcher } from '@/components/project-switcher' ;
3030import { OrganizationSwitcher } from '@/components/organization-switcher' ;
3131import { UserMenu } from '@/components/user-menu' ;
32- import { PackageSwitcher } from '@/components/package-switcher' ;
33- import type { InstalledPackage } from '@objectstack/spec/kernel' ;
3432
3533const META_TYPE_LABELS : Record < string , string > = {
3634 action : 'Actions' ,
@@ -61,20 +59,19 @@ const META_TYPE_LABELS: Record<string, string> = {
6159 theme : 'Themes' ,
6260} ;
6361
64- interface TopBarProps {
65- /** List of installed packages for the PackageSwitcher dropdown */
66- packages ?: InstalledPackage [ ] ;
67- /** Currently selected package */
68- selectedPackage ?: InstalledPackage | null ;
69- /** Callback when a package is selected from the dropdown */
70- onSelectPackage ?: ( pkg : InstalledPackage ) => void ;
62+ function StudioBrand ( ) {
63+ return (
64+ < Link to = "/" className = "flex h-7 w-7 items-center justify-center rounded-md bg-primary text-primary-foreground hover:opacity-90" >
65+ < Boxes className = "h-4 w-4" />
66+ </ Link >
67+ ) ;
68+ }
69+
70+ function SlashDivider ( ) {
71+ return < span aria-hidden className = "text-muted-foreground/50 select-none" > /</ span > ;
7172}
7273
73- export function TopBar ( {
74- packages = [ ] ,
75- selectedPackage = null ,
76- onSelectPackage = ( ) => { } ,
77- } : TopBarProps ) {
74+ export function TopBar ( ) {
7875 const location = useLocation ( ) ;
7976 const params = useParams ( { strict : false } ) as {
8077 package ?: string ;
@@ -130,24 +127,15 @@ export function TopBar({
130127 items . push ( { label : 'Overview' } ) ;
131128 break ;
132129 case 'package-overview' :
133- if ( selectedPackage ?. manifest ?. name ) {
134- items . push ( { label : selectedPackage . manifest . name } ) ;
135- }
136130 items . push ( { label : 'Overview' } ) ;
137131 break ;
138132 case 'object' :
139- if ( selectedPackage ?. manifest ?. name ) {
140- items . push ( { label : selectedPackage . manifest . name } ) ;
141- }
142133 items . push ( { label : 'Objects' } ) ;
143134 if ( params . name ) {
144135 items . push ( { label : params . name } ) ;
145136 }
146137 break ;
147138 case 'metadata' :
148- if ( selectedPackage ?. manifest ?. name ) {
149- items . push ( { label : selectedPackage . manifest . name } ) ;
150- }
151139 if ( params . type ) {
152140 items . push ( { label : META_TYPE_LABELS [ params . type ] || params . type } ) ;
153141 }
@@ -160,7 +148,7 @@ export function TopBar({
160148 }
161149
162150 return items ;
163- } , [ viewType , params , selectedPackage ] ) ;
151+ } , [ viewType , params ] ) ;
164152
165153 // Compute API badge for object/metadata views
166154 const apiBadge = useMemo ( ( ) => {
@@ -173,26 +161,15 @@ export function TopBar({
173161 return null ;
174162 } , [ viewType , params ] ) ;
175163
176- // Show PackageSwitcher only when we're in a package context
177- const showPackageSwitcher = params . package && packages . length > 0 ;
178-
179164 return (
180165 < header className = "flex h-12 shrink-0 items-center justify-between gap-2 border-b px-4" >
181- { /* Left segment: Org + Env + Package switchers */ }
182- < div className = "flex items-center gap-2" >
166+ { /* Left segment: Brand + Org + Project switchers */ }
167+ < div className = "flex items-center gap-1.5" >
168+ < StudioBrand />
169+ < SlashDivider />
183170 < OrganizationSwitcher />
184- < Separator orientation = "vertical" className = "mx-1 h-4" />
171+ < SlashDivider />
185172 < ProjectSwitcher />
186- { showPackageSwitcher && (
187- < >
188- < Separator orientation = "vertical" className = "mx-1 h-4" />
189- < PackageSwitcher
190- packages = { packages }
191- selectedPackage = { selectedPackage }
192- onSelectPackage = { onSelectPackage }
193- />
194- </ >
195- ) }
196173 < Separator orientation = "vertical" className = "mx-2 h-4" />
197174 < Breadcrumb >
198175 < BreadcrumbList >
0 commit comments