@agent-native/core 0.178.1 → 0.178.2-nightly-20260910195009

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +108 -121
  2. package/corpus/templates/assets/app/components/layout/Sidebar.tsx +87 -220
  3. package/corpus/templates/brain/app/components/layout/Sidebar.tsx +83 -221
  4. package/corpus/templates/calendar/app/components/layout/Sidebar.tsx +324 -460
  5. package/corpus/templates/chat/app/components/layout/Sidebar.tsx +57 -247
  6. package/corpus/templates/clips/app/components/library/library-layout.tsx +15 -48
  7. package/corpus/templates/clips/changelog/2026-09-10-open-mcp-connections-in-new-tabs.md +1 -0
  8. package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +84 -94
  9. package/corpus/templates/crm/app/components/layout/CrmLayout.tsx +1 -1
  10. package/corpus/templates/crm/app/components/layout/CrmSidebar.tsx +108 -296
  11. package/corpus/templates/design/app/components/layout/Sidebar.tsx +55 -212
  12. package/corpus/templates/factory/app/components/layout/Sidebar.tsx +72 -260
  13. package/corpus/templates/forms/app/components/layout/Sidebar.tsx +143 -362
  14. package/corpus/templates/macros/app/components/layout/AppLayout.tsx +64 -159
  15. package/corpus/templates/mail/app/components/layout/AppLayout.tsx +152 -165
  16. package/corpus/templates/plan/app/components/layout/Sidebar.tsx +82 -207
  17. package/corpus/templates/slides/app/components/layout/Sidebar.tsx +61 -234
  18. package/corpus/templates/tasks/app/components/layout/Sidebar.tsx +73 -225
  19. package/dist/automation/index.d.ts +1 -1
  20. package/dist/client/EnvironmentBadge.d.ts +7 -4
  21. package/dist/client/EnvironmentBadge.js +26 -18
  22. package/dist/client/FeedbackButton.js +23 -8
  23. package/dist/client/app-providers.js +1 -1
  24. package/dist/client/auth/AuthPage.js +0 -38
  25. package/dist/client/components/icons/AgentNativeIcon.js +1 -1
  26. package/dist/client/index.d.ts +1 -0
  27. package/dist/client/index.js +1 -0
  28. package/dist/client/ui/AppSidebar.d.ts +15 -0
  29. package/dist/client/ui/AppSidebar.js +34 -0
  30. package/dist/client/ui/index.d.ts +1 -0
  31. package/dist/client/ui/index.js +1 -0
  32. package/dist/collab/awareness.d.ts +2 -2
  33. package/dist/collab/struct-routes.d.ts +1 -1
  34. package/dist/config.d.ts +4 -0
  35. package/dist/config.js +19 -3
  36. package/dist/progress/routes.d.ts +1 -1
  37. package/dist/provider-api/actions/custom-provider-registration.d.ts +9 -9
  38. package/dist/provider-api/actions/provider-api.d.ts +15 -15
  39. package/dist/provider-api/corpus-jobs.d.ts +2 -2
  40. package/dist/resources/handlers.d.ts +1 -1
  41. package/dist/secrets/routes.d.ts +9 -9
  42. package/dist/server/beta-opt-out-html.js +2 -2
  43. package/dist/templates/chat/app/components/layout/Sidebar.tsx +57 -247
  44. package/dist/vite/client.js +4 -1
  45. package/docs/content/template-clips-anonymous-intake.mdx +7 -5
  46. package/docs/content/template-clips-developers.mdx +1 -1
  47. package/package.json +3 -3
  48. package/src/templates/chat/app/components/layout/Sidebar.tsx +57 -247
@@ -4,19 +4,18 @@ import { DevDatabaseLink } from "@agent-native/core/client/db-admin";
4
4
  import { useT } from "@agent-native/core/client/i18n";
5
5
  import { openCommandMenu } from "@agent-native/core/client/navigation";
6
6
  import { OrgSwitcher } from "@agent-native/core/client/org";
7
- import { AgentNativeIcon, FeedbackButton } from "@agent-native/core/client/ui";
8
7
  import {
9
- HeaderActionsProvider,
10
- SidebarFooterActions,
11
- } from "@agent-native/toolkit/app-shell";
8
+ AppSidebar,
9
+ FeedbackButton,
10
+ type AppSidebarItemDefinition,
11
+ } from "@agent-native/core/client/ui";
12
+ import { HeaderActionsProvider } from "@agent-native/toolkit/app-shell";
12
13
  import {
14
+ IconChartBar,
13
15
  IconFlame,
14
16
  IconLoader2,
15
- IconChartBar,
16
- IconSettings,
17
- IconLayoutSidebarLeftCollapse,
18
- IconLayoutSidebarLeftExpand,
19
17
  IconSearch,
18
+ IconSettings,
20
19
  } from "@tabler/icons-react";
