@vetta-org/theme-ui 0.1.0
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/package.json +195 -0
- package/src/action-approval/AppearanceActionPickerView.tsx +291 -0
- package/src/action-approval/AppearanceApprovalDrawerView.tsx +69 -0
- package/src/action-approval/AppearancePickerApprovalView.tsx +31 -0
- package/src/action-approval/ApprovalParts.tsx +376 -0
- package/src/action-approval/BatchTasksApprovalFrameView.tsx +138 -0
- package/src/action-approval/BatchTasksExecutionApprovalView.tsx +158 -0
- package/src/action-approval/BatchTasksTaskApprovalView.tsx +152 -0
- package/src/action-approval/GeneralSetExecutionModeApprovalView.tsx +76 -0
- package/src/action-approval/GenericActionApprovalView.tsx +127 -0
- package/src/action-approval/ManageActionApprovalFrameTypes.ts +27 -0
- package/src/action-approval/ManageActionApprovalFrameView.tsx +136 -0
- package/src/action-approval/NavigationOpenApprovalView.tsx +119 -0
- package/src/action-approval/SchedulerActionApprovalDialogView.tsx +191 -0
- package/src/action-approval/SchedulerEditApprovalDrawerView.tsx +113 -0
- package/src/action-approval/SchedulerUpdateApprovalView.tsx +14 -0
- package/src/action-approval/ThemeChangeApprovalView.tsx +30 -0
- package/src/action-approval/WebhookDeleteApprovalView.tsx +56 -0
- package/src/action-approval/WebhookTestApprovalView.tsx +51 -0
- package/src/action-approval/cn.ts +4 -0
- package/src/action-approval/index.ts +88 -0
- package/src/activity/ActivityPanel.tsx +269 -0
- package/src/activity/ActivityPanelFrame.tsx +36 -0
- package/src/activity/BackgroundTasksTabPanelView.tsx +382 -0
- package/src/activity/BatchProgressTabPanelView.tsx +22 -0
- package/src/activity/BrowserPanelView.tsx +169 -0
- package/src/activity/ChatTabPanelView.tsx +36 -0
- package/src/activity/CodePreview.tsx +57 -0
- package/src/activity/DebugTabPanelView.tsx +67 -0
- package/src/activity/FileTabContentView.tsx +46 -0
- package/src/activity/FloatingActivityTabView.tsx +107 -0
- package/src/activity/HtmlPreviewView.tsx +135 -0
- package/src/activity/JourneyPanelView.tsx +327 -0
- package/src/activity/KnowledgeHistoryPanelView.tsx +93 -0
- package/src/activity/MarkdownPreviewView.tsx +217 -0
- package/src/activity/PluginTabPickerView.tsx +182 -0
- package/src/activity/RequestHistorySubTabView.tsx +102 -0
- package/src/activity/ScheduleExecutionTabPanelView.tsx +162 -0
- package/src/activity/TodoTabPanelView.tsx +66 -0
- package/src/activity/ToolCallsSubTabView.tsx +184 -0
- package/src/activity/WorkflowTabPanelView.tsx +129 -0
- package/src/activity/index.ts +110 -0
- package/src/app/AppBackground.tsx +24 -0
- package/src/app/AppBootLoadingView.tsx +51 -0
- package/src/app/RouteContentLoadingView.tsx +20 -0
- package/src/app/index.ts +13 -0
- package/src/app-boot.ts +1 -0
- package/src/app-shell/DefaultPageHeader.tsx +46 -0
- package/src/app-shell/DefaultWindowControls.tsx +32 -0
- package/src/app-shell/PageHeaderActionGroup.tsx +15 -0
- package/src/app-shell/PageHeaderContent.tsx +70 -0
- package/src/app-shell/PageHeaderFrame.tsx +53 -0
- package/src/app-shell/PageHeaderSidebarTrigger.tsx +21 -0
- package/src/app-shell/PageHeaderTitle.tsx +25 -0
- package/src/app-shell/PageHeaderWindowActions.tsx +22 -0
- package/src/app-shell/WindowControlButton.tsx +35 -0
- package/src/app-shell/index.ts +49 -0
- package/src/appearance/BackgroundImageFrame.tsx +57 -0
- package/src/appearance/CenterSliceImageFrame.tsx +64 -0
- package/src/appearance/CornerImageFrame.tsx +63 -0
- package/src/appearance/HorizontalSliceImageFrame.tsx +97 -0
- package/src/appearance/NineSliceImageFrame.tsx +65 -0
- package/src/appearance/ThemeSurface.tsx +91 -0
- package/src/appearance/index.ts +12 -0
- package/src/batch-tasks/BatchProjectArtifactFieldView.tsx +36 -0
- package/src/batch-tasks/BatchProjectDialogView.tsx +61 -0
- package/src/batch-tasks/BatchProjectFoldersFieldView.tsx +108 -0
- package/src/batch-tasks/BatchProjectGroupView.tsx +77 -0
- package/src/batch-tasks/BatchProjectNameFieldView.tsx +29 -0
- package/src/batch-tasks/BatchProjectNotificationFieldView.tsx +42 -0
- package/src/batch-tasks/BatchProjectRuntimeFieldsView.tsx +67 -0
- package/src/batch-tasks/BatchTaskActionButtonsView.tsx +67 -0
- package/src/batch-tasks/BatchTaskCardView.tsx +142 -0
- package/src/batch-tasks/BatchTaskGridView.tsx +95 -0
- package/src/batch-tasks/BatchTaskListView.tsx +10 -0
- package/src/batch-tasks/BatchTaskProjectActionsView.tsx +73 -0
- package/src/batch-tasks/BatchTaskProjectBlockView.tsx +117 -0
- package/src/batch-tasks/BatchTaskProjectHeaderView.tsx +74 -0
- package/src/batch-tasks/BatchTasksPageView.tsx +126 -0
- package/src/batch-tasks/batchTaskUi.tsx +101 -0
- package/src/batch-tasks/index.ts +70 -0
- package/src/batch-tasks/types.ts +120 -0
- package/src/chat/ActionButtonBarView.tsx +45 -0
- package/src/chat/AgentAvatarView.tsx +59 -0
- package/src/chat/AppshotCardView.tsx +89 -0
- package/src/chat/AskUserQuestionView.tsx +177 -0
- package/src/chat/AssistantMessageView.tsx +147 -0
- package/src/chat/AtPanelView.tsx +220 -0
- package/src/chat/BackgroundTasksBadgeView.tsx +28 -0
- package/src/chat/BashTerminalCard.tsx +225 -0
- package/src/chat/ChatExportHostView.tsx +17 -0
- package/src/chat/ChatHeaderActionsView.tsx +75 -0
- package/src/chat/ContextRingView.tsx +100 -0
- package/src/chat/CopyIconButton.tsx +61 -0
- package/src/chat/DefaultGuidingWords.tsx +75 -0
- package/src/chat/DefaultSceneCarousel.tsx +113 -0
- package/src/chat/DefaultSkillBadgeRow.tsx +103 -0
- package/src/chat/DrawerCard.tsx +149 -0
- package/src/chat/EditDiffView.tsx +137 -0
- package/src/chat/ExecutionModeSelectorView.tsx +124 -0
- package/src/chat/ExportMessageListView.tsx +20 -0
- package/src/chat/GuideBadgeSwiperView.tsx +79 -0
- package/src/chat/InlineTokenChip.tsx +68 -0
- package/src/chat/InputActionBarView.tsx +112 -0
- package/src/chat/InputBarBackground.tsx +25 -0
- package/src/chat/InputBarCapsule.tsx +56 -0
- package/src/chat/InputBarContextMenuView.tsx +79 -0
- package/src/chat/InputBarPlaceholder.tsx +84 -0
- package/src/chat/InputBarToolbarButton.tsx +42 -0
- package/src/chat/KnowledgeToolViews.tsx +119 -0
- package/src/chat/LiveThinkingView.tsx +102 -0
- package/src/chat/MessageActions.tsx +109 -0
- package/src/chat/MessageBlockSegmentsView.tsx +203 -0
- package/src/chat/MessageBoundaryViews.tsx +93 -0
- package/src/chat/MessageCardsView.tsx +126 -0
- package/src/chat/MessageFeedContext.tsx +14 -0
- package/src/chat/MessageFeedLayoutView.tsx +97 -0
- package/src/chat/MessageFeedView.tsx +228 -0
- package/src/chat/MessageInputView.tsx +193 -0
- package/src/chat/MessageLayoutView.tsx +156 -0
- package/src/chat/MessageListFooterView.tsx +127 -0
- package/src/chat/MessageSelectionContextMenuView.tsx +66 -0
- package/src/chat/MessageTimelineView.tsx +261 -0
- package/src/chat/MessageView.tsx +82 -0
- package/src/chat/MessageVisualView.tsx +43 -0
- package/src/chat/ModelSelectorView.tsx +407 -0
- package/src/chat/NewSession.ts +107 -0
- package/src/chat/NewSessionBackground.tsx +54 -0
- package/src/chat/NewSessionPageLayoutView.tsx +96 -0
- package/src/chat/NewSessionPicker.tsx +270 -0
- package/src/chat/ProgressGroupView.tsx +323 -0
- package/src/chat/ProjectSelectorView.tsx +253 -0
- package/src/chat/QueueCardView.tsx +151 -0
- package/src/chat/ReadImageView.tsx +73 -0
- package/src/chat/SandboxGrantsBadgeView.tsx +101 -0
- package/src/chat/SandboxPermissionCard.tsx +64 -0
- package/src/chat/SceneCard.tsx +138 -0
- package/src/chat/SendButton.tsx +135 -0
- package/src/chat/SessionDropZoneView.tsx +85 -0
- package/src/chat/SessionViewerPageView.tsx +56 -0
- package/src/chat/SkillCard.tsx +56 -0
- package/src/chat/SkillPromptAreaView.tsx +129 -0
- package/src/chat/SuggestionBubblesView.tsx +58 -0
- package/src/chat/TextBlockView.tsx +770 -0
- package/src/chat/TextPreview.tsx +37 -0
- package/src/chat/ThinkingBlockView.tsx +183 -0
- package/src/chat/TodoCard.tsx +243 -0
- package/src/chat/TodoProgress.tsx +205 -0
- package/src/chat/TodoStatusBarView.tsx +140 -0
- package/src/chat/ToolCallBlockView.tsx +188 -0
- package/src/chat/UsageBarView.tsx +19 -0
- package/src/chat/UserMessageContextMenuView.tsx +87 -0
- package/src/chat/UserMessageView.tsx +241 -0
- package/src/chat/WorkflowFooterItemsView.tsx +170 -0
- package/src/chat/WriteContentView.tsx +12 -0
- package/src/chat/index.ts +524 -0
- package/src/chat/markdown-link.test.ts +238 -0
- package/src/chat/markdown-link.ts +279 -0
- package/src/chat/send-button.css +318 -0
- package/src/chat/useHorizontalDragScroll.ts +146 -0
- package/src/file-explorer/ConfirmDeleteDialogView.tsx +62 -0
- package/src/file-explorer/FileContextMenuView.tsx +209 -0
- package/src/file-explorer/FileTreeCreateRow.tsx +82 -0
- package/src/file-explorer/FileTreeNodeView.tsx +274 -0
- package/src/file-explorer/FileTreeView.tsx +301 -0
- package/src/file-explorer/FilesPanelView.tsx +91 -0
- package/src/file-explorer/drag-target.test.ts +34 -0
- package/src/file-explorer/drag-target.ts +26 -0
- package/src/file-explorer/fileIcons.ts +1 -0
- package/src/file-explorer/index.ts +28 -0
- package/src/file-explorer/nativeFileDrag.test.ts +30 -0
- package/src/file-explorer/nativeFileDrag.ts +14 -0
- package/src/file-explorer/types.ts +40 -0
- package/src/file-explorer/useFileTreeMarqueeSelection.ts +115 -0
- package/src/file-preview/FilePreviewDialogView.tsx +241 -0
- package/src/file-preview/FilePreviewView.tsx +162 -0
- package/src/file-preview/LightboxImageView.tsx +131 -0
- package/src/file-preview/PluginFilePreviewView.tsx +24 -0
- package/src/file-preview/PreviewBodyView.tsx +99 -0
- package/src/file-preview/PreviewErrorBoundary.tsx +51 -0
- package/src/file-preview/TextCodeEditorView.tsx +72 -0
- package/src/file-preview/TextFileEditorView.tsx +213 -0
- package/src/file-preview/index.ts +56 -0
- package/src/file-preview/keyboard-target.test.ts +49 -0
- package/src/file-preview/keyboard-target.ts +33 -0
- package/src/file-preview/syntax-tokens.css +77 -0
- package/src/file-preview/syntax-tokens.test.ts +31 -0
- package/src/file-preview/syntax-tokens.ts +155 -0
- package/src/file-preview/text-code-editor-theme.ts +321 -0
- package/src/file-preview/text-editor-language.test.ts +58 -0
- package/src/file-preview/text-editor-language.ts +182 -0
- package/src/file-preview/types.ts +29 -0
- package/src/flowing/FlowingPanelView.tsx +79 -0
- package/src/flowing/FlowingWorkflowView.tsx +54 -0
- package/src/flowing/UserNodeView.tsx +148 -0
- package/src/flowing/WorkflowBindDialogView.tsx +145 -0
- package/src/flowing/WorkflowProgressView.tsx +149 -0
- package/src/flowing/index.ts +27 -0
- package/src/flowing-chat/ChatBubbleView.tsx +219 -0
- package/src/flowing-chat/ChatComposerView.tsx +362 -0
- package/src/flowing-chat/ChatMembersBarView.tsx +86 -0
- package/src/flowing-chat/ChatPanelView.tsx +73 -0
- package/src/flowing-chat/index.ts +21 -0
- package/src/index.ts +22 -0
- package/src/knowledge/KnowledgeBaseSwitcherView.tsx +154 -0
- package/src/knowledge/KnowledgeBreadcrumbView.tsx +92 -0
- package/src/knowledge/KnowledgeContentsPanelView.tsx +77 -0
- package/src/knowledge/KnowledgeContextMenuView.tsx +70 -0
- package/src/knowledge/KnowledgeFilesSkeleton.tsx +22 -0
- package/src/knowledge/KnowledgeGridView.tsx +113 -0
- package/src/knowledge/KnowledgeHowItWorksDialogView.tsx +85 -0
- package/src/knowledge/KnowledgeImportDialogView.tsx +153 -0
- package/src/knowledge/KnowledgeListView.tsx +107 -0
- package/src/knowledge/KnowledgePendingFilesDialogView.tsx +76 -0
- package/src/knowledge/KnowledgeProcessingBadgeView.tsx +18 -0
- package/src/knowledge/KnowledgeRenameDialogView.tsx +66 -0
- package/src/knowledge/KnowledgeSourcePickerView.tsx +60 -0
- package/src/knowledge/KnowledgeViewShared.tsx +103 -0
- package/src/knowledge/cn.ts +4 -0
- package/src/knowledge/coloredFileIcons.ts +1 -0
- package/src/knowledge/index.ts +66 -0
- package/src/knowledge/types.ts +31 -0
- package/src/knowledge/useMarqueeSelection.ts +95 -0
- package/src/layout/AppFrame.tsx +34 -0
- package/src/layout/MainContentFrame.tsx +54 -0
- package/src/layout/ResizeHandle.tsx +91 -0
- package/src/layout/SidebarDock.tsx +33 -0
- package/src/layout/SidebarOverlay.tsx +36 -0
- package/src/layout/index.ts +10 -0
- package/src/overlays/CommandMenuRow.tsx +119 -0
- package/src/overlays/CommandMenuView.tsx +183 -0
- package/src/overlays/ConfirmDialogView.tsx +109 -0
- package/src/overlays/DetailDrawer.tsx +63 -0
- package/src/overlays/DetailDrawerEnter.tsx +37 -0
- package/src/overlays/KnowledgeDropOverlayView.tsx +43 -0
- package/src/overlays/RouteErrorPageView.tsx +72 -0
- package/src/overlays/ToasterView.tsx +76 -0
- package/src/overlays/UpdateCheckerView.tsx +206 -0
- package/src/overlays/UpdateRestartDialogView.tsx +107 -0
- package/src/overlays/command-menu-types.ts +47 -0
- package/src/overlays/command-menu.css +69 -0
- package/src/overlays/detail-drawer-guard.test.ts +16 -0
- package/src/overlays/detail-drawer-guard.ts +13 -0
- package/src/overlays/index.ts +44 -0
- package/src/plugin-ui/index.ts +26 -0
- package/src/project/BatchQueueStatusView.tsx +352 -0
- package/src/project/ConversationTagDotsView.tsx +130 -0
- package/src/project/ConversationTagEditorDialogView.tsx +273 -0
- package/src/project/DefaultConversationSectionView.tsx +74 -0
- package/src/project/DefaultSessionListView.tsx +128 -0
- package/src/project/DefaultSessionRowView.tsx +125 -0
- package/src/project/NewProjectDialogView.tsx +140 -0
- package/src/project/ProjectContextMenuView.tsx +187 -0
- package/src/project/ProjectDetailPageView.tsx +351 -0
- package/src/project/ProjectGroupView.tsx +37 -0
- package/src/project/ProjectRowView.tsx +111 -0
- package/src/project/ProjectSessionsLoadingView.tsx +14 -0
- package/src/project/ProjectSessionsView.tsx +96 -0
- package/src/project/ProjectsLoadingView.tsx +15 -0
- package/src/project/ProjectsPanelMenusView.tsx +23 -0
- package/src/project/ProjectsPanelView.tsx +56 -0
- package/src/project/QuickScrollOverlay.tsx +188 -0
- package/src/project/ScheduleStatusView.tsx +110 -0
- package/src/project/SessionContextMenuView.tsx +71 -0
- package/src/project/SessionRenameInputView.tsx +49 -0
- package/src/project/SessionRowView.tsx +119 -0
- package/src/project/SidebarProjectsSectionView.tsx +35 -0
- package/src/project/index.ts +87 -0
- package/src/project/types.ts +21 -0
- package/src/project/useActiveSessionAutoScroll.ts +171 -0
- package/src/registry.ts +62 -0
- package/src/scheduler/AutomationPageView.tsx +159 -0
- package/src/scheduler/ExecutionHistoryView.tsx +179 -0
- package/src/scheduler/HistoryDrawerView.tsx +149 -0
- package/src/scheduler/TaskFormDialogView.tsx +60 -0
- package/src/scheduler/TaskListView.tsx +219 -0
- package/src/scheduler/index.ts +30 -0
- package/src/settings/AchievementNavigationButtonView.tsx +90 -0
- package/src/settings/AchievementPromotionDialogView.tsx +91 -0
- package/src/settings/AchievementSettingsView.tsx +44 -0
- package/src/settings/AppshotSettingsView.tsx +132 -0
- package/src/settings/ArchivedProjectsSettingsView.tsx +80 -0
- package/src/settings/BuiltinMcpSecretsDialogView.tsx +278 -0
- package/src/settings/BuiltinMcpSectionView.tsx +164 -0
- package/src/settings/EnvironmentSettingsView.tsx +176 -0
- package/src/settings/GeneralSettingsView.tsx +174 -0
- package/src/settings/ImChannelCardView.tsx +152 -0
- package/src/settings/ImChannelGuideDialogView.tsx +126 -0
- package/src/settings/ImFeishuDialogView.tsx +156 -0
- package/src/settings/ImLegacyImportBannerView.tsx +44 -0
- package/src/settings/ImLogDrawerView.tsx +75 -0
- package/src/settings/ImStatusBadgeView.tsx +39 -0
- package/src/settings/McpDefaultIcon.tsx +27 -0
- package/src/settings/McpJsonEditorView.tsx +56 -0
- package/src/settings/ModelsProviderFormView.tsx +128 -0
- package/src/settings/ModelsProvidersSectionView.tsx +52 -0
- package/src/settings/MotionSelect.tsx +125 -0
- package/src/settings/PermissionsSettingsView.tsx +106 -0
- package/src/settings/PetBubbleStylePreviewView.tsx +44 -0
- package/src/settings/PetSettingsView.tsx +165 -0
- package/src/settings/PresetProviderModelsListView.tsx +58 -0
- package/src/settings/PresetProviderRowView.tsx +302 -0
- package/src/settings/PresetProvidersSectionView.tsx +70 -0
- package/src/settings/QrBindDialogView.tsx +165 -0
- package/src/settings/QuickPanelSettingsSectionView.tsx +66 -0
- package/src/settings/RemoteMcpSectionView.tsx +192 -0
- package/src/settings/SettingChrome.tsx +104 -0
- package/src/settings/SettingsAiAssistButtonView.tsx +150 -0
- package/src/settings/SettingsAiAssistDialogView.tsx +251 -0
- package/src/settings/SettingsFormFields.tsx +121 -0
- package/src/settings/SettingsPageShellView.tsx +84 -0
- package/src/settings/SettingsSidebarView.tsx +133 -0
- package/src/settings/ShortcutRecorderView.tsx +88 -0
- package/src/settings/ShortcutsSettingsView.tsx +66 -0
- package/src/settings/SubscriptionActionsView.tsx +63 -0
- package/src/settings/SubscriptionCardsView.tsx +212 -0
- package/src/settings/TeamDetailView.tsx +148 -0
- package/src/settings/TeamDialogsView.tsx +151 -0
- package/src/settings/TeamListView.tsx +57 -0
- package/src/settings/TeamSettingsView.tsx +51 -0
- package/src/settings/TokenActivityChartView.tsx +286 -0
- package/src/settings/UsageStatsView.tsx +101 -0
- package/src/settings/WebhookEndpointListView.tsx +123 -0
- package/src/settings/WechatBindDialogView.tsx +45 -0
- package/src/settings/achievements/AchievementCurtains.tsx +50 -0
- package/src/settings/achievements/AchievementPromotionBadge3D.tsx +350 -0
- package/src/settings/achievements/AchievementPromotionConfetti.tsx +71 -0
- package/src/settings/achievements/AchievementTitle.tsx +52 -0
- package/src/settings/achievements/index.ts +13 -0
- package/src/settings/index.ts +226 -0
- package/src/settings/shouldCloseEmptyApiKeyEditor.test.ts +135 -0
- package/src/settings/shouldCloseEmptyApiKeyEditor.ts +40 -0
- package/src/settings/token-activity.test.ts +195 -0
- package/src/settings/token-activity.ts +320 -0
- package/src/shared/AvatarStackView.tsx +45 -0
- package/src/shared/BotAvatar.tsx +395 -0
- package/src/shared/CodeBlockCopyButton.tsx +48 -0
- package/src/shared/CollapsePanel.tsx +125 -0
- package/src/shared/ContextMenuView.tsx +134 -0
- package/src/shared/MacKeyboardPreview.tsx +260 -0
- package/src/shared/MarkdownTable.tsx +216 -0
- package/src/shared/MultiplierTag.tsx +15 -0
- package/src/shared/ScrollFade.tsx +114 -0
- package/src/shared/SegmentedControl.tsx +82 -0
- package/src/shared/SyntaxHighlightedCode.tsx +0 -0
- package/src/shared/TabBar.tsx +696 -0
- package/src/shared/TimePicker.tsx +96 -0
- package/src/shared/connected-tab-outline.test.ts +22 -0
- package/src/shared/connected-tab-outline.ts +39 -0
- package/src/shared/fileIcons.test.ts +28 -0
- package/src/shared/fileIcons.ts +322 -0
- package/src/shared/index.ts +38 -0
- package/src/shared/markdown-table-clipboard.ts +31 -0
- package/src/shared/provider-icon/icons.ts +56 -0
- package/src/shared/provider-icon/index.tsx +42 -0
- package/src/shared/provider-icon/svg-url.d.ts +4 -0
- package/src/shared/tab-drag.test.ts +14 -0
- package/src/shared/tab-drag.ts +15 -0
- package/src/shared/useDelayedUnmount.ts +36 -0
- package/src/sidebar/AddProjectMenuItem.tsx +21 -0
- package/src/sidebar/AddProjectMenuPopoverView.tsx +52 -0
- package/src/sidebar/AddProjectMenuTriggerView.tsx +50 -0
- package/src/sidebar/ChatMessageListView.tsx +66 -0
- package/src/sidebar/DefaultSidebar.tsx +91 -0
- package/src/sidebar/FlowingMessageListView.tsx +111 -0
- package/src/sidebar/MessageCenterDialogView.tsx +81 -0
- package/src/sidebar/MessageCenterEmptyState.tsx +24 -0
- package/src/sidebar/MessageCenterTabs.tsx +86 -0
- package/src/sidebar/MessageCenterToolbarButton.tsx +25 -0
- package/src/sidebar/MessageCenterTriggerView.tsx +39 -0
- package/src/sidebar/NotificationMessageListView.tsx +136 -0
- package/src/sidebar/ProjectsPanelEmptyState.tsx +20 -0
- package/src/sidebar/RunningPulseDot.tsx +10 -0
- package/src/sidebar/SessionStatusIcon.tsx +43 -0
- package/src/sidebar/SettingsMenuAccountSection.tsx +32 -0
- package/src/sidebar/SettingsMenuActionButton.tsx +24 -0
- package/src/sidebar/SettingsMenuDivider.tsx +5 -0
- package/src/sidebar/SettingsMenuQuotaSection.tsx +45 -0
- package/src/sidebar/SettingsMenuSettingsItem.tsx +18 -0
- package/src/sidebar/SettingsMenuThemeSection.tsx +51 -0
- package/src/sidebar/SettingsMenuTriggerView.tsx +65 -0
- package/src/sidebar/ShowMoreSessionsButton.tsx +37 -0
- package/src/sidebar/SidebarFilterSelectView.tsx +95 -0
- package/src/sidebar/SidebarNavBadgeView.tsx +58 -0
- package/src/sidebar/SidebarNavIcon.tsx +33 -0
- package/src/sidebar/SidebarNavItemButton.tsx +59 -0
- package/src/sidebar/SidebarNavMorePanel.tsx +199 -0
- package/src/sidebar/SidebarNavigation.tsx +223 -0
- package/src/sidebar/SidebarPanel.tsx +48 -0
- package/src/sidebar/SidebarTopBar.tsx +103 -0
- package/src/sidebar/SidebarUpdateIcon.tsx +79 -0
- package/src/sidebar/index.ts +118 -0
- package/src/sidebar/nav-badge-text.test.ts +23 -0
- package/src/sidebar/nav-badge-text.ts +19 -0
- package/src/sidebar/useSidebarNavDrag.ts +139 -0
- package/src/skills/PluginCardView.tsx +150 -0
- package/src/skills/SceneCardView.tsx +194 -0
- package/src/skills/SkillCardView.tsx +186 -0
- package/src/skills/SkillDetailDialogView.tsx +138 -0
- package/src/skills/SkillTagGroupView.tsx +56 -0
- package/src/skills/SkillToggleSwitch.tsx +31 -0
- package/src/skills/index.ts +29 -0
- package/src/skills/skill-icon.test.ts +38 -0
- package/src/skills/skill-icon.tsx +126 -0
- package/src/styles.css +75 -0
- package/src/utils/platform.ts +2 -0
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { useState, type JSX, type ReactNode } from "react";
|
|
2
|
+
import { Popover, PopoverContent, PopoverTrigger, cn } from "@vetta-org/ui";
|
|
3
|
+
|
|
4
|
+
export const DEFAULT_PLUGIN_TAB_ICON = "icon-[solar--widget-5-linear]";
|
|
5
|
+
|
|
6
|
+
function TabIcon({ icon, className }: { icon: ReactNode; className?: string }): JSX.Element {
|
|
7
|
+
if (typeof icon === "string") {
|
|
8
|
+
return <span className={cn(icon, "h-4 w-4 shrink-0", className)} />;
|
|
9
|
+
}
|
|
10
|
+
return (
|
|
11
|
+
<span
|
|
12
|
+
className={cn(
|
|
13
|
+
"flex h-4 w-4 shrink-0 items-center justify-center [&>svg]:h-full [&>svg]:w-full",
|
|
14
|
+
className,
|
|
15
|
+
)}
|
|
16
|
+
>
|
|
17
|
+
{icon}
|
|
18
|
+
</span>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** "+"下拉中可恢复显示的已隐藏内置/动态 tab。 */
|
|
23
|
+
export interface HiddenTabEntryView {
|
|
24
|
+
readonly key: string;
|
|
25
|
+
readonly label: string;
|
|
26
|
+
readonly icon?: ReactNode;
|
|
27
|
+
/** 可选副标题(如插件显示名)。 */
|
|
28
|
+
readonly subtitle?: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface PluginTabPickerViewLabels {
|
|
32
|
+
readonly menu: string;
|
|
33
|
+
readonly moreTabs: string;
|
|
34
|
+
readonly hiddenPanels: string;
|
|
35
|
+
readonly availablePlugins: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface PluginTabPickerViewProps {
|
|
39
|
+
/** 当前被隐藏、可点击恢复的 tab(内置/动态) */
|
|
40
|
+
readonly hiddenTabs: readonly HiddenTabEntryView[];
|
|
41
|
+
/** 恢复(取消隐藏)某个 tab */
|
|
42
|
+
readonly onRestore: (key: string) => void;
|
|
43
|
+
/** 因宽度不足被响应式收纳、未显示在标签栏上的页签(点击激活并自动让其挤回栏内) */
|
|
44
|
+
readonly overflowTabs: readonly HiddenTabEntryView[];
|
|
45
|
+
/** 激活某个被收纳的页签 */
|
|
46
|
+
readonly onSelectOverflow: (key: string) => void;
|
|
47
|
+
/** 已注册但未 attach 的插件 tab(可添加池) */
|
|
48
|
+
readonly availablePluginTabs?: readonly HiddenTabEntryView[];
|
|
49
|
+
/** 从可添加池 attach 并激活 */
|
|
50
|
+
readonly onAttachPlugin?: (key: string) => void;
|
|
51
|
+
readonly labels: PluginTabPickerViewLabels;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* 活动面板 tab 栏右侧的下拉按钮:可添加池插件 tab、宽度收纳页签、被手动隐藏的页签。
|
|
56
|
+
* 有收纳项或可添加项时常显,否则 hover tab 栏才浮现。
|
|
57
|
+
*/
|
|
58
|
+
export function PluginTabPickerView({
|
|
59
|
+
hiddenTabs,
|
|
60
|
+
onRestore,
|
|
61
|
+
overflowTabs,
|
|
62
|
+
onSelectOverflow,
|
|
63
|
+
availablePluginTabs = [],
|
|
64
|
+
onAttachPlugin,
|
|
65
|
+
labels,
|
|
66
|
+
}: PluginTabPickerViewProps): JSX.Element {
|
|
67
|
+
const [open, setOpen] = useState(false);
|
|
68
|
+
const hasOverflow = overflowTabs.length > 0;
|
|
69
|
+
const hasAvailable = availablePluginTabs.length > 0;
|
|
70
|
+
|
|
71
|
+
return (
|
|
72
|
+
<Popover open={open} onOpenChange={setOpen}>
|
|
73
|
+
<PopoverTrigger asChild>
|
|
74
|
+
<button
|
|
75
|
+
type="button"
|
|
76
|
+
title={labels.menu}
|
|
77
|
+
aria-label={labels.menu}
|
|
78
|
+
className="mb-0.5 mr-2 flex h-7 min-w-7 shrink-0 items-center justify-center gap-0.5 rounded-md px-1 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground"
|
|
79
|
+
>
|
|
80
|
+
{hasOverflow && (
|
|
81
|
+
<span className="text-[10px] font-semibold tabular-nums leading-none">
|
|
82
|
+
{overflowTabs.length}
|
|
83
|
+
</span>
|
|
84
|
+
)}
|
|
85
|
+
<span
|
|
86
|
+
className={
|
|
87
|
+
hasAvailable
|
|
88
|
+
? "icon-[solar--add-circle-linear] h-4 w-4"
|
|
89
|
+
: "icon-[solar--alt-arrow-down-linear] h-4 w-4"
|
|
90
|
+
}
|
|
91
|
+
/>
|
|
92
|
+
</button>
|
|
93
|
+
</PopoverTrigger>
|
|
94
|
+
<PopoverContent align="end" sideOffset={6} className="w-60 gap-0 p-1.5">
|
|
95
|
+
{availablePluginTabs.length > 0 && onAttachPlugin && (
|
|
96
|
+
<>
|
|
97
|
+
<div className="px-2 pb-1.5 pt-1 text-[11px] font-medium text-muted-foreground">
|
|
98
|
+
{labels.availablePlugins}
|
|
99
|
+
</div>
|
|
100
|
+
{availablePluginTabs.map((tab) => (
|
|
101
|
+
<button
|
|
102
|
+
key={tab.key}
|
|
103
|
+
type="button"
|
|
104
|
+
onClick={() => {
|
|
105
|
+
onAttachPlugin(tab.key);
|
|
106
|
+
setOpen(false);
|
|
107
|
+
}}
|
|
108
|
+
className="flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left hover:bg-muted"
|
|
109
|
+
>
|
|
110
|
+
<TabIcon
|
|
111
|
+
icon={tab.icon ?? DEFAULT_PLUGIN_TAB_ICON}
|
|
112
|
+
className="text-muted-foreground"
|
|
113
|
+
/>
|
|
114
|
+
<span className="min-w-0 flex-1">
|
|
115
|
+
<span className="block truncate text-[13px] leading-tight text-foreground">
|
|
116
|
+
{tab.label}
|
|
117
|
+
</span>
|
|
118
|
+
{tab.subtitle && tab.subtitle !== tab.label ? (
|
|
119
|
+
<span className="mt-0.5 block truncate text-[11px] leading-tight text-muted-foreground/70">
|
|
120
|
+
{tab.subtitle}
|
|
121
|
+
</span>
|
|
122
|
+
) : null}
|
|
123
|
+
</span>
|
|
124
|
+
<span className="icon-[solar--add-circle-linear] h-4 w-4 shrink-0 text-muted-foreground" />
|
|
125
|
+
</button>
|
|
126
|
+
))}
|
|
127
|
+
</>
|
|
128
|
+
)}
|
|
129
|
+
{overflowTabs.length > 0 && (
|
|
130
|
+
<>
|
|
131
|
+
<div className="px-2 pb-1.5 pt-1 text-[11px] font-medium text-muted-foreground">
|
|
132
|
+
{labels.moreTabs}
|
|
133
|
+
</div>
|
|
134
|
+
{overflowTabs.map((tab) => (
|
|
135
|
+
<button
|
|
136
|
+
key={tab.key}
|
|
137
|
+
type="button"
|
|
138
|
+
onClick={() => {
|
|
139
|
+
onSelectOverflow(tab.key);
|
|
140
|
+
setOpen(false);
|
|
141
|
+
}}
|
|
142
|
+
className="flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left hover:bg-muted"
|
|
143
|
+
>
|
|
144
|
+
<TabIcon
|
|
145
|
+
icon={tab.icon ?? DEFAULT_PLUGIN_TAB_ICON}
|
|
146
|
+
className="text-muted-foreground"
|
|
147
|
+
/>
|
|
148
|
+
<span className="min-w-0 flex-1 truncate text-[13px] leading-tight text-foreground">
|
|
149
|
+
{tab.label}
|
|
150
|
+
</span>
|
|
151
|
+
</button>
|
|
152
|
+
))}
|
|
153
|
+
</>
|
|
154
|
+
)}
|
|
155
|
+
{hiddenTabs.length > 0 && (
|
|
156
|
+
<>
|
|
157
|
+
<div className="px-2 pb-1.5 pt-1 text-[11px] font-medium text-muted-foreground">
|
|
158
|
+
{labels.hiddenPanels}
|
|
159
|
+
</div>
|
|
160
|
+
{hiddenTabs.map((tab) => (
|
|
161
|
+
<button
|
|
162
|
+
key={tab.key}
|
|
163
|
+
type="button"
|
|
164
|
+
onClick={() => onRestore(tab.key)}
|
|
165
|
+
className="flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left hover:bg-muted"
|
|
166
|
+
>
|
|
167
|
+
<TabIcon
|
|
168
|
+
icon={tab.icon ?? DEFAULT_PLUGIN_TAB_ICON}
|
|
169
|
+
className="text-muted-foreground"
|
|
170
|
+
/>
|
|
171
|
+
<span className="min-w-0 flex-1 truncate text-[13px] leading-tight text-foreground">
|
|
172
|
+
{tab.label}
|
|
173
|
+
</span>
|
|
174
|
+
<span className="icon-[solar--add-circle-linear] h-4 w-4 shrink-0 text-muted-foreground" />
|
|
175
|
+
</button>
|
|
176
|
+
))}
|
|
177
|
+
</>
|
|
178
|
+
)}
|
|
179
|
+
</PopoverContent>
|
|
180
|
+
</Popover>
|
|
181
|
+
);
|
|
182
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import type { JSX } from "react";
|
|
2
|
+
|
|
3
|
+
export interface RequestHistoryItem {
|
|
4
|
+
filename: string;
|
|
5
|
+
path: string;
|
|
6
|
+
timeLabel: string;
|
|
7
|
+
model: string;
|
|
8
|
+
tokensLabel: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface RequestHistorySubTabViewLabels {
|
|
12
|
+
noSession: string;
|
|
13
|
+
loading: string;
|
|
14
|
+
requestCount: string;
|
|
15
|
+
refresh: string;
|
|
16
|
+
empty: string;
|
|
17
|
+
showInFolder: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface RequestHistorySubTabViewProps {
|
|
21
|
+
hasSession: boolean;
|
|
22
|
+
loading: boolean;
|
|
23
|
+
files: readonly RequestHistoryItem[];
|
|
24
|
+
labels: RequestHistorySubTabViewLabels;
|
|
25
|
+
onRefresh: () => void;
|
|
26
|
+
onPreview: (file: RequestHistoryItem) => void;
|
|
27
|
+
onShowInFolder: (path: string) => void;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function RequestHistorySubTabView({
|
|
31
|
+
hasSession,
|
|
32
|
+
loading,
|
|
33
|
+
files,
|
|
34
|
+
labels,
|
|
35
|
+
onRefresh,
|
|
36
|
+
onPreview,
|
|
37
|
+
onShowInFolder,
|
|
38
|
+
}: RequestHistorySubTabViewProps): JSX.Element {
|
|
39
|
+
if (!hasSession) {
|
|
40
|
+
return (
|
|
41
|
+
<div className="flex flex-1 items-center justify-center p-4 text-[12px] text-muted-foreground">
|
|
42
|
+
{labels.noSession}
|
|
43
|
+
</div>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<div className="flex min-h-0 flex-1 flex-col">
|
|
49
|
+
{/* Header */}
|
|
50
|
+
<div className="flex shrink-0 items-center justify-between border-b border-border px-3 py-1">
|
|
51
|
+
<span className="text-[11px] text-muted-foreground">
|
|
52
|
+
{loading ? labels.loading : labels.requestCount}
|
|
53
|
+
</span>
|
|
54
|
+
<button
|
|
55
|
+
type="button"
|
|
56
|
+
onClick={onRefresh}
|
|
57
|
+
className="flex h-5 w-5 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-secondary hover:text-foreground"
|
|
58
|
+
title={labels.refresh}
|
|
59
|
+
>
|
|
60
|
+
<span className="icon-[mdi--refresh] h-3.5 w-3.5" />
|
|
61
|
+
</button>
|
|
62
|
+
</div>
|
|
63
|
+
|
|
64
|
+
{/* List */}
|
|
65
|
+
<div className="flex-1 overflow-y-auto">
|
|
66
|
+
{files.length === 0 && !loading && (
|
|
67
|
+
<div className="p-4 text-center text-[12px] text-muted-foreground">{labels.empty}</div>
|
|
68
|
+
)}
|
|
69
|
+
{files.map((file) => (
|
|
70
|
+
<div
|
|
71
|
+
key={file.filename}
|
|
72
|
+
className="flex items-center gap-2 border-b border-border px-3 py-2 transition-colors hover:bg-secondary/50"
|
|
73
|
+
>
|
|
74
|
+
<button
|
|
75
|
+
type="button"
|
|
76
|
+
onClick={() => onPreview(file)}
|
|
77
|
+
className="flex min-w-0 flex-1 items-center gap-3 text-left"
|
|
78
|
+
>
|
|
79
|
+
<span className="shrink-0 text-[11px] tabular-nums text-muted-foreground">
|
|
80
|
+
{file.timeLabel}
|
|
81
|
+
</span>
|
|
82
|
+
<span className="min-w-0 flex-1 truncate text-[12px] font-medium text-foreground">
|
|
83
|
+
{file.model}
|
|
84
|
+
</span>
|
|
85
|
+
<span className="shrink-0 text-[11px] tabular-nums text-muted-foreground">
|
|
86
|
+
{file.tokensLabel}
|
|
87
|
+
</span>
|
|
88
|
+
</button>
|
|
89
|
+
<button
|
|
90
|
+
type="button"
|
|
91
|
+
onClick={() => onShowInFolder(file.path)}
|
|
92
|
+
className="flex h-5 w-5 shrink-0 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-secondary hover:text-foreground"
|
|
93
|
+
title={labels.showInFolder}
|
|
94
|
+
>
|
|
95
|
+
<span className="icon-[mdi--folder-open-outline] h-3.5 w-3.5" />
|
|
96
|
+
</button>
|
|
97
|
+
</div>
|
|
98
|
+
))}
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
101
|
+
);
|
|
102
|
+
}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import type { JSX, ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
export interface ScheduleSummaryCardItem {
|
|
4
|
+
label: string;
|
|
5
|
+
value: number;
|
|
6
|
+
icon: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface ScheduleTaskControlItem {
|
|
10
|
+
id: string;
|
|
11
|
+
name: string;
|
|
12
|
+
enabledBadge: string;
|
|
13
|
+
enabledBadgeClassName: string;
|
|
14
|
+
/** Host action buttons (run / toggle). */
|
|
15
|
+
actions: ReactNode;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface ScheduleRecordItem {
|
|
19
|
+
id: string;
|
|
20
|
+
taskName: string;
|
|
21
|
+
timeLabel: string;
|
|
22
|
+
statusLabel: string;
|
|
23
|
+
statusClassName: string;
|
|
24
|
+
durationLabel: string | null;
|
|
25
|
+
error: string | null;
|
|
26
|
+
preview: string | null;
|
|
27
|
+
clickable: boolean;
|
|
28
|
+
onClick: () => void;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface ScheduleExecutionTabPanelViewLabels {
|
|
32
|
+
noTasks: string;
|
|
33
|
+
overview: string;
|
|
34
|
+
taskControl: string;
|
|
35
|
+
executionRecords: string;
|
|
36
|
+
noRecords: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface ScheduleExecutionTabPanelViewProps {
|
|
40
|
+
labels: ScheduleExecutionTabPanelViewLabels;
|
|
41
|
+
/** Null when project has no scheduled tasks. */
|
|
42
|
+
empty: boolean;
|
|
43
|
+
summaries: readonly ScheduleSummaryCardItem[];
|
|
44
|
+
/** Host refresh Button. */
|
|
45
|
+
refreshButton: ReactNode;
|
|
46
|
+
tasks: readonly ScheduleTaskControlItem[];
|
|
47
|
+
records: readonly ScheduleRecordItem[];
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function SummaryCard({ label, value, icon }: ScheduleSummaryCardItem): JSX.Element {
|
|
51
|
+
return (
|
|
52
|
+
<div className="rounded-lg border border-border/40 bg-background/50 px-2 py-2">
|
|
53
|
+
<div className="mb-1 flex items-center gap-1 text-[10px] text-muted-foreground/70">
|
|
54
|
+
<span className={`${icon} h-3 w-3`} />
|
|
55
|
+
<span>{label}</span>
|
|
56
|
+
</div>
|
|
57
|
+
<div className="text-[15px] font-semibold tabular-nums text-foreground">{value}</div>
|
|
58
|
+
</div>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Schedule execution tab UI. Host injects Button slots for refresh / run / toggle.
|
|
64
|
+
*/
|
|
65
|
+
export function ScheduleExecutionTabPanelView({
|
|
66
|
+
labels,
|
|
67
|
+
empty,
|
|
68
|
+
summaries,
|
|
69
|
+
refreshButton,
|
|
70
|
+
tasks,
|
|
71
|
+
records,
|
|
72
|
+
}: ScheduleExecutionTabPanelViewProps): JSX.Element {
|
|
73
|
+
if (empty) {
|
|
74
|
+
return (
|
|
75
|
+
<div className="flex h-full flex-col items-center justify-center gap-2 text-muted-foreground/50">
|
|
76
|
+
<span className="icon-[mdi--history] text-[26px]" />
|
|
77
|
+
<span className="text-[12px]">{labels.noTasks}</span>
|
|
78
|
+
</div>
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return (
|
|
83
|
+
<div className="flex h-full min-h-0 flex-col overflow-hidden">
|
|
84
|
+
<div className="shrink-0 border-b border-border/50 px-3 py-3">
|
|
85
|
+
<div className="mb-2 flex items-center justify-between">
|
|
86
|
+
<span className="text-[12px] font-medium text-foreground">{labels.overview}</span>
|
|
87
|
+
{refreshButton}
|
|
88
|
+
</div>
|
|
89
|
+
<div className="grid grid-cols-3 gap-2">
|
|
90
|
+
{summaries.map((item) => (
|
|
91
|
+
<SummaryCard key={item.label} {...item} />
|
|
92
|
+
))}
|
|
93
|
+
</div>
|
|
94
|
+
</div>
|
|
95
|
+
|
|
96
|
+
<div className="min-h-0 flex-1 overflow-y-auto px-3 py-3">
|
|
97
|
+
<div className="mb-3">
|
|
98
|
+
<div className="mb-2 text-[11px] uppercase tracking-wider text-muted-foreground/45">
|
|
99
|
+
{labels.taskControl}
|
|
100
|
+
</div>
|
|
101
|
+
<div className="space-y-2">
|
|
102
|
+
{tasks.map((task) => (
|
|
103
|
+
<div key={task.id} className="rounded-xl border border-border/40 bg-accent/20 p-2.5">
|
|
104
|
+
<div className="mb-1.5 flex items-center justify-between gap-2">
|
|
105
|
+
<span className="truncate text-[12px] font-medium text-foreground">{task.name}</span>
|
|
106
|
+
<span className={`rounded-md px-1.5 py-0.5 text-[10px] ${task.enabledBadgeClassName}`}>
|
|
107
|
+
{task.enabledBadge}
|
|
108
|
+
</span>
|
|
109
|
+
</div>
|
|
110
|
+
<div className="flex items-center gap-1.5">{task.actions}</div>
|
|
111
|
+
</div>
|
|
112
|
+
))}
|
|
113
|
+
</div>
|
|
114
|
+
</div>
|
|
115
|
+
|
|
116
|
+
<div>
|
|
117
|
+
<div className="mb-2 text-[11px] uppercase tracking-wider text-muted-foreground/45">
|
|
118
|
+
{labels.executionRecords}
|
|
119
|
+
</div>
|
|
120
|
+
{records.length === 0 ? (
|
|
121
|
+
<div className="flex flex-col items-center justify-center gap-1 rounded-xl border border-dashed border-border/50 py-8 text-muted-foreground/50">
|
|
122
|
+
<span className="icon-[mdi--timeline-text-outline] text-[20px]" />
|
|
123
|
+
<span className="text-[12px]">{labels.noRecords}</span>
|
|
124
|
+
</div>
|
|
125
|
+
) : (
|
|
126
|
+
<div className="space-y-2">
|
|
127
|
+
{records.map((record) => (
|
|
128
|
+
<button
|
|
129
|
+
key={record.id}
|
|
130
|
+
type="button"
|
|
131
|
+
onClick={record.onClick}
|
|
132
|
+
disabled={!record.clickable}
|
|
133
|
+
className={`w-full rounded-xl border border-border/40 p-2.5 text-left transition-colors ${
|
|
134
|
+
record.clickable ? "bg-background hover:bg-accent/30" : "cursor-default bg-muted/20"
|
|
135
|
+
}`}
|
|
136
|
+
>
|
|
137
|
+
<div className="mb-1.5 flex items-center justify-between gap-2">
|
|
138
|
+
<div className="min-w-0">
|
|
139
|
+
<div className="truncate text-[12px] font-medium text-foreground">{record.taskName}</div>
|
|
140
|
+
<div className="text-[11px] text-muted-foreground/60">{record.timeLabel}</div>
|
|
141
|
+
</div>
|
|
142
|
+
<span className={`rounded-md px-1.5 py-0.5 text-[10px] ${record.statusClassName}`}>
|
|
143
|
+
{record.statusLabel}
|
|
144
|
+
</span>
|
|
145
|
+
</div>
|
|
146
|
+
<div className="flex items-center gap-2 text-[11px] text-muted-foreground/60">
|
|
147
|
+
{record.durationLabel && <span>{record.durationLabel}</span>}
|
|
148
|
+
{record.error && <span className="truncate text-red-500">{record.error}</span>}
|
|
149
|
+
{!record.error && record.preview && <span className="truncate">{record.preview}</span>}
|
|
150
|
+
{record.clickable && (
|
|
151
|
+
<span className="icon-[mdi--open-in-new] ml-auto h-3.5 w-3.5 shrink-0" />
|
|
152
|
+
)}
|
|
153
|
+
</div>
|
|
154
|
+
</button>
|
|
155
|
+
))}
|
|
156
|
+
</div>
|
|
157
|
+
)}
|
|
158
|
+
</div>
|
|
159
|
+
</div>
|
|
160
|
+
</div>
|
|
161
|
+
);
|
|
162
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { JSX } from "react";
|
|
2
|
+
import {
|
|
3
|
+
selectTodoStatusSummary,
|
|
4
|
+
TodoProgressBar,
|
|
5
|
+
TodoProgressStyles,
|
|
6
|
+
TodoStatusDot,
|
|
7
|
+
type TodoStatusItem,
|
|
8
|
+
TodoTimeline,
|
|
9
|
+
type TodoTimelineLabels,
|
|
10
|
+
} from "../chat/TodoProgress";
|
|
11
|
+
|
|
12
|
+
export interface TodoTabPanelViewLabels extends TodoTimelineLabels {
|
|
13
|
+
/** 未完成时的头部文案,如「进行中」。 */
|
|
14
|
+
readonly headline: string;
|
|
15
|
+
/** 全部完成时的头部文案。 */
|
|
16
|
+
readonly allDone: string;
|
|
17
|
+
/** 形如「已完成 2 / 5」。 */
|
|
18
|
+
readonly progress: (done: number, total: number) => string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface TodoTabPanelViewProps {
|
|
22
|
+
readonly items: readonly TodoStatusItem[];
|
|
23
|
+
readonly emptyLabel: string;
|
|
24
|
+
readonly labels: TodoTabPanelViewLabels;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* 活动面板待办页:顶部是状态点 + 百分比 + 进度条的概览,
|
|
29
|
+
* 下面是与输入栏 popover 同一套视觉的时间线清单。
|
|
30
|
+
*/
|
|
31
|
+
export function TodoTabPanelView({ items, emptyLabel, labels }: TodoTabPanelViewProps): JSX.Element {
|
|
32
|
+
if (items.length === 0) {
|
|
33
|
+
return (
|
|
34
|
+
<div className="flex flex-1 flex-col items-center justify-center gap-2 p-6 text-center">
|
|
35
|
+
<span aria-hidden className="icon-[solar--checklist-minimalistic-linear] h-6 w-6 text-muted-foreground/50" />
|
|
36
|
+
<span className="text-sm text-muted-foreground">{emptyLabel}</span>
|
|
37
|
+
</div>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const summary = selectTodoStatusSummary(items);
|
|
42
|
+
return (
|
|
43
|
+
<div className="flex flex-1 flex-col overflow-hidden">
|
|
44
|
+
<TodoProgressStyles />
|
|
45
|
+
<div className="shrink-0 border-b border-border px-4 py-3">
|
|
46
|
+
<div className="mb-2 flex items-center gap-2">
|
|
47
|
+
<TodoStatusDot allDone={summary.allDone} />
|
|
48
|
+
<span className="min-w-0 flex-1 truncate text-[13px] font-medium text-foreground">
|
|
49
|
+
{summary.allDone ? labels.allDone : labels.headline}
|
|
50
|
+
</span>
|
|
51
|
+
<span className="shrink-0 text-[18px] font-semibold leading-none tabular-nums text-foreground">
|
|
52
|
+
{Math.round(summary.percent)}
|
|
53
|
+
<span className="ml-0.5 text-[11px] font-normal text-muted-foreground">%</span>
|
|
54
|
+
</span>
|
|
55
|
+
</div>
|
|
56
|
+
<TodoProgressBar percent={summary.percent} className="h-1.5" />
|
|
57
|
+
<div className="mt-1.5 text-[11px] tabular-nums text-muted-foreground">
|
|
58
|
+
{labels.progress(summary.done, summary.total)}
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
<div className="min-h-0 flex-1 overflow-y-auto p-2">
|
|
62
|
+
<TodoTimeline items={items} labels={labels} size="md" />
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
);
|
|
66
|
+
}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { cn } from "@vetta-org/ui";
|
|
2
|
+
import type { JSX } from "react";
|
|
3
|
+
|
|
4
|
+
export type ToolCallFilterValue = "all" | "success" | "error";
|
|
5
|
+
|
|
6
|
+
export interface ToolCallFilterOption {
|
|
7
|
+
value: ToolCallFilterValue;
|
|
8
|
+
label: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface ToolCallViewItem {
|
|
12
|
+
id: string;
|
|
13
|
+
toolName: string;
|
|
14
|
+
timeLabel: string;
|
|
15
|
+
isError: boolean;
|
|
16
|
+
/** True when a result payload exists (success or error). */
|
|
17
|
+
hasResult: boolean;
|
|
18
|
+
argsText: string;
|
|
19
|
+
resultText: string | null;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface ToolCallsSubTabViewLabels {
|
|
23
|
+
noSession: string;
|
|
24
|
+
searchPlaceholder: string;
|
|
25
|
+
statusText: string;
|
|
26
|
+
refresh: string;
|
|
27
|
+
empty: string;
|
|
28
|
+
noMatch: string;
|
|
29
|
+
args: string;
|
|
30
|
+
result: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface ToolCallsSubTabViewProps {
|
|
34
|
+
hasSession: boolean;
|
|
35
|
+
search: string;
|
|
36
|
+
filter: ToolCallFilterValue;
|
|
37
|
+
filterOptions: readonly ToolCallFilterOption[];
|
|
38
|
+
loading: boolean;
|
|
39
|
+
/** True when unfiltered records are empty (drives empty vs noMatch copy). */
|
|
40
|
+
hasAnyRecords: boolean;
|
|
41
|
+
items: readonly ToolCallViewItem[];
|
|
42
|
+
expandedId: string | null;
|
|
43
|
+
labels: ToolCallsSubTabViewLabels;
|
|
44
|
+
onSearchChange: (value: string) => void;
|
|
45
|
+
onFilterChange: (value: ToolCallFilterValue) => void;
|
|
46
|
+
onToggleExpand: (id: string) => void;
|
|
47
|
+
onRefresh: () => void;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function ToolCallsSubTabView({
|
|
51
|
+
hasSession,
|
|
52
|
+
search,
|
|
53
|
+
filter,
|
|
54
|
+
filterOptions,
|
|
55
|
+
loading,
|
|
56
|
+
hasAnyRecords,
|
|
57
|
+
items,
|
|
58
|
+
expandedId,
|
|
59
|
+
labels,
|
|
60
|
+
onSearchChange,
|
|
61
|
+
onFilterChange,
|
|
62
|
+
onToggleExpand,
|
|
63
|
+
onRefresh,
|
|
64
|
+
}: ToolCallsSubTabViewProps): JSX.Element {
|
|
65
|
+
if (!hasSession) {
|
|
66
|
+
return (
|
|
67
|
+
<div className="flex flex-1 items-center justify-center p-4 text-[12px] text-muted-foreground">
|
|
68
|
+
{labels.noSession}
|
|
69
|
+
</div>
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return (
|
|
74
|
+
<div className="flex min-h-0 flex-1 flex-col">
|
|
75
|
+
{/* Search + Filter bar */}
|
|
76
|
+
<div className="flex shrink-0 items-center gap-2 border-b border-border px-3 py-2">
|
|
77
|
+
<div className="relative flex-1">
|
|
78
|
+
<span className="icon-[mdi--magnify] absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" />
|
|
79
|
+
<input
|
|
80
|
+
type="text"
|
|
81
|
+
value={search}
|
|
82
|
+
onChange={(e) => onSearchChange(e.target.value)}
|
|
83
|
+
placeholder={labels.searchPlaceholder}
|
|
84
|
+
className="h-7 w-full rounded-md border border-input bg-background pl-7 pr-2 text-[12px] text-foreground placeholder:text-muted-foreground focus:border-ring focus:outline-none"
|
|
85
|
+
/>
|
|
86
|
+
</div>
|
|
87
|
+
<div className="flex shrink-0 items-center gap-0.5 rounded-md border border-input bg-background p-0.5">
|
|
88
|
+
{filterOptions.map((opt) => (
|
|
89
|
+
<button
|
|
90
|
+
key={opt.value}
|
|
91
|
+
type="button"
|
|
92
|
+
onClick={() => onFilterChange(opt.value)}
|
|
93
|
+
className={cn(
|
|
94
|
+
"rounded px-2 py-0.5 text-[11px] font-medium transition-colors",
|
|
95
|
+
filter === opt.value
|
|
96
|
+
? "bg-secondary text-foreground"
|
|
97
|
+
: "text-muted-foreground hover:text-foreground",
|
|
98
|
+
)}
|
|
99
|
+
>
|
|
100
|
+
{opt.label}
|
|
101
|
+
</button>
|
|
102
|
+
))}
|
|
103
|
+
</div>
|
|
104
|
+
</div>
|
|
105
|
+
|
|
106
|
+
{/* Refresh */}
|
|
107
|
+
<div className="flex shrink-0 items-center justify-between border-b border-border px-3 py-1">
|
|
108
|
+
<span className="text-[11px] text-muted-foreground">{labels.statusText}</span>
|
|
109
|
+
<button
|
|
110
|
+
type="button"
|
|
111
|
+
onClick={onRefresh}
|
|
112
|
+
className="flex h-5 w-5 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-secondary hover:text-foreground"
|
|
113
|
+
title={labels.refresh}
|
|
114
|
+
>
|
|
115
|
+
<span className="icon-[mdi--refresh] h-3.5 w-3.5" />
|
|
116
|
+
</button>
|
|
117
|
+
</div>
|
|
118
|
+
|
|
119
|
+
{/* Timeline list */}
|
|
120
|
+
<div className="flex-1 overflow-y-auto">
|
|
121
|
+
{items.length === 0 && !loading && (
|
|
122
|
+
<div className="p-4 text-center text-[12px] text-muted-foreground">
|
|
123
|
+
{!hasAnyRecords ? labels.empty : labels.noMatch}
|
|
124
|
+
</div>
|
|
125
|
+
)}
|
|
126
|
+
{items.map((record) => {
|
|
127
|
+
const isExpanded = expandedId === record.id;
|
|
128
|
+
return (
|
|
129
|
+
<div
|
|
130
|
+
key={record.id}
|
|
131
|
+
className={cn("border-b border-border", record.isError && "border-l-2 border-l-destructive")}
|
|
132
|
+
>
|
|
133
|
+
<button
|
|
134
|
+
type="button"
|
|
135
|
+
onClick={() => onToggleExpand(record.id)}
|
|
136
|
+
className="flex w-full items-center gap-2 px-3 py-2 text-left transition-colors hover:bg-secondary/50"
|
|
137
|
+
>
|
|
138
|
+
<span
|
|
139
|
+
className={cn(
|
|
140
|
+
"h-3.5 w-3.5 shrink-0",
|
|
141
|
+
isExpanded ? "icon-[mdi--chevron-down]" : "icon-[mdi--chevron-right]",
|
|
142
|
+
"text-muted-foreground",
|
|
143
|
+
)}
|
|
144
|
+
/>
|
|
145
|
+
<span className="flex-1 truncate text-[12px] font-medium text-foreground">
|
|
146
|
+
{record.toolName}
|
|
147
|
+
</span>
|
|
148
|
+
<span className="shrink-0 text-[11px] text-muted-foreground">{record.timeLabel}</span>
|
|
149
|
+
<span
|
|
150
|
+
className={cn(
|
|
151
|
+
"h-3.5 w-3.5 shrink-0",
|
|
152
|
+
record.isError
|
|
153
|
+
? "icon-[mdi--close-circle] text-destructive"
|
|
154
|
+
: record.hasResult
|
|
155
|
+
? "icon-[mdi--check-circle] text-green-500"
|
|
156
|
+
: "icon-[mdi--clock-outline] text-muted-foreground",
|
|
157
|
+
)}
|
|
158
|
+
/>
|
|
159
|
+
</button>
|
|
160
|
+
{isExpanded && (
|
|
161
|
+
<div className="border-t border-border bg-muted/30 px-3 py-2">
|
|
162
|
+
<div className="mb-1 text-[11px] font-medium text-muted-foreground">{labels.args}</div>
|
|
163
|
+
<pre className="mb-2 max-h-[200px] overflow-auto rounded-md bg-background p-2 text-[11px] text-foreground">
|
|
164
|
+
{record.argsText}
|
|
165
|
+
</pre>
|
|
166
|
+
{record.resultText !== null && (
|
|
167
|
+
<>
|
|
168
|
+
<div className="mb-1 text-[11px] font-medium text-muted-foreground">
|
|
169
|
+
{labels.result}
|
|
170
|
+
</div>
|
|
171
|
+
<pre className="max-h-[300px] overflow-auto rounded-md bg-background p-2 text-[11px] text-foreground">
|
|
172
|
+
{record.resultText}
|
|
173
|
+
</pre>
|
|
174
|
+
</>
|
|
175
|
+
)}
|
|
176
|
+
</div>
|
|
177
|
+
)}
|
|
178
|
+
</div>
|
|
179
|
+
);
|
|
180
|
+
})}
|
|
181
|
+
</div>
|
|
182
|
+
</div>
|
|
183
|
+
);
|
|
184
|
+
}
|