@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.
- package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +108 -121
- package/corpus/templates/assets/app/components/layout/Sidebar.tsx +87 -220
- package/corpus/templates/brain/app/components/layout/Sidebar.tsx +83 -221
- package/corpus/templates/calendar/app/components/layout/Sidebar.tsx +324 -460
- package/corpus/templates/chat/app/components/layout/Sidebar.tsx +57 -247
- package/corpus/templates/clips/app/components/library/library-layout.tsx +15 -48
- package/corpus/templates/clips/changelog/2026-09-10-open-mcp-connections-in-new-tabs.md +1 -0
- package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +84 -94
- package/corpus/templates/crm/app/components/layout/CrmLayout.tsx +1 -1
- package/corpus/templates/crm/app/components/layout/CrmSidebar.tsx +108 -296
- package/corpus/templates/design/app/components/layout/Sidebar.tsx +55 -212
- package/corpus/templates/factory/app/components/layout/Sidebar.tsx +72 -260
- package/corpus/templates/forms/app/components/layout/Sidebar.tsx +143 -362
- package/corpus/templates/macros/app/components/layout/AppLayout.tsx +64 -159
- package/corpus/templates/mail/app/components/layout/AppLayout.tsx +152 -165
- package/corpus/templates/plan/app/components/layout/Sidebar.tsx +82 -207
- package/corpus/templates/slides/app/components/layout/Sidebar.tsx +61 -234
- package/corpus/templates/tasks/app/components/layout/Sidebar.tsx +73 -225
- package/dist/automation/index.d.ts +1 -1
- package/dist/client/EnvironmentBadge.d.ts +7 -4
- package/dist/client/EnvironmentBadge.js +26 -18
- package/dist/client/FeedbackButton.js +23 -8
- package/dist/client/app-providers.js +1 -1
- package/dist/client/auth/AuthPage.js +0 -38
- package/dist/client/components/icons/AgentNativeIcon.js +1 -1
- package/dist/client/index.d.ts +1 -0
- package/dist/client/index.js +1 -0
- package/dist/client/ui/AppSidebar.d.ts +15 -0
- package/dist/client/ui/AppSidebar.js +34 -0
- package/dist/client/ui/index.d.ts +1 -0
- package/dist/client/ui/index.js +1 -0
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/config.d.ts +4 -0
- package/dist/config.js +19 -3
- package/dist/progress/routes.d.ts +1 -1
- package/dist/provider-api/actions/custom-provider-registration.d.ts +9 -9
- package/dist/provider-api/actions/provider-api.d.ts +15 -15
- package/dist/provider-api/corpus-jobs.d.ts +2 -2
- package/dist/resources/handlers.d.ts +1 -1
- package/dist/secrets/routes.d.ts +9 -9
- package/dist/server/beta-opt-out-html.js +2 -2
- package/dist/templates/chat/app/components/layout/Sidebar.tsx +57 -247
- package/dist/vite/client.js +4 -1
- package/docs/content/template-clips-anonymous-intake.mdx +7 -5
- package/docs/content/template-clips-developers.mdx +1 -1
- package/package.json +3 -3
- package/src/templates/chat/app/components/layout/Sidebar.tsx +57 -247
|
@@ -6,48 +6,32 @@ import {
|
|
|
6
6
|
import { useT } from "@agent-native/core/client/i18n";
|
|
7
7
|
import { openCommandMenu } from "@agent-native/core/client/navigation";
|
|
8
8
|
import { OrgSwitcher } from "@agent-native/core/client/org";
|
|
9
|
-
import {
|
|
10
|
-
|
|
9
|
+
import {
|
|
10
|
+
AppSidebar,
|
|
11
|
+
AppSidebarNavItem,
|
|
12
|
+
FeedbackButton,
|
|
13
|
+
type AppSidebarItemDefinition,
|
|
14
|
+
} from "@agent-native/core/client/ui";
|
|
11
15
|
import {
|
|
12
16
|
ChatHistoryRail,
|
|
13
17
|
type ChatHistoryItem,
|
|
14
18
|
} from "@agent-native/toolkit/chat-history";
|
|
15
19
|
import {
|
|
16
|
-
IconLayoutSidebarLeftCollapse,
|
|
17
|
-
IconLayoutSidebarLeftExpand,
|
|
18
20
|
IconMessageCircle,
|
|
19
21
|
IconSearch,
|
|
20
22
|
IconSettings,
|
|
21
23
|
} from "@tabler/icons-react";
|
|
22
24
|
import { useEffect, useMemo } from "react";
|
|
23
|
-
import {
|
|
25
|
+
import { useLocation, useNavigate } from "react-router";
|
|
24
26
|
import { toast } from "sonner";
|
|
25
27
|
|
|
28
|
+
import { Button } from "@/components/ui/button";
|
|
26
29
|
import {
|
|
27
30
|
Tooltip,
|
|
28
31
|
TooltipContent,
|
|
29
32
|
TooltipTrigger,
|
|
30
33
|
} from "@/components/ui/tooltip";
|
|
31
34
|
import { APP_TITLE } from "@/lib/app-config";
|
|
32
|
-
import { cn } from "@/lib/utils";
|
|
33
|
-
|
|
34
|
-
const navItems = [
|
|
35
|
-
{
|
|
36
|
-
icon: IconMessageCircle,
|
|
37
|
-
labelKey: "navigation.chat",
|
|
38
|
-
href: "/home",
|
|
39
|
-
view: "chat",
|
|
40
|
-
},
|
|
41
|
-
];
|
|
42
|
-
|
|
43
|
-
const bottomNavItems = [
|
|
44
|
-
{
|
|
45
|
-
icon: IconSettings,
|
|
46
|
-
labelKey: "navigation.settings",
|
|
47
|
-
href: "/settings",
|
|
48
|
-
view: "settings",
|
|
49
|
-
},
|
|
50
|
-
];
|
|
51
35
|
|
|
52
36
|
const CHAT_STORAGE_KEY = "chat";
|
|
53
37
|
const CHAT_ACTIVE_THREAD_KEY = `agent-chat-active-thread:${CHAT_STORAGE_KEY}`;
|
|
@@ -275,245 +259,71 @@ export function Sidebar({
|
|
|
275
259
|
const t = useT();
|
|
276
260
|
const isChatRoute =
|
|
277
261
|
location.pathname === "/home" || location.pathname.startsWith("/chat/");
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
);
|
|
295
|
-
const collapseButton = collapsible ? (
|
|
296
|
-
<Tooltip>
|
|
297
|
-
<TooltipTrigger asChild>
|
|
298
|
-
<button
|
|
299
|
-
type="button"
|
|
300
|
-
onClick={() => onCollapsedChange?.(!collapsed)}
|
|
301
|
-
className={cn(
|
|
302
|
-
"flex shrink-0 items-center justify-center rounded-md text-sidebar-foreground/65 transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
303
|
-
collapsed ? "size-8" : "size-7",
|
|
304
|
-
)}
|
|
305
|
-
aria-label={
|
|
306
|
-
collapsed
|
|
307
|
-
? t("navigation.expandSidebar")
|
|
308
|
-
: t("navigation.collapseSidebar")
|
|
309
|
-
}
|
|
310
|
-
>
|
|
311
|
-
<ToggleIcon className="size-4" />
|
|
312
|
-
</button>
|
|
313
|
-
</TooltipTrigger>
|
|
314
|
-
<TooltipContent side="right">
|
|
315
|
-
{collapsed
|
|
316
|
-
? t("navigation.expandSidebar")
|
|
317
|
-
: t("navigation.collapseSidebar")}
|
|
318
|
-
</TooltipContent>
|
|
319
|
-
</Tooltip>
|
|
320
|
-
) : null;
|
|
262
|
+
|
|
263
|
+
const secondaryItems: AppSidebarItemDefinition[] = [
|
|
264
|
+
{
|
|
265
|
+
to: "/settings",
|
|
266
|
+
label: t("navigation.settings"),
|
|
267
|
+
icon: IconSettings,
|
|
268
|
+
active: location.pathname.startsWith("/settings"),
|
|
269
|
+
},
|
|
270
|
+
];
|
|
271
|
+
|
|
272
|
+
const feedbackButton = (
|
|
273
|
+
<FeedbackButton variant={collapsed ? "icon" : "sidebar"} side="right" />
|
|
274
|
+
);
|
|
275
|
+
|
|
276
|
+
const orgSwitcher = <OrgSwitcher compact={collapsed} reserveSpace />;
|
|
277
|
+
|
|
321
278
|
const searchButton = (
|
|
322
279
|
<Tooltip>
|
|
323
280
|
<TooltipTrigger asChild>
|
|
324
|
-
<
|
|
281
|
+
<Button
|
|
325
282
|
type="button"
|
|
283
|
+
variant="ghost"
|
|
284
|
+
size="icon"
|
|
285
|
+
className="size-9 shrink-0 text-primary hover:bg-accent/60 hover:text-primary"
|
|
326
286
|
onClick={openCommandMenu}
|
|
327
287
|
aria-label={t("root.commandSearch")}
|
|
328
|
-
className="flex size-8 items-center justify-center rounded-md text-sidebar-foreground/65 transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
329
288
|
>
|
|
330
289
|
<IconSearch className="size-4" />
|
|
331
|
-
</
|
|
290
|
+
</Button>
|
|
332
291
|
</TooltipTrigger>
|
|
333
292
|
<TooltipContent side="right">{t("root.commandSearch")}</TooltipContent>
|
|
334
293
|
</Tooltip>
|
|
335
294
|
);
|
|
336
|
-
const feedbackButton = (
|
|
337
|
-
<FeedbackButton
|
|
338
|
-
variant={collapsed ? "icon" : "sidebar"}
|
|
339
|
-
side="right"
|
|
340
|
-
className={collapsed ? "h-8 w-8" : "min-w-0"}
|
|
341
|
-
/>
|
|
342
|
-
);
|
|
343
295
|
|
|
344
296
|
return (
|
|
345
|
-
<
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
297
|
+
<AppSidebar
|
|
298
|
+
collapsed={collapsed}
|
|
299
|
+
collapsible={collapsible}
|
|
300
|
+
onCollapsedChange={onCollapsedChange}
|
|
301
|
+
brandName={APP_TITLE}
|
|
302
|
+
brandHref="/home"
|
|
303
|
+
secondaryItems={secondaryItems}
|
|
304
|
+
feedback={feedbackButton}
|
|
305
|
+
orgSwitcher={orgSwitcher}
|
|
306
|
+
footerExtras={searchButton}
|
|
351
307
|
>
|
|
352
|
-
<
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
event.ctrlKey ||
|
|
366
|
-
event.shiftKey ||
|
|
367
|
-
event.altKey ||
|
|
368
|
-
event.button !== 0
|
|
369
|
-
) {
|
|
370
|
-
return;
|
|
371
|
-
}
|
|
308
|
+
<AppSidebarNavItem
|
|
309
|
+
to="/home"
|
|
310
|
+
label={t("navigation.chat")}
|
|
311
|
+
icon={IconMessageCircle}
|
|
312
|
+
active={isChatRoute}
|
|
313
|
+
onClick={(event) => {
|
|
314
|
+
if (
|
|
315
|
+
!isChatRoute &&
|
|
316
|
+
!event.metaKey &&
|
|
317
|
+
!event.ctrlKey &&
|
|
318
|
+
!event.shiftKey &&
|
|
319
|
+
!event.altKey
|
|
320
|
+
) {
|
|
372
321
|
event.preventDefault();
|
|
373
|
-
|
|
374
|
-
}}
|
|
375
|
-
className={cn(
|
|
376
|
-
"flex min-w-0 items-center rounded outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
377
|
-
collapsed ? "size-7 justify-center" : "flex-1 gap-3",
|
|
378
|
-
)}
|
|
379
|
-
aria-label={
|
|
380
|
-
collapsible && onCollapsedChange
|
|
381
|
-
? collapsed
|
|
382
|
-
? t("navigation.expandSidebar")
|
|
383
|
-
: t("navigation.collapseSidebar")
|
|
384
|
-
: collapsed
|
|
385
|
-
? APP_TITLE
|
|
386
|
-
: undefined
|
|
322
|
+
navigateWithAgentChatViewTransition(navigate, "/home");
|
|
387
323
|
}
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
/>
|
|
393
|
-
<div className={cn("min-w-0", collapsed && "sr-only")}>
|
|
394
|
-
<p className="truncate text-sm font-semibold text-sidebar-accent-foreground">
|
|
395
|
-
{APP_TITLE}
|
|
396
|
-
</p>
|
|
397
|
-
</div>
|
|
398
|
-
</Link>
|
|
399
|
-
</div>
|
|
400
|
-
|
|
401
|
-
<nav
|
|
402
|
-
className={cn(
|
|
403
|
-
"flex-1 overflow-y-auto",
|
|
404
|
-
collapsed ? "px-0 py-2" : "px-2 py-3",
|
|
405
|
-
)}
|
|
406
|
-
>
|
|
407
|
-
<div className={cn("grid", collapsed ? "gap-0" : "gap-1")}>
|
|
408
|
-
{navItems.map((item) => {
|
|
409
|
-
const Icon = item.icon;
|
|
410
|
-
const isActive =
|
|
411
|
-
item.href === "/home"
|
|
412
|
-
? isChatRoute
|
|
413
|
-
: location.pathname.startsWith(item.href);
|
|
414
|
-
const link = (
|
|
415
|
-
<Link
|
|
416
|
-
to={item.href}
|
|
417
|
-
onClick={(event) => {
|
|
418
|
-
if (
|
|
419
|
-
item.href === "/home" &&
|
|
420
|
-
!isChatRoute &&
|
|
421
|
-
!event.metaKey &&
|
|
422
|
-
!event.ctrlKey &&
|
|
423
|
-
!event.shiftKey &&
|
|
424
|
-
!event.altKey
|
|
425
|
-
) {
|
|
426
|
-
event.preventDefault();
|
|
427
|
-
navigateWithAgentChatViewTransition(navigate, "/home");
|
|
428
|
-
}
|
|
429
|
-
}}
|
|
430
|
-
className={navClass({ isActive })}
|
|
431
|
-
aria-current={isActive ? "page" : undefined}
|
|
432
|
-
aria-label={collapsed ? t(item.labelKey) : undefined}
|
|
433
|
-
>
|
|
434
|
-
<Icon className="size-4 shrink-0" />
|
|
435
|
-
<span className={collapsed ? "sr-only" : "truncate"}>
|
|
436
|
-
{t(item.labelKey)}
|
|
437
|
-
</span>
|
|
438
|
-
</Link>
|
|
439
|
-
);
|
|
440
|
-
return (
|
|
441
|
-
<div key={item.href}>
|
|
442
|
-
{collapsed ? (
|
|
443
|
-
<Tooltip>
|
|
444
|
-
<TooltipTrigger asChild>{link}</TooltipTrigger>
|
|
445
|
-
<TooltipContent side="right">
|
|
446
|
-
{t(item.labelKey)}
|
|
447
|
-
</TooltipContent>
|
|
448
|
-
</Tooltip>
|
|
449
|
-
) : (
|
|
450
|
-
link
|
|
451
|
-
)}
|
|
452
|
-
{!collapsed && item.view === "chat" ? (
|
|
453
|
-
<ChatThreadsSection open={isChatRoute} />
|
|
454
|
-
) : null}
|
|
455
|
-
</div>
|
|
456
|
-
);
|
|
457
|
-
})}
|
|
458
|
-
</div>
|
|
459
|
-
</nav>
|
|
460
|
-
|
|
461
|
-
<div className={cn("mt-auto shrink-0", collapsed && "py-2")}>
|
|
462
|
-
<nav
|
|
463
|
-
className={cn(
|
|
464
|
-
"grid",
|
|
465
|
-
collapsed ? "gap-0 px-1 py-1" : "gap-1 px-2 py-1",
|
|
466
|
-
)}
|
|
467
|
-
>
|
|
468
|
-
{bottomNavItems.map((item) => {
|
|
469
|
-
const Icon = item.icon;
|
|
470
|
-
const isActive = location.pathname.startsWith(item.href);
|
|
471
|
-
const link = (
|
|
472
|
-
<Link
|
|
473
|
-
to={item.href}
|
|
474
|
-
className={navClass({ isActive })}
|
|
475
|
-
aria-current={isActive ? "page" : undefined}
|
|
476
|
-
aria-label={collapsed ? t(item.labelKey) : undefined}
|
|
477
|
-
>
|
|
478
|
-
<Icon className="size-4 shrink-0" />
|
|
479
|
-
<span className={collapsed ? "sr-only" : "truncate"}>
|
|
480
|
-
{t(item.labelKey)}
|
|
481
|
-
</span>
|
|
482
|
-
</Link>
|
|
483
|
-
);
|
|
484
|
-
return collapsed ? (
|
|
485
|
-
<Tooltip key={item.href}>
|
|
486
|
-
<TooltipTrigger asChild>{link}</TooltipTrigger>
|
|
487
|
-
<TooltipContent side="right">{t(item.labelKey)}</TooltipContent>
|
|
488
|
-
</Tooltip>
|
|
489
|
-
) : (
|
|
490
|
-
<div key={item.href}>{link}</div>
|
|
491
|
-
);
|
|
492
|
-
})}
|
|
493
|
-
</nav>
|
|
494
|
-
|
|
495
|
-
<div
|
|
496
|
-
className={cn(
|
|
497
|
-
collapsed ? "px-1 py-1 empty:hidden" : "px-3 py-2 empty:hidden",
|
|
498
|
-
)}
|
|
499
|
-
>
|
|
500
|
-
<OrgSwitcher
|
|
501
|
-
reserveSpace
|
|
502
|
-
className={
|
|
503
|
-
collapsed
|
|
504
|
-
? "h-8 justify-center px-0 [&>span]:sr-only [&>svg:last-child]:hidden"
|
|
505
|
-
: undefined
|
|
506
|
-
}
|
|
507
|
-
/>
|
|
508
|
-
</div>
|
|
509
|
-
|
|
510
|
-
<SidebarFooterActions
|
|
511
|
-
collapsed={collapsed}
|
|
512
|
-
feedback={feedbackButton}
|
|
513
|
-
search={searchButton}
|
|
514
|
-
collapse={collapseButton}
|
|
515
|
-
/>
|
|
516
|
-
</div>
|
|
517
|
-
</aside>
|
|
324
|
+
}}
|
|
325
|
+
/>
|
|
326
|
+
{!collapsed && <ChatThreadsSection open={isChatRoute} />}
|
|
327
|
+
</AppSidebar>
|
|
518
328
|
);
|
|
519
329
|
}
|