21
20
  import {
22
21
  useIsFetching,
@@ -25,8 +24,9 @@ import {
25
24
  useQueryClient,
26
25
  } from "@tanstack/react-query";
27
26
  import { useState, useEffect } from "react";
28
- import { Link, useLocation, useNavigate } from "react-router";
27
+ import { useLocation, useNavigate } from "react-router";
29
28
 
29
+ import { Button } from "@/components/ui/button";
30
30
  import { Sheet, SheetContent, SheetTitle } from "@/components/ui/sheet";
31
31
  import {
32
32
  Tooltip,
@@ -39,15 +39,6 @@ import { cn } from "@/lib/utils";
39
39
 
40
40
  import { Header } from "./Header";
41
41
 
42
- const navItems = [
43
- { icon: IconFlame, labelKey: "navigation.entry", href: "/home" },
44
- { icon: IconChartBar, labelKey: "navigation.analytics", href: "/analytics" },
45
- ];
46
-
47
- const bottomNavItems = [
48
- { icon: IconSettings, labelKey: "navigation.settings", href: "/settings" },
49
- ];
50
-
51
42
  export function AppLayout({ children }: { children: React.ReactNode }) {
52
43
  const location = useLocation();
53
44
  const navigate = useNavigate();
@@ -155,12 +146,7 @@ export function AppLayout({ children }: { children: React.ReactNode }) {
155
146
  >
156
147
  <div className="agent-layout-shell flex flex-1 overflow-hidden">
157
148
  {/* Desktop sidebar */}
158
- <aside
159
- className={cn(
160
- "agent-layout-left-drawer hidden shrink-0 flex-col border-e border-border bg-sidebar text-sidebar-foreground transition-[width] duration-200 md:flex",
161
- desktopSidebarCollapsed ? "w-14" : "w-56",
162
- )}
163
- >
149
+ <div className="hidden md:flex h-full">
164
150
  <SidebarContent
165
151
  pathname={location.pathname}
166
152
  collapsed={desktopSidebarCollapsed}
@@ -168,11 +154,11 @@ export function AppLayout({ children }: { children: React.ReactNode }) {
168
154
  setDesktopSidebarCollapsed((collapsed) => !collapsed)
169
155
  }
170
156
  />
171
- </aside>
157
+ </div>
172
158
 
173
159
  {/* Mobile sidebar sheet */}
174
160
  <Sheet open={sidebarOpen} onOpenChange={setSidebarOpen}>
175
- <SheetContent side="left" className="w-56 p-0">
161
+ <SheetContent side="left" className="w-[260px] p-0">
176
162
  <SheetTitle className="sr-only">
177
163
  {t("sidebar.navigation")}
178
164
  </SheetTitle>
@@ -204,154 +190,73 @@ function SidebarContent({
204
190
  onToggleCollapsed?: () => void;
205
191
  }) {
206
192
  const t = useT();
207
- const ToggleIcon = collapsed
208
- ? IconLayoutSidebarLeftExpand
209
- : IconLayoutSidebarLeftCollapse;
210
- const collapseButton = onToggleCollapsed ? (
211
- <Tooltip>
212
- <TooltipTrigger asChild>
213
- <button
214
- type="button"
215
- aria-label={collapsed ? t("sidebar.expand") : t("sidebar.collapse")}
216
- className="flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"
217
- onClick={onToggleCollapsed}
218
- >
219
- <ToggleIcon className="h-4 w-4" />
220
- </button>
221
- </TooltipTrigger>
222
- <TooltipContent side="right">
223
- {collapsed ? t("sidebar.expand") : t("sidebar.collapse")}
224
- </TooltipContent>
225
- </Tooltip>
226
- ) : null;
193
+
194
+ const items: AppSidebarItemDefinition[] = [
195
+ {
196
+ to: "/home",
197
+ label: t("navigation.entry"),
198
+ icon: IconFlame,
199
+ active: pathname === "/home" || pathname === "/entry",
200
+ },
201
+ {
202
+ to: "/analytics",
203
+ label: t("navigation.analytics"),
204
+ icon: IconChartBar,
205
+ active: pathname.startsWith("/analytics"),
206
+ },
207
+ ];
208
+
209
+ const secondaryItems: AppSidebarItemDefinition[] = [
210
+ {
211
+ to: "/settings",
212
+ label: t("navigation.settings"),
213
+ icon: IconSettings,
214
+ active: pathname.startsWith("/settings"),
215
+ },
216
+ ];
217
+
218
+ const feedbackButton = (
219
+ <FeedbackButton variant={collapsed ? "icon" : "sidebar"} side="right" />
220
+ );
221
+
222
+ const orgSwitcher = <OrgSwitcher compact={collapsed} />;
223
+
227
224
  const searchButton = (
228
225
  <Tooltip>
229
226
  <TooltipTrigger asChild>
230
- <button
227
+ <Button
231
228
  type="button"
229
+ variant="ghost"
230
+ size="icon"
231
+ className="size-9 shrink-0 text-primary hover:bg-accent/60 hover:text-primary"
232
232
  onClick={openCommandMenu}
233
233
  aria-label={t("root.search")}
234
- className="flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"
235
234
  >
236
- <IconSearch className="h-4 w-4" />
237
- </button>
235
+ <IconSearch className="size-4" />
236
+ </Button>
238
237
  </TooltipTrigger>
239
238
  <TooltipContent side="right">{t("root.search")}</TooltipContent>
240
239
  </Tooltip>
241
240
  );
242
- const feedbackButton = (
243
- <FeedbackButton
244
- variant={collapsed ? "icon" : "sidebar"}
245
- side="right"
246
- className={collapsed ? "size-8" : "min-w-0"}
247
- />
248
- );
249
241
 
250
242
  return (
251
- <div className="flex h-full flex-col">
252
- <div
253
- className={cn(
254
- "flex h-12 shrink-0 items-center border-b border-border",
255
- collapsed ? "justify-center px-2" : "gap-2 px-4",
256
- )}
257
- >
258
- {!collapsed && (
259
- <div className="flex min-w-0 flex-1 items-center gap-2">
260
- <AgentNativeIcon
261
- aria-hidden="true"
262
- className="h-3.5 w-6 shrink-0 text-foreground"
263
- />
264
- <span className="font-logo truncate text-sm font-bold tracking-tight text-foreground">
265
- {t("navigation.brand")}
266
- </span>
267
- </div>
268
- )}
269
- </div>
270
-
271
- <nav className="flex-1 space-y-1 overflow-y-auto px-2 py-2">
272
- {navItems.map((item) => {
273
- const Icon = item.icon;
274
- const label = t(item.labelKey);
275
- const isActive =
276
- item.href === "/home"
277
- ? pathname === "/home" || pathname === "/entry"
278
- : pathname.startsWith(item.href);
279
- const link = (
280
- <Link
281
- key={item.href}
282
- to={item.href}
283
- aria-label={collapsed ? label : undefined}
284
- className={cn(
285
- "flex h-9 items-center rounded-lg text-sm transition-colors",
286
- collapsed ? "justify-center px-0" : "gap-3 px-3",
287
- isActive
288
- ? "bg-sidebar-accent text-sidebar-accent-foreground"
289
- : "text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground",
290
- )}
291
- >
292
- <Icon className="h-4 w-4 shrink-0" />
293
- {!collapsed && label}
294
- </Link>
295
- );
296
- return collapsed ? (
297
- <Tooltip key={item.href}>
298
- <TooltipTrigger asChild>{link}</TooltipTrigger>
299
- <TooltipContent side="right">{label}</TooltipContent>
300
- </Tooltip>
301
- ) : (
302
- link
303
- );
304
- })}
305
- </nav>
306
-
307
- <nav className="grid shrink-0 gap-1 px-2 py-1">
308
- {bottomNavItems.map((item) => {
309
- const Icon = item.icon;
310
- const label = t(item.labelKey);
311
- const isActive = pathname.startsWith(item.href);
312
- const link = (
313
- <Link
314
- key={item.href}
315
- to={item.href}
316
- aria-label={collapsed ? label : undefined}
317
- className={cn(
318
- "flex h-9 items-center rounded-lg text-sm transition-colors",
319
- collapsed ? "justify-center px-0" : "gap-3 px-3",
320
- isActive
321
- ? "bg-sidebar-accent text-sidebar-accent-foreground"
322
- : "text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground",
323
- )}
324
- >
325
- <Icon className="h-4 w-4 shrink-0" />
326
- {!collapsed && label}
327
- </Link>
328
- );
329
- return collapsed ? (
330
- <Tooltip key={item.href}>
331
- <TooltipTrigger asChild>{link}</TooltipTrigger>
332
- <TooltipContent side="right">{label}</TooltipContent>
333
- </Tooltip>
334
- ) : (
335
- link
336
- );
337
- })}
338
- </nav>
339
-
340
- {!collapsed && (
243
+ <AppSidebar
244
+ collapsed={collapsed}
245
+ collapsible={Boolean(onToggleCollapsed)}
246
+ onCollapsedChange={onToggleCollapsed}
247
+ brandName={t("navigation.brand")}
248
+ brandHref="/home"
249
+ items={items}
250
+ secondaryItems={secondaryItems}
251
+ feedback={feedbackButton}
252
+ orgSwitcher={orgSwitcher}
253
+ footerExtras={
341
254
  <>
342
- <div className="space-y-2 px-3 py-2 empty:hidden">
343
- <DevDatabaseLink />
344
- <OrgSwitcher />
345
- </div>
255
+ {searchButton}
256
+ <DevDatabaseLink />
346
257
  </>
347
- )}
348
- <SidebarFooterActions
349
- collapsed={collapsed}
350
- feedback={feedbackButton}
351
- search={searchButton}
352
- collapse={collapseButton}
353
- />
354
- </div>
258
+ }
259
+ />
355
260
  );
356
261
  }
357
262