Skip to content

Commit e392f5a

Browse files
felarof99claude
andcommitted
feat: convert settings page to popup dialog, move workflows to main nav
Replace the dedicated settings page layout (SettingsSidebarLayout) with a modal dialog (SettingsDialog) that opens on top of the current page. Settings are now accessible via a dialog triggered from the main sidebar, eliminating the confusing dual-sidebar navigation pattern. - Create SettingsDialog with tabbed left panel and content area - Move Workflows into main sidebar navigation (feature-gated) - Remove /settings/* routes (except /settings/survey) - Delete SettingsSidebarLayout and SettingsSidebar components - Update backward compatibility redirects Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 59b00a6 commit e392f5a

7 files changed

Lines changed: 282 additions & 285 deletions

File tree

packages/browseros-agent/apps/agent/components/sidebar/AppSidebar.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ import { SidebarUserFooter } from './SidebarUserFooter'
77
interface AppSidebarProps {
88
expanded?: boolean
99
onOpenShortcuts?: () => void
10+
onOpenSettings?: () => void
1011
}
1112

1213
export const AppSidebar: FC<AppSidebarProps> = ({
1314
expanded = false,
1415
onOpenShortcuts,
16+
onOpenSettings,
1517
}) => {
1618
return (
1719
<div
@@ -21,7 +23,7 @@ export const AppSidebar: FC<AppSidebarProps> = ({
2123
)}
2224
>
2325
<SidebarBranding expanded={expanded} />
24-
<SidebarNavigation expanded={expanded} />
26+
<SidebarNavigation expanded={expanded} onOpenSettings={onOpenSettings} />
2527
<SidebarUserFooter
2628
expanded={expanded}
2729
onOpenShortcuts={onOpenShortcuts}

packages/browseros-agent/apps/agent/components/sidebar/SettingsSidebar.tsx

Lines changed: 0 additions & 182 deletions
This file was deleted.

packages/browseros-agent/apps/agent/components/sidebar/SidebarNavigation.tsx

Lines changed: 52 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {
22
Brain,
33
CalendarClock,
4+
GitBranch,
45
Home,
56
PlugZap,
67
Settings,
@@ -21,13 +22,15 @@ import { cn } from '@/lib/utils'
2122

2223
interface SidebarNavigationProps {
2324
expanded?: boolean
25+
onOpenSettings?: () => void
2426
}
2527

2628
type NavItem = {
2729
name: string
28-
to: string
30+
to?: string
2931
icon: typeof Home
3032
feature?: Feature
33+
action?: 'settings'
3134
}
3235

3336
const primaryNavItems: NavItem[] = [
@@ -39,6 +42,12 @@ const primaryNavItems: NavItem[] = [
3942
feature: Feature.MANAGED_MCP_SUPPORT,
4043
},
4144
{ name: 'Scheduled Tasks', to: '/scheduled', icon: CalendarClock },
45+
{
46+
name: 'Workflows',
47+
to: '/workflows',
48+
icon: GitBranch,
49+
feature: Feature.WORKFLOW_SUPPORT,
50+
},
4251
{
4352
name: 'Skills',
4453
to: '/home/skills',
@@ -57,11 +66,15 @@ const primaryNavItems: NavItem[] = [
5766
icon: Sparkles,
5867
feature: Feature.SOUL_SUPPORT,
5968
},
60-
{ name: 'Settings', to: '/settings/ai', icon: Settings },
69+
{ name: 'Settings', icon: Settings, action: 'settings' },
6170
]
6271

72+
const navItemClassName =
73+
'flex h-9 items-center gap-2 overflow-hidden whitespace-nowrap rounded-md px-3 font-medium text-sm transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground'
74+
6375
export const SidebarNavigation: FC<SidebarNavigationProps> = ({
6476
expanded = true,
77+
onOpenSettings,
6578
}) => {
6679
const location = useLocation()
6780
const { supports } = useCapabilities()
@@ -76,16 +89,47 @@ export const SidebarNavigation: FC<SidebarNavigationProps> = ({
7689
<nav className="space-y-1">
7790
{filteredItems.map((item) => {
7891
const Icon = item.icon
79-
const isActive =
80-
item.to === '/settings/ai'
81-
? location.pathname.startsWith('/settings')
82-
: location.pathname === item.to
8392

93+
// Settings is a button that opens the dialog
94+
if (item.action === 'settings') {
95+
const settingsButton = (
96+
<button
97+
type="button"
98+
onClick={onOpenSettings}
99+
className={cn(navItemClassName, 'w-full')}
100+
>
101+
<Icon className="size-4 shrink-0" />
102+
<span
103+
className={cn(
104+
'truncate transition-opacity duration-200',
105+
expanded ? 'opacity-100' : 'opacity-0',
106+
)}
107+
>
108+
{item.name}
109+
</span>
110+
</button>
111+
)
112+
113+
if (!expanded) {
114+
return (
115+
<Tooltip key="settings">
116+
<TooltipTrigger asChild>{settingsButton}</TooltipTrigger>
117+
<TooltipContent side="right">{item.name}</TooltipContent>
118+
</Tooltip>
119+
)
120+
}
121+
122+
return <div key="settings">{settingsButton}</div>
123+
}
124+
125+
// Regular nav items use NavLink
126+
const itemPath = item.to ?? '/home'
127+
const isActive = location.pathname === itemPath
84128
const navItem = (
85129
<NavLink
86-
to={item.to}
130+
to={itemPath}
87131
className={cn(
88-
'flex h-9 items-center gap-2 overflow-hidden whitespace-nowrap rounded-md px-3 font-medium text-sm transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground',
132+
navItemClassName,
89133
isActive &&
90134
'bg-sidebar-accent text-sidebar-accent-foreground',
91135
)}

packages/browseros-agent/apps/agent/entrypoints/app/App.tsx

Lines changed: 13 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,17 @@ import { OnboardingDemo } from '../onboarding/demo/OnboardingDemo'
88
import { FeaturesPage } from '../onboarding/features/Features'
99
import { Onboarding } from '../onboarding/index/Onboarding'
1010
import { StepsLayout } from '../onboarding/steps/StepsLayout'
11-
import { AISettingsPage } from './ai-settings/AISettingsPage'
1211
import { ConnectMCP } from './connect-mcp/ConnectMCP'
1312
import { CreateGraphWrapper } from './create-graph/CreateGraphWrapper'
14-
import { CustomizationPage } from './customization/CustomizationPage'
1513
import { SurveyPage } from './jtbd-agent/SurveyPage'
1614
import { AuthLayout } from './layout/AuthLayout'
17-
import { SettingsSidebarLayout } from './layout/SettingsSidebarLayout'
1815
import { SidebarLayout } from './layout/SidebarLayout'
19-
import { LlmHubPage } from './llm-hub/LlmHubPage'
2016
import { LoginPage } from './login/LoginPage'
2117
import { LogoutPage } from './login/LogoutPage'
2218
import { MagicLinkCallback } from './login/MagicLinkCallback'
23-
import { MCPSettingsPage } from './mcp-settings/MCPSettingsPage'
2419
import { MemoryPage } from './memory/MemoryPage'
2520
import { ProfilePage } from './profile/ProfilePage'
2621
import { ScheduledTasksPage } from './scheduled-tasks/ScheduledTasksPage'
27-
import { SearchProviderPage } from './search-provider/SearchProviderPage'
2822
import { SkillsPage } from './skills/SkillsPage'
2923
import { SoulPage } from './soul/SoulPage'
3024
import { WorkflowsPageWrapper } from './workflows/WorkflowsPageWrapper'
@@ -42,12 +36,12 @@ const OptionsRedirect: FC = () => {
4236
const path = params['*'] || ''
4337

4438
const routeMap: Record<string, string> = {
45-
ai: '/settings/ai',
46-
chat: '/settings/chat',
39+
ai: '/home',
40+
chat: '/home',
4741
'connect-mcp': '/connect-apps',
48-
mcp: '/settings/mcp',
49-
customization: '/settings/customization',
50-
search: '/settings/search',
42+
mcp: '/home',
43+
customization: '/home',
44+
search: '/home',
5145
soul: '/home/soul',
5246
skills: '/home/skills',
5347
'jtbd-agent': '/settings/survey',
@@ -56,7 +50,7 @@ const OptionsRedirect: FC = () => {
5650
'create-graph': '/workflows/create-graph',
5751
}
5852

59-
const newPath = routeMap[path] || '/settings/ai'
53+
const newPath = routeMap[path] || '/home'
6054
return <Navigate to={newPath} replace />
6155
}
6256

@@ -91,18 +85,11 @@ export const App: FC = () => {
9185
<Route path="scheduled" element={<ScheduledTasksPage />} />
9286
</Route>
9387

94-
{/* Settings with dedicated sidebar */}
95-
<Route element={<SettingsSidebarLayout />}>
96-
<Route path="settings">
97-
<Route index element={<Navigate to="/settings/ai" replace />} />
98-
<Route path="ai" element={<AISettingsPage key="ai" />} />
99-
<Route path="chat" element={<LlmHubPage />} />
100-
<Route path="mcp" element={<MCPSettingsPage />} />
101-
<Route path="customization" element={<CustomizationPage />} />
102-
<Route path="search" element={<SearchProviderPage />} />
103-
<Route path="survey" element={<SurveyPage {...surveyParams} />} />
104-
</Route>
105-
</Route>
88+
{/* Survey page - standalone */}
89+
<Route
90+
path="settings/survey"
91+
element={<SurveyPage {...surveyParams} />}
92+
/>
10693

10794
{/* Full-screen without sidebar */}
10895
<Route path="workflows/create-graph" element={<CreateGraphWrapper />} />
@@ -133,6 +120,8 @@ export const App: FC = () => {
133120
path="/settings/skills"
134121
element={<Navigate to="/home/skills" replace />}
135122
/>
123+
{/* Settings routes now redirect to home (settings are in a dialog) */}
124+
<Route path="/settings/*" element={<Navigate to="/home" replace />} />
136125
<Route path="/options/*" element={<OptionsRedirect />} />
137126

138127
{/* Fallback to home */}

0 commit comments

Comments
 (0)