Rename sidebar to LeftSidebar and hide empty filters

This commit is contained in:
Mohamed Boudra
2026-02-19 12:57:23 +07:00
parent 8d379a6215
commit fb6b5ca886
3 changed files with 97 additions and 94 deletions
+3 -3
View File
@@ -20,7 +20,7 @@ import { useState, useEffect, type ReactNode, useMemo, useRef } from "react";
import { Platform } from "react-native"; import { Platform } from "react-native";
import * as Linking from "expo-linking"; import * as Linking from "expo-linking";
import * as Notifications from "expo-notifications"; import * as Notifications from "expo-notifications";
import { SlidingSidebar } from "@/components/sliding-sidebar"; import { LeftSidebar } from "@/components/left-sidebar";
import { DownloadToast } from "@/components/download-toast"; import { DownloadToast } from "@/components/download-toast";
import { ToastProvider } from "@/contexts/toast-context"; import { ToastProvider } from "@/contexts/toast-context";
import { usePanelStore } from "@/stores/panel-store"; import { usePanelStore } from "@/stores/panel-store";
@@ -282,12 +282,12 @@ function AppContainer({ children, selectedAgentId }: AppContainerProps) {
const content = ( const content = (
<View style={{ flex: 1, backgroundColor: theme.colors.surface0 }}> <View style={{ flex: 1, backgroundColor: theme.colors.surface0 }}>
<View style={{ flex: 1, flexDirection: "row" }}> <View style={{ flex: 1, flexDirection: "row" }}>
{!isMobile && chromeEnabled && <SlidingSidebar selectedAgentId={selectedAgentId} />} {!isMobile && chromeEnabled && <LeftSidebar selectedAgentId={selectedAgentId} />}
<View style={{ flex: 1, paddingLeft: needsTrafficLightPadding ? trafficLightPadding.left : 0 }}> <View style={{ flex: 1, paddingLeft: needsTrafficLightPadding ? trafficLightPadding.left : 0 }}>
{children} {children}
</View> </View>
</View> </View>
{isMobile && chromeEnabled && <SlidingSidebar selectedAgentId={selectedAgentId} />} {isMobile && chromeEnabled && <LeftSidebar selectedAgentId={selectedAgentId} />}
<DownloadToast /> <DownloadToast />
<CommandCenter /> <CommandCenter />
<KeyboardShortcutsDialog /> <KeyboardShortcutsDialog />
@@ -43,11 +43,11 @@ import {
const DESKTOP_SIDEBAR_WIDTH = 320; const DESKTOP_SIDEBAR_WIDTH = 320;
interface SlidingSidebarProps { interface LeftSidebarProps {
selectedAgentId?: string; selectedAgentId?: string;
} }
export function SlidingSidebar({ selectedAgentId }: SlidingSidebarProps) { export function LeftSidebar({ selectedAgentId }: LeftSidebarProps) {
const { theme } = useUnistyles(); const { theme } = useUnistyles();
const insets = useSafeAreaInsets(); const insets = useSafeAreaInsets();
const isMobile = const isMobile =
@@ -488,6 +488,7 @@ export function SidebarAgentList({
projectOptions.find((option) => option.projectKey === selectedProjectKeys[0]) ?? null projectOptions.find((option) => option.projectKey === selectedProjectKeys[0]) ?? null
); );
}, [projectOptions, selectedProjectKeys]); }, [projectOptions, selectedProjectKeys]);
const showProjectFilters = projectOptions.length > 0;
const sessions = useSessionStore((state) => state.sessions); const sessions = useSessionStore((state) => state.sessions);
const projectIconRequests = useMemo(() => { const projectIconRequests = useMemo(() => {
@@ -745,6 +746,7 @@ export function SidebarAgentList({
return ( return (
<View style={styles.container}> <View style={styles.container}>
{showProjectFilters ? (
<View style={styles.filtersRow}> <View style={styles.filtersRow}>
<Pressable <Pressable
ref={projectFilterAnchorRef} ref={projectFilterAnchorRef}
@@ -837,6 +839,7 @@ export function SidebarAgentList({
</View> </View>
</Combobox> </Combobox>
</View> </View>
) : null}
<DraggableList <DraggableList
data={entries} data={entries}