Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions packages/desktop/src/components/ui/app-shell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -373,12 +373,17 @@ function AccountMenu({ account, renderLink }: { account: AppAccount; renderLink?
function Brand({ brand, renderLink }: { brand: AppShellBrand; renderLink?: AppLinkRenderer }) {
const content = (
<>
{/* Collapsed, the button keeps its 8px padding but the tile is the full
32px rail width, so it hangs off to the right; pulling it back by the
padding puts it on the same centre line as the nav icons. */}
{brand.logo && (
<div className='bg-primary text-primary-foreground flex size-8 shrink-0 items-center justify-center rounded-lg shadow-xs'>
<div className='bg-primary text-primary-foreground flex size-8 shrink-0 items-center justify-center rounded-lg shadow-xs group-data-[collapsible=icon]:-ml-2'>
{brand.logo}
</div>
)}
<div className='grid min-w-0 flex-1 text-left text-sm leading-tight'>
{/* Collapsed to the icon rail there is only room for the logo tile; leaving
the text in the flex row pushes the tile off the rail's centre line. */}
<div className='grid min-w-0 flex-1 text-left text-sm leading-tight group-data-[collapsible=icon]:hidden'>
<span className='truncate font-medium' title={typeof brand.name === 'string' ? brand.name : undefined}>
{brand.name}
</span>
Expand Down
10 changes: 7 additions & 3 deletions packages/desktop/src/renderer/routes/project-switcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,20 @@ export function ProjectSwitcher({ projects, current, onSelect, onManage }: Proje
/>
}
>
<div className='bg-sidebar-accent text-sidebar-accent-foreground flex size-8 shrink-0 items-center justify-center rounded-lg'>
{/* Pulled back by the button's collapsed padding so the tile lands on the
same centre line as the nav icons below it. */}
<div className='bg-sidebar-accent text-sidebar-accent-foreground flex size-8 shrink-0 items-center justify-center rounded-lg group-data-[collapsible=icon]:-ml-2'>
<FolderOpen className='size-4' />
</div>
<div className='grid min-w-0 flex-1 text-left text-sm leading-tight'>
{/* Collapsed, only the tile fits: keeping the label and chevron in the
flex row would shove the icon off the rail's centre line. */}
<div className='grid min-w-0 flex-1 text-left text-sm leading-tight group-data-[collapsible=icon]:hidden'>
<span className='text-muted-foreground truncate text-xs'>Project</span>
<span className='truncate font-medium' title={current ?? undefined}>
{current ?? 'None yet'}
</span>
</div>
<ChevronsUpDown className='ml-auto size-4' />
<ChevronsUpDown className='ml-auto size-4 group-data-[collapsible=icon]:hidden' />
</DropdownMenuTrigger>
<DropdownMenuContent className='min-w-56 rounded-lg' side='bottom' align='start' sideOffset={4}>
<DropdownMenuLabel>Switch project</DropdownMenuLabel>
Expand Down
Loading