Skip to content

Commit cf813ad

Browse files
Replace 'All Apps' and 'Recent' with 'Starred' section in Home sidebar
- Remove 'All Apps' and 'Recent' navigation items from Home context - Add 'Starred' section showing favorited objects, dashboards, and pages - Starred items display with remove action (StarOff icon on hover) - Limited to 8 starred items with emoji indicators by type - Following Airtable pattern for starred/favorite apps Agent-Logs-Url: https://github.com/objectstack-ai/objectui/sessions/9ed674c7-5325-4f86-bd60-d21c636d197a Co-authored-by: xuyushun441-sys <255036401+xuyushun441-sys@users.noreply.github.com>
1 parent 7de4a3a commit cf813ad

File tree

1 file changed

+35
-2
lines changed

1 file changed

+35
-2
lines changed

apps/console/src/components/UnifiedSidebar.tsx

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,6 @@ export function UnifiedSidebar({ activeAppName, onAppChange }: UnifiedSidebarPro
229229
// Home navigation items
230230
const homeNavigation: NavigationItem[] = React.useMemo(() => [
231231
{ id: 'home-dashboard', label: 'Home', type: 'url' as const, url: '/home', icon: 'home' },
232-
{ id: 'home-apps', label: 'All Apps', type: 'url' as const, url: '/home', icon: 'grid-3x3' },
233-
{ id: 'home-recent', label: 'Recent', type: 'url' as const, url: '/home', icon: 'clock' },
234232
], []);
235233

236234
// Determine which navigation to show based on context
@@ -505,6 +503,7 @@ export function UnifiedSidebar({ activeAppName, onAppChange }: UnifiedSidebarPro
505503
</>
506504
) : (
507505
/* Home Navigation */
506+
<>
508507
<SidebarGroup>
509508
<SidebarGroupContent>
510509
<SidebarMenu>
@@ -525,6 +524,40 @@ export function UnifiedSidebar({ activeAppName, onAppChange }: UnifiedSidebarPro
525524
</SidebarMenu>
526525
</SidebarGroupContent>
527526
</SidebarGroup>
527+
528+
{/* Starred Apps */}
529+
{favorites.filter(f => f.type === 'object' || f.type === 'dashboard' || f.type === 'page').length > 0 && (
530+
<SidebarGroup>
531+
<SidebarGroupLabel className="flex items-center gap-1.5">
532+
<Star className="h-3.5 w-3.5" />
533+
Starred
534+
</SidebarGroupLabel>
535+
<SidebarGroupContent>
536+
<SidebarMenu>
537+
{favorites.filter(f => f.type === 'object' || f.type === 'dashboard' || f.type === 'page').slice(0, 8).map(item => (
538+
<SidebarMenuItem key={item.id}>
539+
<SidebarMenuButton asChild tooltip={item.label}>
540+
<Link to={item.href}>
541+
<span className="text-muted-foreground">
542+
{item.type === 'dashboard' ? '📊' : item.type === 'page' ? '📄' : '📋'}
543+
</span>
544+
<span className="truncate">{item.label}</span>
545+
</Link>
546+
</SidebarMenuButton>
547+
<SidebarMenuAction
548+
showOnHover
549+
onClick={(e: any) => { e.stopPropagation(); removeFavorite(item.id); }}
550+
aria-label={`Remove ${item.label} from favorites`}
551+
>
552+
<StarOff className="h-3 w-3" />
553+
</SidebarMenuAction>
554+
</SidebarMenuItem>
555+
))}
556+
</SidebarMenu>
557+
</SidebarGroupContent>
558+
</SidebarGroup>
559+
)}
560+
</>
528561
)}
529562
</div>
530563
</SidebarContent>

0 commit comments

Comments
 (0)