@agent-native/core 0.120.2 → 0.120.3
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/README.md +3 -3
- package/corpus/core/CHANGELOG.md +20 -0
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/cli/context-xray-local.ts +1 -1
- package/corpus/core/src/cli/index.ts +63 -18
- package/corpus/core/src/cli/skills.ts +5 -0
- package/corpus/core/src/cli/telemetry.ts +118 -1
- package/corpus/core/src/client/AgentPanel.tsx +10 -0
- package/corpus/core/src/client/CommandMenu.tsx +13 -1
- package/corpus/core/src/client/agent-page/AgentTabsPage.tsx +39 -4
- package/corpus/core/src/client/analytics.ts +13 -0
- package/corpus/core/src/client/error-capture.ts +6 -1
- package/corpus/core/src/client/extensions/ExtensionsListPage.tsx +12 -5
- package/corpus/core/src/client/extensions/agent-native-extension-runtime.ts +1 -1
- package/corpus/core/src/client/navigation/index.ts +2 -0
- package/corpus/core/src/client/org/OrgSwitcher.tsx +14 -32
- package/corpus/core/src/client/settings/ExtensionsSettingsContent.tsx +1 -1
- package/corpus/core/src/extensions/theme.ts +1 -1
- package/corpus/core/src/localization/default-messages.ts +2 -0
- package/corpus/core/src/server/core-routes-plugin.ts +10 -1
- package/corpus/core/src/server/framework-request-handler.ts +17 -26
- package/corpus/core/src/styles/agent-native.css +13 -0
- package/corpus/core/src/templates/chat/app/components/layout/Layout.tsx +3 -0
- package/corpus/core/src/templates/chat/app/components/layout/Sidebar.tsx +78 -45
- package/corpus/core/src/templates/chat/app/global.css +1 -1
- package/corpus/core/src/templates/default/app/global.css +1 -1
- package/corpus/core/src/tracking/error-capture.ts +151 -0
- package/corpus/core/src/tracking/index.ts +5 -0
- package/corpus/templates/analytics/app/components/dashboard/CumulativeNetChart.tsx +1 -1
- package/corpus/templates/analytics/app/components/dashboard/DashboardHistoryPanel.tsx +1 -4
- package/corpus/templates/analytics/app/components/dashboard/DashboardPanelSkeleton.tsx +1 -1
- package/corpus/templates/analytics/app/components/dashboard/DataTable.tsx +1 -1
- package/corpus/templates/analytics/app/components/dashboard/DateRangePicker.tsx +2 -2
- package/corpus/templates/analytics/app/components/dashboard/MetricCard.tsx +1 -1
- package/corpus/templates/analytics/app/components/dashboard/RecentActivity.tsx +1 -1
- package/corpus/templates/analytics/app/components/dashboard/RevenueChart.tsx +1 -1
- package/corpus/templates/analytics/app/components/dashboard/RevenueComparisonChart.tsx +1 -1
- package/corpus/templates/analytics/app/components/dashboard/SqlChart.tsx +41 -9
- package/corpus/templates/analytics/app/components/dashboard/StatsCard.tsx +1 -1
- package/corpus/templates/analytics/app/components/dashboard/TimeSeriesChart.tsx +1 -1
- package/corpus/templates/analytics/app/components/layout/CommandPalette.tsx +2 -0
- package/corpus/templates/analytics/app/components/layout/Layout.tsx +28 -14
- package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +152 -124
- package/corpus/templates/analytics/app/global.css +5 -5
- package/corpus/templates/analytics/app/lib/dashboard-report-capture.ts +42 -0
- package/corpus/templates/analytics/app/pages/adhoc/_shared/KpiChart.tsx +1 -1
- package/corpus/templates/analytics/app/pages/adhoc/explorer/components/ChartTypePicker.tsx +1 -1
- package/corpus/templates/analytics/app/pages/adhoc/explorer/components/DateRangePicker.tsx +1 -1
- package/corpus/templates/analytics/app/pages/adhoc/explorer/components/EventRow.tsx +1 -1
- package/corpus/templates/analytics/app/pages/adhoc/explorer/components/SqlPreview.tsx +2 -2
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/DashboardFilterBar.tsx +3 -3
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/EmailReportDialog.tsx +2 -2
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/PanelEditorDialog.tsx +1 -1
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/SqlChartCard.tsx +1 -1
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/index.tsx +162 -51
- package/corpus/templates/analytics/app/root.tsx +28 -0
- package/corpus/templates/analytics/changelog/2026-07-24-analytics-charts-now-explain-slow-loads-and-offer-a-direct-r.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-24-daily-dashboard-emails-now-load-signed-reports-more-reliably.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-24-manage-agent-is-clearly-marked-as-a-link-to-its-dedicated-pa.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
- package/corpus/templates/analytics/seeds/dashboards/agent-native-templates-first-party.json +1 -1
- package/corpus/templates/analytics/server/db/schema.ts +5 -0
- package/corpus/templates/analytics/server/jobs/dashboard-report.ts +21 -0
- package/corpus/templates/analytics/server/lib/canonical-first-party-dashboard-repair.ts +11 -0
- package/corpus/templates/analytics/server/lib/dashboard-report-subscriptions.ts +54 -0
- package/corpus/templates/analytics/server/lib/dashboard-report.ts +235 -26
- package/corpus/templates/analytics/server/lib/first-party-metric-catalog.ts +4 -1
- package/corpus/templates/analytics/server/plugins/db.ts +9 -0
- package/corpus/templates/analytics/shared/dashboard-report-timeouts.ts +1 -1
- package/corpus/templates/assets/app/components/asset/AssetPreviewDialog.tsx +376 -0
- package/corpus/templates/assets/app/components/create/RecentDraftsSection.tsx +14 -4
- package/corpus/templates/assets/app/components/layout/Layout.tsx +5 -0
- package/corpus/templates/assets/app/components/layout/Sidebar.tsx +118 -74
- package/corpus/templates/assets/app/global.css +1 -1
- package/corpus/templates/assets/app/i18n-data.ts +10 -0
- package/corpus/templates/assets/app/routes/brand-kits.$id.tsx +99 -10
- package/corpus/templates/assets/app/routes/library.tsx +21 -198
- package/corpus/templates/assets/changelog/2026-07-21-unified-asset-preview-click-any-asset-to-open-one-preview-wi.md +6 -0
- package/corpus/templates/assets/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
- package/corpus/templates/assets/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
- package/corpus/templates/brain/app/components/layout/Layout.tsx +3 -0
- package/corpus/templates/brain/app/components/layout/Sidebar.tsx +76 -43
- package/corpus/templates/brain/app/global.css +1 -1
- package/corpus/templates/brain/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
- package/corpus/templates/brain/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
- package/corpus/templates/calendar/app/components/layout/Sidebar.tsx +67 -52
- package/corpus/templates/calendar/app/global.css +1 -1
- package/corpus/templates/calendar/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
- package/corpus/templates/calendar/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
- package/corpus/templates/chat/app/components/layout/Layout.tsx +3 -0
- package/corpus/templates/chat/app/components/layout/Sidebar.tsx +78 -45
- package/corpus/templates/chat/app/global.css +1 -1
- package/corpus/templates/chat/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
- package/corpus/templates/chat/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
- package/corpus/templates/clips/app/components/library/library-layout.tsx +65 -31
- package/corpus/templates/clips/app/components/library/organization-switcher.tsx +2 -2
- package/corpus/templates/clips/app/components/player/video-player.tsx +16 -1
- package/corpus/templates/clips/app/global.css +1 -1
- package/corpus/templates/clips/app/hooks/use-view-tracking.ts +55 -12
- package/corpus/templates/clips/app/routes/embed.$shareId.tsx +6 -5
- package/corpus/templates/clips/app/routes/r.$recordingId.tsx +7 -7
- package/corpus/templates/clips/app/routes/share.$shareId.tsx +6 -5
- package/corpus/templates/clips/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
- package/corpus/templates/clips/server/plugins/db.ts +113 -68
- package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +66 -42
- package/corpus/templates/content/app/global.css +1 -1
- package/corpus/templates/content/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
- package/corpus/templates/content/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
- package/corpus/templates/design/app/components/layout/Sidebar.tsx +65 -30
- package/corpus/templates/design/app/entry.client.tsx +14 -1
- package/corpus/templates/design/app/global.css +1 -1
- package/corpus/templates/design/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
- package/corpus/templates/design/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
- package/corpus/templates/dispatch/app/global.css +1 -1
- package/corpus/templates/dispatch/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
- package/corpus/templates/dispatch/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
- package/corpus/templates/forms/app/components/layout/Layout.tsx +3 -0
- package/corpus/templates/forms/app/components/layout/Sidebar.tsx +72 -37
- package/corpus/templates/forms/app/global.css +1 -1
- package/corpus/templates/forms/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
- package/corpus/templates/forms/changelog/2026-07-24-forms-sidebar-actions-now-keep-search-language-feedback-and-.md +6 -0
- package/corpus/templates/forms/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
- package/corpus/templates/macros/app/components/DailyProgress.tsx +5 -5
- package/corpus/templates/macros/app/components/ExerciseCard.tsx +2 -2
- package/corpus/templates/macros/app/components/MealCard.tsx +2 -2
- package/corpus/templates/macros/app/components/WeightCard.tsx +2 -2
- package/corpus/templates/macros/app/components/layout/AppLayout.tsx +56 -29
- package/corpus/templates/macros/app/components/ui/button.tsx +1 -2
- package/corpus/templates/macros/app/components/ui/card.tsx +1 -1
- package/corpus/templates/macros/app/global.css +1 -1
- package/corpus/templates/macros/app/routes/_index.tsx +1 -1
- package/corpus/templates/macros/app/routes/analytics.tsx +4 -7
- package/corpus/templates/macros/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
- package/corpus/templates/macros/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
- package/corpus/templates/mail/app/components/layout/AppLayout.tsx +125 -37
- package/corpus/templates/mail/app/global.css +1 -1
- package/corpus/templates/mail/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
- package/corpus/templates/mail/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
- package/corpus/templates/plan/app/components/layout/Layout.tsx +3 -0
- package/corpus/templates/plan/app/components/layout/Sidebar.tsx +90 -60
- package/corpus/templates/plan/app/global.css +1 -1
- package/corpus/templates/plan/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
- package/corpus/templates/plan/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
- package/corpus/templates/slides/app/components/layout/Sidebar.tsx +69 -32
- package/corpus/templates/slides/app/global.css +1 -1
- package/corpus/templates/slides/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
- package/corpus/templates/tasks/app/global.css +1 -1
- package/corpus/templates/tasks/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
- package/corpus/toolkit/CHANGELOG.md +8 -0
- package/corpus/toolkit/README.md +8 -1
- package/corpus/toolkit/agent-native.eject.json +1 -1
- package/corpus/toolkit/package.json +1 -1
- package/corpus/toolkit/src/app-shell/index.ts +1 -0
- package/corpus/toolkit/src/app-shell/sidebar-footer-actions.tsx +48 -0
- package/corpus/toolkit/src/chat-history.css +52 -1
- package/corpus/toolkit/src/design-system/default-adapter.tsx +1 -1
- package/corpus/toolkit/src/ui/button.tsx +1 -2
- package/corpus/toolkit/src/ui/card.tsx +1 -1
- package/corpus/toolkit/src/ui/table.tsx +4 -11
- package/dist/cli/context-xray-local.js +1 -1
- package/dist/cli/context-xray-local.js.map +1 -1
- package/dist/cli/index.js +56 -17
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/skills.d.ts.map +1 -1
- package/dist/cli/skills.js +5 -0
- package/dist/cli/skills.js.map +1 -1
- package/dist/cli/telemetry.d.ts +7 -0
- package/dist/cli/telemetry.d.ts.map +1 -1
- package/dist/cli/telemetry.js +91 -1
- package/dist/cli/telemetry.js.map +1 -1
- package/dist/client/AgentPanel.d.ts +7 -1
- package/dist/client/AgentPanel.d.ts.map +1 -1
- package/dist/client/AgentPanel.js +2 -2
- package/dist/client/AgentPanel.js.map +1 -1
- package/dist/client/CommandMenu.d.ts +2 -0
- package/dist/client/CommandMenu.d.ts.map +1 -1
- package/dist/client/CommandMenu.js +12 -1
- package/dist/client/CommandMenu.js.map +1 -1
- package/dist/client/agent-page/AgentTabsPage.d.ts +4 -0
- package/dist/client/agent-page/AgentTabsPage.d.ts.map +1 -1
- package/dist/client/agent-page/AgentTabsPage.js +8 -4
- package/dist/client/agent-page/AgentTabsPage.js.map +1 -1
- package/dist/client/analytics.d.ts.map +1 -1
- package/dist/client/analytics.js +7 -0
- package/dist/client/analytics.js.map +1 -1
- package/dist/client/error-capture.d.ts.map +1 -1
- package/dist/client/error-capture.js +8 -1
- package/dist/client/error-capture.js.map +1 -1
- package/dist/client/extensions/ExtensionsListPage.d.ts.map +1 -1
- package/dist/client/extensions/ExtensionsListPage.js +2 -2
- package/dist/client/extensions/ExtensionsListPage.js.map +1 -1
- package/dist/client/extensions/agent-native-extension-runtime.js +1 -1
- package/dist/client/extensions/agent-native-extension-runtime.js.map +1 -1
- package/dist/client/navigation/index.d.ts +1 -1
- package/dist/client/navigation/index.d.ts.map +1 -1
- package/dist/client/navigation/index.js +1 -1
- package/dist/client/navigation/index.js.map +1 -1
- package/dist/client/org/OrgSwitcher.d.ts.map +1 -1
- package/dist/client/org/OrgSwitcher.js +9 -13
- package/dist/client/org/OrgSwitcher.js.map +1 -1
- package/dist/client/settings/ExtensionsSettingsContent.js +1 -1
- package/dist/client/settings/ExtensionsSettingsContent.js.map +1 -1
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/collab/awareness.d.ts.map +1 -1
- package/dist/extensions/theme.js +1 -1
- package/dist/extensions/theme.js.map +1 -1
- package/dist/file-upload/actions/upload-image.d.ts +1 -1
- package/dist/localization/default-messages.d.ts +2 -0
- package/dist/localization/default-messages.d.ts.map +1 -1
- package/dist/localization/default-messages.js +2 -0
- package/dist/localization/default-messages.js.map +1 -1
- package/dist/provider-api/actions/provider-api.d.ts +2 -2
- package/dist/resources/handlers.d.ts +1 -1
- package/dist/server/core-routes-plugin.d.ts.map +1 -1
- package/dist/server/core-routes-plugin.js +8 -1
- package/dist/server/core-routes-plugin.js.map +1 -1
- package/dist/server/framework-request-handler.d.ts.map +1 -1
- package/dist/server/framework-request-handler.js +17 -27
- package/dist/server/framework-request-handler.js.map +1 -1
- package/dist/server/realtime-token.d.ts +1 -1
- package/dist/styles/agent-native.css +13 -0
- package/dist/templates/chat/app/components/layout/Layout.tsx +3 -0
- package/dist/templates/chat/app/components/layout/Sidebar.tsx +78 -45
- package/dist/templates/chat/app/global.css +1 -1
- package/dist/templates/chat/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
- package/dist/templates/chat/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
- package/dist/templates/default/app/global.css +1 -1
- package/dist/tracking/error-capture.d.ts +14 -0
- package/dist/tracking/error-capture.d.ts.map +1 -0
- package/dist/tracking/error-capture.js +113 -0
- package/dist/tracking/error-capture.js.map +1 -0
- package/dist/tracking/index.d.ts +1 -0
- package/dist/tracking/index.d.ts.map +1 -1
- package/dist/tracking/index.js +1 -0
- package/dist/tracking/index.js.map +1 -1
- package/package.json +2 -2
- package/src/cli/context-xray-local.ts +1 -1
- package/src/cli/index.ts +63 -18
- package/src/cli/skills.ts +5 -0
- package/src/cli/telemetry.ts +118 -1
- package/src/client/AgentPanel.tsx +10 -0
- package/src/client/CommandMenu.tsx +13 -1
- package/src/client/agent-page/AgentTabsPage.tsx +39 -4
- package/src/client/analytics.ts +13 -0
- package/src/client/error-capture.ts +6 -1
- package/src/client/extensions/ExtensionsListPage.tsx +12 -5
- package/src/client/extensions/agent-native-extension-runtime.ts +1 -1
- package/src/client/navigation/index.ts +2 -0
- package/src/client/org/OrgSwitcher.tsx +14 -32
- package/src/client/settings/ExtensionsSettingsContent.tsx +1 -1
- package/src/extensions/theme.ts +1 -1
- package/src/localization/default-messages.ts +2 -0
- package/src/server/core-routes-plugin.ts +10 -1
- package/src/server/framework-request-handler.ts +17 -26
- package/src/styles/agent-native.css +13 -0
- package/src/templates/chat/app/components/layout/Layout.tsx +3 -0
- package/src/templates/chat/app/components/layout/Sidebar.tsx +78 -45
- package/src/templates/chat/app/global.css +1 -1
- package/src/templates/chat/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
- package/src/templates/chat/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
- package/src/templates/default/app/global.css +1 -1
- package/src/tracking/error-capture.ts +151 -0
- package/src/tracking/index.ts +5 -0
|
@@ -5,9 +5,11 @@ import {
|
|
|
5
5
|
import { agentNativePath } from "@agent-native/core/client/api-path";
|
|
6
6
|
import { appApiPath } from "@agent-native/core/client/api-path";
|
|
7
7
|
import { DevDatabaseLink } from "@agent-native/core/client/db-admin";
|
|
8
|
-
import { useT } from "@agent-native/core/client/i18n";
|
|
8
|
+
import { LanguagePicker, useT } from "@agent-native/core/client/i18n";
|
|
9
|
+
import { openCommandMenu } from "@agent-native/core/client/navigation";
|
|
9
10
|
import { InvitationBanner, OrgSwitcher } from "@agent-native/core/client/org";
|
|
10
11
|
import { FeedbackButton } from "@agent-native/core/client/ui";
|
|
12
|
+
import { SidebarFooterActions } from "@agent-native/toolkit/app-shell";
|
|
11
13
|
import { normalizeMailLabel } from "@shared/gmail-labels";
|
|
12
14
|
import type { Label } from "@shared/types";
|
|
13
15
|
import {
|
|
@@ -383,6 +385,60 @@ function AppLayoutInner({ children }: AppLayoutProps) {
|
|
|
383
385
|
if (!sidebarPinned || isMobile) setSidebarOpen(false);
|
|
384
386
|
}, [sidebarPinned, isMobile]);
|
|
385
387
|
|
|
388
|
+
const collapseButton =
|
|
389
|
+
sidebarPinned && !isMobile ? (
|
|
390
|
+
<Tooltip>
|
|
391
|
+
<TooltipTrigger asChild>
|
|
392
|
+
<button
|
|
393
|
+
type="button"
|
|
394
|
+
onClick={() => setSidebarCollapsed((value) => !value)}
|
|
395
|
+
className="flex h-8 w-8 items-center justify-center rounded text-muted-foreground hover:bg-accent/50 hover:text-foreground"
|
|
396
|
+
aria-label={
|
|
397
|
+
showCollapsedSidebar
|
|
398
|
+
? t("sidebar.expandSidebar")
|
|
399
|
+
: t("sidebar.collapseSidebar")
|
|
400
|
+
}
|
|
401
|
+
>
|
|
402
|
+
{showCollapsedSidebar ? (
|
|
403
|
+
<IconLayoutSidebarLeftExpand className="h-4 w-4 rtl:-scale-x-100" />
|
|
404
|
+
) : (
|
|
405
|
+
<IconLayoutSidebarLeftCollapse className="h-4 w-4 rtl:-scale-x-100" />
|
|
406
|
+
)}
|
|
407
|
+
</button>
|
|
408
|
+
</TooltipTrigger>
|
|
409
|
+
<TooltipContent side="right">
|
|
410
|
+
{showCollapsedSidebar
|
|
411
|
+
? t("sidebar.expandSidebar")
|
|
412
|
+
: t("sidebar.collapseSidebar")}
|
|
413
|
+
</TooltipContent>
|
|
414
|
+
</Tooltip>
|
|
415
|
+
) : null;
|
|
416
|
+
const searchButton = (
|
|
417
|
+
<Tooltip>
|
|
418
|
+
<TooltipTrigger asChild>
|
|
419
|
+
<button
|
|
420
|
+
type="button"
|
|
421
|
+
onClick={openCommandMenu}
|
|
422
|
+
className="flex h-8 w-8 items-center justify-center rounded text-muted-foreground hover:bg-accent/50 hover:text-foreground"
|
|
423
|
+
aria-label={t("mail.search.label")}
|
|
424
|
+
>
|
|
425
|
+
<IconSearch className="h-4 w-4" />
|
|
426
|
+
</button>
|
|
427
|
+
</TooltipTrigger>
|
|
428
|
+
<TooltipContent side="right">{t("mail.search.label")}</TooltipContent>
|
|
429
|
+
</Tooltip>
|
|
430
|
+
);
|
|
431
|
+
const translateButton = (
|
|
432
|
+
<LanguagePicker variant="ghost-icon" label={t("settings.languageLabel")} />
|
|
433
|
+
);
|
|
434
|
+
const feedbackButton = (
|
|
435
|
+
<FeedbackButton
|
|
436
|
+
variant={showCollapsedSidebar ? "icon" : "sidebar"}
|
|
437
|
+
side="right"
|
|
438
|
+
className={showCollapsedSidebar ? "size-8" : "min-w-0"}
|
|
439
|
+
/>
|
|
440
|
+
);
|
|
441
|
+
|
|
386
442
|
// Drag-to-reorder tabs
|
|
387
443
|
const [dragPinnedId, setDragPinnedId] = useState<string | null>(null);
|
|
388
444
|
const [dropIndicator, setDropIndicator] = useState<{
|
|
@@ -890,6 +946,13 @@ function AppLayoutInner({ children }: AppLayoutProps) {
|
|
|
890
946
|
},
|
|
891
947
|
]);
|
|
892
948
|
|
|
949
|
+
useEffect(() => {
|
|
950
|
+
const handler = () => setPaletteOpen(true);
|
|
951
|
+
window.addEventListener("agent-native:open-command-menu", handler);
|
|
952
|
+
return () =>
|
|
953
|
+
window.removeEventListener("agent-native:open-command-menu", handler);
|
|
954
|
+
}, []);
|
|
955
|
+
|
|
893
956
|
// Sequence shortcuts (g + key = go to view)
|
|
894
957
|
const qc = useQueryClient();
|
|
895
958
|
useSequenceShortcuts([
|
|
@@ -1436,45 +1499,12 @@ function AppLayoutInner({ children }: AppLayoutProps) {
|
|
|
1436
1499
|
: "justify-between px-4",
|
|
1437
1500
|
)}
|
|
1438
1501
|
>
|
|
1439
|
-
{showCollapsedSidebar ? (
|
|
1440
|
-
<Tooltip>
|
|
1441
|
-
<TooltipTrigger asChild>
|
|
1442
|
-
<button
|
|
1443
|
-
type="button"
|
|
1444
|
-
onClick={() => setSidebarCollapsed(false)}
|
|
1445
|
-
className="flex h-10 w-10 items-center justify-center rounded text-muted-foreground hover:bg-accent/50 hover:text-foreground"
|
|
1446
|
-
aria-label={t("sidebar.expandSidebar")}
|
|
1447
|
-
>
|
|
1448
|
-
<IconLayoutSidebarLeftExpand className="h-4 w-4 rtl:-scale-x-100" />
|
|
1449
|
-
</button>
|
|
1450
|
-
</TooltipTrigger>
|
|
1451
|
-
<TooltipContent side="right">
|
|
1452
|
-
{t("sidebar.expandSidebar")}
|
|
1453
|
-
</TooltipContent>
|
|
1454
|
-
</Tooltip>
|
|
1455
|
-
) : (
|
|
1502
|
+
{showCollapsedSidebar ? null : (
|
|
1456
1503
|
<>
|
|
1457
1504
|
<span className="text-[13px] font-medium text-foreground">
|
|
1458
1505
|
{t("mail.appName")}
|
|
1459
1506
|
</span>
|
|
1460
1507
|
<div className="flex items-center gap-1">
|
|
1461
|
-
{sidebarPinned && !isMobile ? (
|
|
1462
|
-
<Tooltip>
|
|
1463
|
-
<TooltipTrigger asChild>
|
|
1464
|
-
<button
|
|
1465
|
-
type="button"
|
|
1466
|
-
onClick={() => setSidebarCollapsed(true)}
|
|
1467
|
-
className="flex h-7 w-7 items-center justify-center rounded text-muted-foreground hover:bg-accent/50 hover:text-foreground"
|
|
1468
|
-
aria-label={t("sidebar.collapseSidebar")}
|
|
1469
|
-
>
|
|
1470
|
-
<IconLayoutSidebarLeftCollapse className="h-4 w-4 rtl:-scale-x-100" />
|
|
1471
|
-
</button>
|
|
1472
|
-
</TooltipTrigger>
|
|
1473
|
-
<TooltipContent>
|
|
1474
|
-
{t("sidebar.collapseSidebar")}
|
|
1475
|
-
</TooltipContent>
|
|
1476
|
-
</Tooltip>
|
|
1477
|
-
) : null}
|
|
1478
1508
|
<Tooltip>
|
|
1479
1509
|
<TooltipTrigger asChild>
|
|
1480
1510
|
<button
|
|
@@ -1745,7 +1775,6 @@ function AppLayoutInner({ children }: AppLayoutProps) {
|
|
|
1745
1775
|
|
|
1746
1776
|
<div className="flex items-center justify-end gap-1 px-2 py-2">
|
|
1747
1777
|
<DevDatabaseLink />
|
|
1748
|
-
<FeedbackButton className="min-w-0 flex-1" />
|
|
1749
1778
|
<Tooltip>
|
|
1750
1779
|
<TooltipTrigger asChild>
|
|
1751
1780
|
<Link
|
|
@@ -1789,6 +1818,14 @@ function AppLayoutInner({ children }: AppLayoutProps) {
|
|
|
1789
1818
|
</div>
|
|
1790
1819
|
</>
|
|
1791
1820
|
)}
|
|
1821
|
+
<SidebarFooterActions
|
|
1822
|
+
collapsed={showCollapsedSidebar}
|
|
1823
|
+
feedback={feedbackButton}
|
|
1824
|
+
translate={translateButton}
|
|
1825
|
+
search={searchButton}
|
|
1826
|
+
collapse={collapseButton}
|
|
1827
|
+
className={showCollapsedSidebar ? undefined : "px-0 py-0"}
|
|
1828
|
+
/>
|
|
1792
1829
|
</div>
|
|
1793
1830
|
</>
|
|
1794
1831
|
)}
|
|
@@ -1975,6 +2012,51 @@ function StandardLayout({ children }: AppLayoutProps) {
|
|
|
1975
2012
|
const queuedDrafts = useQueuedDraftCount();
|
|
1976
2013
|
const view = location.pathname.split("/").filter(Boolean)[0] || "";
|
|
1977
2014
|
|
|
2015
|
+
const collapseButton = (
|
|
2016
|
+
<Tooltip>
|
|
2017
|
+
<TooltipTrigger asChild>
|
|
2018
|
+
<button
|
|
2019
|
+
type="button"
|
|
2020
|
+
onClick={() => setSidebarOpen(false)}
|
|
2021
|
+
className="flex h-8 w-8 items-center justify-center rounded text-muted-foreground hover:bg-accent/50 hover:text-foreground"
|
|
2022
|
+
aria-label={t("sidebar.collapseSidebar")}
|
|
2023
|
+
>
|
|
2024
|
+
<IconLayoutSidebarLeftCollapse className="h-4 w-4 rtl:-scale-x-100" />
|
|
2025
|
+
</button>
|
|
2026
|
+
</TooltipTrigger>
|
|
2027
|
+
<TooltipContent side="right">
|
|
2028
|
+
{t("sidebar.collapseSidebar")}
|
|
2029
|
+
</TooltipContent>
|
|
2030
|
+
</Tooltip>
|
|
2031
|
+
);
|
|
2032
|
+
const searchButton = (
|
|
2033
|
+
<Tooltip>
|
|
2034
|
+
<TooltipTrigger asChild>
|
|
2035
|
+
<button
|
|
2036
|
+
type="button"
|
|
2037
|
+
onClick={() => {
|
|
2038
|
+
setSidebarOpen(false);
|
|
2039
|
+
window.setTimeout(
|
|
2040
|
+
() => document.getElementById("mail-search")?.focus(),
|
|
2041
|
+
0,
|
|
2042
|
+
);
|
|
2043
|
+
}}
|
|
2044
|
+
className="flex h-8 w-8 items-center justify-center rounded text-muted-foreground hover:bg-accent/50 hover:text-foreground"
|
|
2045
|
+
aria-label={t("mail.search.label")}
|
|
2046
|
+
>
|
|
2047
|
+
<IconSearch className="h-4 w-4" />
|
|
2048
|
+
</button>
|
|
2049
|
+
</TooltipTrigger>
|
|
2050
|
+
<TooltipContent side="right">{t("mail.search.label")}</TooltipContent>
|
|
2051
|
+
</Tooltip>
|
|
2052
|
+
);
|
|
2053
|
+
const translateButton = (
|
|
2054
|
+
<LanguagePicker variant="ghost-icon" label={t("settings.languageLabel")} />
|
|
2055
|
+
);
|
|
2056
|
+
const feedbackButton = (
|
|
2057
|
+
<FeedbackButton variant="sidebar" side="right" className="min-w-0" />
|
|
2058
|
+
);
|
|
2059
|
+
|
|
1978
2060
|
// Extensions (`/extensions` list and `/extensions/:id` viewer) render their own h-12
|
|
1979
2061
|
// toolbar inside the shared
|
|
1980
2062
|
// ExtensionViewer / ExtensionsListPage components. Skip our header to avoid stacking.
|
|
@@ -2113,7 +2195,6 @@ function StandardLayout({ children }: AppLayoutProps) {
|
|
|
2113
2195
|
|
|
2114
2196
|
<div className="flex items-center justify-end gap-1 px-2 py-2">
|
|
2115
2197
|
<DevDatabaseLink />
|
|
2116
|
-
<FeedbackButton className="min-w-0 flex-1" />
|
|
2117
2198
|
<div className="flex shrink-0 items-center gap-0.5">
|
|
2118
2199
|
<Tooltip>
|
|
2119
2200
|
<TooltipTrigger asChild>
|
|
@@ -2154,6 +2235,13 @@ function StandardLayout({ children }: AppLayoutProps) {
|
|
|
2154
2235
|
<ThemeToggle className="h-8 w-8 shrink-0" />
|
|
2155
2236
|
</div>
|
|
2156
2237
|
</div>
|
|
2238
|
+
<SidebarFooterActions
|
|
2239
|
+
feedback={feedbackButton}
|
|
2240
|
+
translate={translateButton}
|
|
2241
|
+
search={searchButton}
|
|
2242
|
+
collapse={collapseButton}
|
|
2243
|
+
className="px-0 py-0"
|
|
2244
|
+
/>
|
|
2157
2245
|
</div>
|
|
2158
2246
|
</div>
|
|
2159
2247
|
</>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AgentSidebar,
|
|
3
|
+
isAgentChatHomeHandoffActive,
|
|
3
4
|
useAgentChatHomeHandoff,
|
|
4
5
|
useAgentChatHomeHandoffLinks,
|
|
5
6
|
} from "@agent-native/core/client/agent-chat";
|
|
@@ -92,6 +93,7 @@ export function Layout({ children }: LayoutProps) {
|
|
|
92
93
|
activePath: location.pathname,
|
|
93
94
|
enabled: !chatRoute,
|
|
94
95
|
});
|
|
96
|
+
const chatHomeHandoffPending = isAgentChatHomeHandoffActive("plans");
|
|
95
97
|
useAgentChatHomeHandoffLinks({
|
|
96
98
|
storageKey: "plans",
|
|
97
99
|
chatPath: "/",
|
|
@@ -206,6 +208,7 @@ export function Layout({ children }: LayoutProps) {
|
|
|
206
208
|
position="right"
|
|
207
209
|
defaultOpen={false}
|
|
208
210
|
chatViewTransition
|
|
211
|
+
chatViewTransitionHandoff={chatHomeHandoffPending}
|
|
209
212
|
storageKey="plans"
|
|
210
213
|
openOnChatRunning={chatHomeHandoffActive}
|
|
211
214
|
agentPageHref="/agent"
|
|
@@ -10,9 +10,11 @@ import { agentNativePath, appPath } from "@agent-native/core/client/api-path";
|
|
|
10
10
|
import { PromptComposer } from "@agent-native/core/client/composer";
|
|
11
11
|
import { DevDatabaseLink } from "@agent-native/core/client/db-admin";
|
|
12
12
|
import { useSession } from "@agent-native/core/client/hooks";
|
|
13
|
-
import { useT } from "@agent-native/core/client/i18n";
|
|
13
|
+
import { LanguagePicker, useT } from "@agent-native/core/client/i18n";
|
|
14
|
+
import { openCommandMenu } from "@agent-native/core/client/navigation";
|
|
14
15
|
import { OrgSwitcher } from "@agent-native/core/client/org";
|
|
15
16
|
import { FeedbackButton } from "@agent-native/core/client/ui";
|
|
17
|
+
import { SidebarFooterActions } from "@agent-native/toolkit/app-shell";
|
|
16
18
|
import {
|
|
17
19
|
ChatHistoryRail,
|
|
18
20
|
type ChatHistoryItem,
|
|
@@ -27,6 +29,7 @@ import {
|
|
|
27
29
|
IconPlus,
|
|
28
30
|
IconRefresh,
|
|
29
31
|
IconSettings,
|
|
32
|
+
IconSearch,
|
|
30
33
|
} from "@tabler/icons-react";
|
|
31
34
|
import { useEffect, useMemo, useState, type MouseEvent } from "react";
|
|
32
35
|
import { Link, useLocation, useNavigate } from "react-router";
|
|
@@ -146,7 +149,13 @@ function persistedActiveThreadId() {
|
|
|
146
149
|
}
|
|
147
150
|
}
|
|
148
151
|
|
|
149
|
-
function PlanChatsSection({
|
|
152
|
+
function PlanChatsSection({
|
|
153
|
+
collapsed,
|
|
154
|
+
open,
|
|
155
|
+
}: {
|
|
156
|
+
collapsed: boolean;
|
|
157
|
+
open: boolean;
|
|
158
|
+
}) {
|
|
150
159
|
const navigate = useNavigate();
|
|
151
160
|
const t = useT();
|
|
152
161
|
const {
|
|
@@ -244,35 +253,41 @@ function PlanChatsSection({ collapsed }: { collapsed: boolean }) {
|
|
|
244
253
|
}
|
|
245
254
|
|
|
246
255
|
return (
|
|
247
|
-
<div
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
256
|
+
<div
|
|
257
|
+
className="an-chat-history-rail__collapse"
|
|
258
|
+
data-state={open ? "open" : "closed"}
|
|
259
|
+
aria-hidden={!open}
|
|
260
|
+
>
|
|
261
|
+
<div className="ms-4">
|
|
262
|
+
<ChatHistoryRail
|
|
263
|
+
items={chatItems}
|
|
264
|
+
activeId={activeThreadId}
|
|
265
|
+
onSelect={(threadId) => openThread(threadId)}
|
|
266
|
+
onNewChat={() => void handleNewChat()}
|
|
267
|
+
railLabels={{
|
|
268
|
+
newChat: t("sidebar.newChat"),
|
|
269
|
+
showMore: t("sidebar.chats"),
|
|
270
|
+
showLess: t("sidebar.chats"),
|
|
271
|
+
}}
|
|
272
|
+
renameMaxLength={160}
|
|
273
|
+
onTogglePin={(threadId) => {
|
|
274
|
+
const thread = visibleThreads.find((item) => item.id === threadId);
|
|
275
|
+
if (thread) void pinThread(threadId, !thread.pinnedAt);
|
|
276
|
+
}}
|
|
277
|
+
onRename={handleRenameThread}
|
|
278
|
+
onDelete={(threadId) => void handleArchiveThread(threadId)}
|
|
279
|
+
labels={{
|
|
280
|
+
options: (item) => `${t("sidebar.chats")}: ${item.titleText ?? ""}`,
|
|
281
|
+
renameInput: (item) =>
|
|
282
|
+
`${t("sidebar.renameChat")}: ${item.titleText ?? ""}`,
|
|
283
|
+
rename: t("sidebar.renameChat"),
|
|
284
|
+
pin: t("sidebar.pinChat"),
|
|
285
|
+
unpin: t("sidebar.unpinChat"),
|
|
286
|
+
delete: t("sidebar.archiveChat"),
|
|
287
|
+
}}
|
|
288
|
+
className="min-w-0"
|
|
289
|
+
/>
|
|
290
|
+
</div>
|
|
276
291
|
</div>
|
|
277
292
|
);
|
|
278
293
|
}
|
|
@@ -554,6 +569,35 @@ export function Sidebar({
|
|
|
554
569
|
</TooltipContent>
|
|
555
570
|
</Tooltip>
|
|
556
571
|
) : null;
|
|
572
|
+
const searchButton = (
|
|
573
|
+
<Tooltip>
|
|
574
|
+
<TooltipTrigger asChild>
|
|
575
|
+
<Button
|
|
576
|
+
type="button"
|
|
577
|
+
size="icon"
|
|
578
|
+
variant="ghost"
|
|
579
|
+
className="size-8 shrink-0 text-muted-foreground"
|
|
580
|
+
onClick={openCommandMenu}
|
|
581
|
+
aria-label={t("plansPage.overview.searchPlaceholder")}
|
|
582
|
+
>
|
|
583
|
+
<IconSearch className="size-4" />
|
|
584
|
+
</Button>
|
|
585
|
+
</TooltipTrigger>
|
|
586
|
+
<TooltipContent side="right">
|
|
587
|
+
{t("plansPage.overview.searchPlaceholder")}
|
|
588
|
+
</TooltipContent>
|
|
589
|
+
</Tooltip>
|
|
590
|
+
);
|
|
591
|
+
const translateButton = (
|
|
592
|
+
<LanguagePicker variant="ghost-icon" label={t("settings.languageLabel")} />
|
|
593
|
+
);
|
|
594
|
+
const feedbackButton = (
|
|
595
|
+
<FeedbackButton
|
|
596
|
+
variant={collapsed ? "icon" : "sidebar"}
|
|
597
|
+
side="right"
|
|
598
|
+
className={collapsed ? "size-8" : "min-w-0"}
|
|
599
|
+
/>
|
|
600
|
+
);
|
|
557
601
|
|
|
558
602
|
return (
|
|
559
603
|
<aside
|
|
@@ -630,7 +674,7 @@ export function Sidebar({
|
|
|
630
674
|
<div key={item.href}>
|
|
631
675
|
{link}
|
|
632
676
|
{item.href === "/" && isActive ? (
|
|
633
|
-
<PlanChatsSection collapsed={collapsed} />
|
|
677
|
+
<PlanChatsSection collapsed={collapsed} open />
|
|
634
678
|
) : null}
|
|
635
679
|
{item.href === "/plans" && isActive ? (
|
|
636
680
|
<PlansSidebarSection collapsed={collapsed} />
|
|
@@ -676,25 +720,15 @@ export function Sidebar({
|
|
|
676
720
|
</nav>
|
|
677
721
|
|
|
678
722
|
{!collapsed && session ? (
|
|
679
|
-
|
|
680
|
-
<
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
<FeedbackButton className="min-w-0 flex-1" side="right" />
|
|
684
|
-
{collapseButton}
|
|
685
|
-
</div>
|
|
686
|
-
<OrgSwitcher />
|
|
687
|
-
</div>
|
|
688
|
-
</>
|
|
723
|
+
<div className="space-y-2 px-3 py-2">
|
|
724
|
+
<DevDatabaseLink />
|
|
725
|
+
<OrgSwitcher />
|
|
726
|
+
</div>
|
|
689
727
|
) : null}
|
|
690
728
|
|
|
691
729
|
{!collapsed && !sessionLoading && !session ? (
|
|
692
730
|
<div className="space-y-2 px-3 py-2">
|
|
693
731
|
<DevDatabaseLink />
|
|
694
|
-
<div className="flex items-center justify-end gap-1">
|
|
695
|
-
<FeedbackButton className="min-w-0 flex-1" side="right" />
|
|
696
|
-
{collapseButton}
|
|
697
|
-
</div>
|
|
698
732
|
<Button
|
|
699
733
|
type="button"
|
|
700
734
|
size="sm"
|
|
@@ -707,23 +741,19 @@ export function Sidebar({
|
|
|
707
741
|
</div>
|
|
708
742
|
) : null}
|
|
709
743
|
|
|
710
|
-
{collapsed &&
|
|
711
|
-
<div
|
|
712
|
-
|
|
713
|
-
"px-2 py-2",
|
|
714
|
-
collapsed ? "flex justify-center" : "flex justify-end",
|
|
715
|
-
)}
|
|
716
|
-
>
|
|
717
|
-
{collapseButton}
|
|
744
|
+
{!collapsed && sessionLoading ? (
|
|
745
|
+
<div className="px-3 py-2">
|
|
746
|
+
<DevDatabaseLink />
|
|
718
747
|
</div>
|
|
719
748
|
) : null}
|
|
720
749
|
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
750
|
+
<SidebarFooterActions
|
|
751
|
+
collapsed={collapsed}
|
|
752
|
+
feedback={feedbackButton}
|
|
753
|
+
translate={translateButton}
|
|
754
|
+
search={searchButton}
|
|
755
|
+
collapse={collapseButton}
|
|
756
|
+
/>
|
|
727
757
|
</aside>
|
|
728
758
|
);
|
|
729
759
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { appPath } from "@agent-native/core/client/api-path";
|
|
2
2
|
import { DevDatabaseLink } from "@agent-native/core/client/db-admin";
|
|
3
|
-
import { useT } from "@agent-native/core/client/i18n";
|
|
3
|
+
import { LanguagePicker, useT } from "@agent-native/core/client/i18n";
|
|
4
|
+
import { openCommandMenu } from "@agent-native/core/client/navigation";
|
|
4
5
|
import { OrgSwitcher } from "@agent-native/core/client/org";
|
|
5
6
|
import { FeedbackButton } from "@agent-native/core/client/ui";
|
|
7
|
+
import { SidebarFooterActions } from "@agent-native/toolkit/app-shell";
|
|
6
8
|
import {
|
|
7
9
|
IconStack2,
|
|
8
10
|
IconHierarchy2,
|
|
@@ -10,6 +12,7 @@ import {
|
|
|
10
12
|
IconSettings,
|
|
11
13
|
IconLayoutSidebarLeftCollapse,
|
|
12
14
|
IconLayoutSidebarLeftExpand,
|
|
15
|
+
IconSearch,
|
|
13
16
|
} from "@tabler/icons-react";
|
|
14
17
|
import { Link, useLocation } from "react-router";
|
|
15
18
|
|
|
@@ -50,25 +53,60 @@ export function Sidebar({ collapsed, onToggleCollapsed }: SidebarProps) {
|
|
|
50
53
|
? location.pathname === "/"
|
|
51
54
|
: location.pathname.startsWith(href);
|
|
52
55
|
|
|
56
|
+
const collapseButton = onToggleCollapsed ? (
|
|
57
|
+
<Tooltip>
|
|
58
|
+
<TooltipTrigger asChild>
|
|
59
|
+
<button
|
|
60
|
+
type="button"
|
|
61
|
+
onClick={onToggleCollapsed}
|
|
62
|
+
aria-label={
|
|
63
|
+
collapsed
|
|
64
|
+
? t("sidebar.expandSidebar")
|
|
65
|
+
: t("sidebar.collapseSidebar")
|
|
66
|
+
}
|
|
67
|
+
className="flex size-8 items-center justify-center rounded-md text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"
|
|
68
|
+
>
|
|
69
|
+
{collapsed ? (
|
|
70
|
+
<IconLayoutSidebarLeftExpand className="h-4 w-4 rtl:-scale-x-100" />
|
|
71
|
+
) : (
|
|
72
|
+
<IconLayoutSidebarLeftCollapse className="h-4 w-4 rtl:-scale-x-100" />
|
|
73
|
+
)}
|
|
74
|
+
</button>
|
|
75
|
+
</TooltipTrigger>
|
|
76
|
+
<TooltipContent side="right">
|
|
77
|
+
{collapsed ? t("sidebar.expandSidebar") : t("sidebar.collapseSidebar")}
|
|
78
|
+
</TooltipContent>
|
|
79
|
+
</Tooltip>
|
|
80
|
+
) : null;
|
|
81
|
+
const searchButton = (
|
|
82
|
+
<Tooltip>
|
|
83
|
+
<TooltipTrigger asChild>
|
|
84
|
+
<button
|
|
85
|
+
type="button"
|
|
86
|
+
onClick={openCommandMenu}
|
|
87
|
+
aria-label={t("root.searchDecks")}
|
|
88
|
+
className="flex size-8 items-center justify-center rounded-md text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"
|
|
89
|
+
>
|
|
90
|
+
<IconSearch className="h-4 w-4" />
|
|
91
|
+
</button>
|
|
92
|
+
</TooltipTrigger>
|
|
93
|
+
<TooltipContent side="right">{t("root.searchDecks")}</TooltipContent>
|
|
94
|
+
</Tooltip>
|
|
95
|
+
);
|
|
96
|
+
const translateButton = (
|
|
97
|
+
<LanguagePicker variant="ghost-icon" label={t("settings.languageLabel")} />
|
|
98
|
+
);
|
|
99
|
+
const feedbackButton = (
|
|
100
|
+
<FeedbackButton
|
|
101
|
+
variant={collapsed ? "icon" : "sidebar"}
|
|
102
|
+
side="right"
|
|
103
|
+
className={collapsed ? "size-8" : "min-w-0"}
|
|
104
|
+
/>
|
|
105
|
+
);
|
|
106
|
+
|
|
53
107
|
if (collapsed) {
|
|
54
108
|
return (
|
|
55
109
|
<aside className="flex h-full w-12 shrink-0 flex-col items-center gap-1 overflow-hidden border-e border-border bg-sidebar py-2 text-sidebar-foreground transition-[width] duration-200 ease-out">
|
|
56
|
-
{onToggleCollapsed && (
|
|
57
|
-
<Tooltip delayDuration={0}>
|
|
58
|
-
<TooltipTrigger asChild>
|
|
59
|
-
<button
|
|
60
|
-
onClick={onToggleCollapsed}
|
|
61
|
-
aria-label={t("sidebar.expandSidebar")}
|
|
62
|
-
className="flex h-10 w-10 items-center justify-center rounded-md text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"
|
|
63
|
-
>
|
|
64
|
-
<IconLayoutSidebarLeftExpand className="h-4 w-4 rtl:-scale-x-100" />
|
|
65
|
-
</button>
|
|
66
|
-
</TooltipTrigger>
|
|
67
|
-
<TooltipContent side="right">
|
|
68
|
-
{t("sidebar.expandSidebar")}
|
|
69
|
-
</TooltipContent>
|
|
70
|
-
</Tooltip>
|
|
71
|
-
)}
|
|
72
110
|
<nav className="flex min-h-0 flex-1 flex-col items-center gap-1 overflow-y-auto pt-1">
|
|
73
111
|
{navItems.map((item) => {
|
|
74
112
|
const Icon = item.icon;
|
|
@@ -117,6 +155,13 @@ export function Sidebar({ collapsed, onToggleCollapsed }: SidebarProps) {
|
|
|
117
155
|
);
|
|
118
156
|
})}
|
|
119
157
|
</nav>
|
|
158
|
+
<SidebarFooterActions
|
|
159
|
+
collapsed
|
|
160
|
+
feedback={feedbackButton}
|
|
161
|
+
translate={translateButton}
|
|
162
|
+
search={searchButton}
|
|
163
|
+
collapse={collapseButton}
|
|
164
|
+
/>
|
|
120
165
|
</aside>
|
|
121
166
|
);
|
|
122
167
|
}
|
|
@@ -141,20 +186,6 @@ export function Sidebar({ collapsed, onToggleCollapsed }: SidebarProps) {
|
|
|
141
186
|
{t("navigation.brand")}
|
|
142
187
|
</span>
|
|
143
188
|
</div>
|
|
144
|
-
{onToggleCollapsed && (
|
|
145
|
-
<Tooltip>
|
|
146
|
-
<TooltipTrigger asChild>
|
|
147
|
-
<button
|
|
148
|
-
onClick={onToggleCollapsed}
|
|
149
|
-
aria-label={t("sidebar.collapseSidebar")}
|
|
150
|
-
className="flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"
|
|
151
|
-
>
|
|
152
|
-
<IconLayoutSidebarLeftCollapse className="h-4 w-4 rtl:-scale-x-100" />
|
|
153
|
-
</button>
|
|
154
|
-
</TooltipTrigger>
|
|
155
|
-
<TooltipContent>{t("sidebar.collapseSidebar")}</TooltipContent>
|
|
156
|
-
</Tooltip>
|
|
157
|
-
)}
|
|
158
189
|
</div>
|
|
159
190
|
|
|
160
191
|
<div className="flex min-h-0 flex-1 flex-col overflow-y-auto">
|
|
@@ -209,8 +240,14 @@ export function Sidebar({ collapsed, onToggleCollapsed }: SidebarProps) {
|
|
|
209
240
|
|
|
210
241
|
<div className="px-3 py-2 empty:hidden">
|
|
211
242
|
<DevDatabaseLink />
|
|
212
|
-
<FeedbackButton />
|
|
213
243
|
</div>
|
|
244
|
+
<SidebarFooterActions
|
|
245
|
+
feedback={feedbackButton}
|
|
246
|
+
translate={translateButton}
|
|
247
|
+
search={searchButton}
|
|
248
|
+
collapse={collapseButton}
|
|
249
|
+
className="px-0 py-0"
|
|
250
|
+
/>
|
|
214
251
|
</div>
|
|
215
252
|
</div>
|
|
216
253
|
</aside>
|