@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,71 @@
|
|
|
1
|
+
import type { JSX } from "react";
|
|
2
|
+
import { ContextMenuView, type ContextMenuNode } from "../shared/ContextMenuView";
|
|
3
|
+
|
|
4
|
+
export interface SessionContextMenuViewLabels {
|
|
5
|
+
pin: string;
|
|
6
|
+
rename: string;
|
|
7
|
+
openInFolder: string;
|
|
8
|
+
delete: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface SessionContextMenuViewProps {
|
|
12
|
+
canDelete: boolean;
|
|
13
|
+
canRename: boolean;
|
|
14
|
+
labels: SessionContextMenuViewLabels;
|
|
15
|
+
/** 挂在「重命名」之后的附加节点,例如标签二级菜单。 */
|
|
16
|
+
extraItems?: readonly ContextMenuNode[];
|
|
17
|
+
onClose: () => void;
|
|
18
|
+
onDelete: () => void;
|
|
19
|
+
onOpenInFolder: () => void;
|
|
20
|
+
onRename: () => void;
|
|
21
|
+
onTogglePin: () => void;
|
|
22
|
+
x: number;
|
|
23
|
+
y: number;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function SessionContextMenuView({
|
|
27
|
+
canDelete,
|
|
28
|
+
canRename,
|
|
29
|
+
labels,
|
|
30
|
+
extraItems,
|
|
31
|
+
onClose,
|
|
32
|
+
onDelete,
|
|
33
|
+
onOpenInFolder,
|
|
34
|
+
onRename,
|
|
35
|
+
onTogglePin,
|
|
36
|
+
x,
|
|
37
|
+
y,
|
|
38
|
+
}: SessionContextMenuViewProps): JSX.Element {
|
|
39
|
+
const items: ContextMenuNode[] = [
|
|
40
|
+
{ kind: "item", id: "pin", label: labels.pin, iconClassName: "icon-[solar--pin-linear]", onSelect: onTogglePin },
|
|
41
|
+
];
|
|
42
|
+
if (canRename) {
|
|
43
|
+
items.push({
|
|
44
|
+
kind: "item",
|
|
45
|
+
id: "rename",
|
|
46
|
+
label: labels.rename,
|
|
47
|
+
iconClassName: "icon-[solar--pen-2-linear]",
|
|
48
|
+
onSelect: onRename,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
if (extraItems && extraItems.length > 0) items.push(...extraItems);
|
|
52
|
+
items.push({
|
|
53
|
+
kind: "item",
|
|
54
|
+
id: "open-in-folder",
|
|
55
|
+
label: labels.openInFolder,
|
|
56
|
+
iconClassName: "icon-[solar--folder-open-linear]",
|
|
57
|
+
onSelect: onOpenInFolder,
|
|
58
|
+
});
|
|
59
|
+
if (canDelete) {
|
|
60
|
+
items.push({
|
|
61
|
+
kind: "item",
|
|
62
|
+
id: "delete",
|
|
63
|
+
label: labels.delete,
|
|
64
|
+
iconClassName: "icon-[solar--trash-bin-trash-linear]",
|
|
65
|
+
danger: true,
|
|
66
|
+
onSelect: onDelete,
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return <ContextMenuView items={items} onClose={onClose} x={x} y={y} />;
|
|
71
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { useEffect, useRef, useState, type JSX } from "react";
|
|
2
|
+
|
|
3
|
+
export interface SessionRenameInputViewProps {
|
|
4
|
+
/** Extra className for layout variants (inline pl padding vs default). */
|
|
5
|
+
className?: string;
|
|
6
|
+
initialValue: string;
|
|
7
|
+
onCancel: () => void;
|
|
8
|
+
onCommit: (value: string) => void;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Inline session rename field. Host supplies initial label and commit side-effects.
|
|
13
|
+
*/
|
|
14
|
+
export function SessionRenameInputView({
|
|
15
|
+
className = "min-w-0 flex-1 truncate rounded-[3px] border border-input bg-accent/50 text-[13px] text-foreground outline-none",
|
|
16
|
+
initialValue,
|
|
17
|
+
onCancel,
|
|
18
|
+
onCommit,
|
|
19
|
+
}: SessionRenameInputViewProps): JSX.Element {
|
|
20
|
+
const [value, setValue] = useState(initialValue);
|
|
21
|
+
const inputRef = useRef<HTMLInputElement>(null);
|
|
22
|
+
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
inputRef.current?.focus();
|
|
25
|
+
inputRef.current?.select();
|
|
26
|
+
}, []);
|
|
27
|
+
|
|
28
|
+
function commit(): void {
|
|
29
|
+
const trimmed = value.trim();
|
|
30
|
+
if (trimmed && trimmed !== initialValue) {
|
|
31
|
+
onCommit(trimmed);
|
|
32
|
+
}
|
|
33
|
+
onCancel();
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<input
|
|
38
|
+
ref={inputRef}
|
|
39
|
+
value={value}
|
|
40
|
+
onChange={(event) => setValue(event.target.value)}
|
|
41
|
+
onBlur={commit}
|
|
42
|
+
onKeyDown={(event) => {
|
|
43
|
+
if (event.key === "Enter") commit();
|
|
44
|
+
if (event.key === "Escape") onCancel();
|
|
45
|
+
}}
|
|
46
|
+
className={className}
|
|
47
|
+
/>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { cn } from "@vetta-org/ui";
|
|
2
|
+
import { memo, type JSX } from "react";
|
|
3
|
+
import { SessionStatusIcon } from "../sidebar/SessionStatusIcon";
|
|
4
|
+
import { AvatarStackView } from "../shared/AvatarStackView";
|
|
5
|
+
import { SessionRenameInputView } from "./SessionRenameInputView";
|
|
6
|
+
import { prepareSidebarSelection } from "./useActiveSessionAutoScroll";
|
|
7
|
+
|
|
8
|
+
export interface SessionRowViewProps {
|
|
9
|
+
active: boolean;
|
|
10
|
+
label: string;
|
|
11
|
+
/** Optional source-specific icon, used by non-session conversation sources such as Agent Teams. */
|
|
12
|
+
iconClassName?: string;
|
|
13
|
+
/** Optional grouped-participant context rendered at the trailing edge. */
|
|
14
|
+
trailingAvatarUrls?: readonly string[];
|
|
15
|
+
/** On-disk session path; used for fly-to-sidebar targeting. */
|
|
16
|
+
sessionPath?: string;
|
|
17
|
+
/** Tooltip / secondary label (e.g. forked-from preview). */
|
|
18
|
+
titleExtra?: string;
|
|
19
|
+
/** Session was forked from another session. */
|
|
20
|
+
forked?: boolean;
|
|
21
|
+
onOpenContextMenu: (event: React.MouseEvent) => void;
|
|
22
|
+
onRename: (name: string) => void;
|
|
23
|
+
onRenameDone: () => void;
|
|
24
|
+
onSelect: () => void;
|
|
25
|
+
pinned?: boolean;
|
|
26
|
+
renaming: boolean;
|
|
27
|
+
running: boolean;
|
|
28
|
+
scheduled: boolean;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* memo:切换会话时只有「上一条」「下一条」两行的 active 变了,其余行的 props 完全一致。
|
|
33
|
+
* 没有 memo 时整份会话列表会跟着重渲染一遍。前提是调用方传的回调引用稳定。
|
|
34
|
+
*/
|
|
35
|
+
export const SessionRowView = memo(function SessionRowView({
|
|
36
|
+
active,
|
|
37
|
+
label,
|
|
38
|
+
iconClassName,
|
|
39
|
+
trailingAvatarUrls,
|
|
40
|
+
sessionPath,
|
|
41
|
+
titleExtra,
|
|
42
|
+
forked,
|
|
43
|
+
onOpenContextMenu,
|
|
44
|
+
onRename,
|
|
45
|
+
onRenameDone,
|
|
46
|
+
onSelect,
|
|
47
|
+
pinned = false,
|
|
48
|
+
renaming,
|
|
49
|
+
running,
|
|
50
|
+
scheduled,
|
|
51
|
+
}: SessionRowViewProps): JSX.Element {
|
|
52
|
+
const title = renaming ? undefined : titleExtra ? `${label}\n${titleExtra}` : label;
|
|
53
|
+
return (
|
|
54
|
+
<button
|
|
55
|
+
type="button"
|
|
56
|
+
data-session-active={active ? "true" : undefined}
|
|
57
|
+
data-session-path={sessionPath || undefined}
|
|
58
|
+
onClick={(event) => {
|
|
59
|
+
if (renaming) return;
|
|
60
|
+
prepareSidebarSelection(event.currentTarget);
|
|
61
|
+
onSelect();
|
|
62
|
+
}}
|
|
63
|
+
onContextMenu={onOpenContextMenu}
|
|
64
|
+
className={cn(
|
|
65
|
+
"relative flex w-full items-center gap-2 rounded-lg py-[6px] pr-2.5 pl-[30px] text-left transition-colors duration-100",
|
|
66
|
+
active ? "bg-accent text-foreground" : "hover:bg-accent/50",
|
|
67
|
+
)}
|
|
68
|
+
title={title}
|
|
69
|
+
>
|
|
70
|
+
{renaming ? (
|
|
71
|
+
<SessionRenameInputView
|
|
72
|
+
className="min-w-0 flex-1 truncate rounded-[3px] border border-input bg-accent/50 pl-[20px] text-[13px] text-foreground outline-none"
|
|
73
|
+
initialValue={label}
|
|
74
|
+
onCancel={onRenameDone}
|
|
75
|
+
onCommit={onRename}
|
|
76
|
+
/>
|
|
77
|
+
) : (
|
|
78
|
+
<>
|
|
79
|
+
{pinned ? (
|
|
80
|
+
<span className="icon-[solar--pin-linear] h-3.5 w-3.5 shrink-0 text-primary/80" />
|
|
81
|
+
) : null}
|
|
82
|
+
{forked && !running && !scheduled ? (
|
|
83
|
+
<span
|
|
84
|
+
data-session-leading-icon="true"
|
|
85
|
+
className={cn(
|
|
86
|
+
"icon-[mdi--source-fork] h-3.5 w-3.5 shrink-0",
|
|
87
|
+
active ? "text-primary/80" : "text-muted-foreground/60",
|
|
88
|
+
)}
|
|
89
|
+
/>
|
|
90
|
+
) : iconClassName && !running && !scheduled ? (
|
|
91
|
+
<span
|
|
92
|
+
data-session-leading-icon="true"
|
|
93
|
+
aria-hidden="true"
|
|
94
|
+
className={cn(
|
|
95
|
+
iconClassName,
|
|
96
|
+
"h-3.5 w-3.5 shrink-0",
|
|
97
|
+
active ? "text-foreground/70" : "text-muted-foreground/50",
|
|
98
|
+
)}
|
|
99
|
+
/>
|
|
100
|
+
) : (
|
|
101
|
+
<SessionStatusIcon active={active} running={running} scheduled={scheduled} />
|
|
102
|
+
)}
|
|
103
|
+
<span
|
|
104
|
+
className={cn(
|
|
105
|
+
"min-w-0 flex-1 truncate text-[13px]",
|
|
106
|
+
running && "pl-1",
|
|
107
|
+
active ? "font-semibold text-foreground" : "text-foreground",
|
|
108
|
+
)}
|
|
109
|
+
>
|
|
110
|
+
{label}
|
|
111
|
+
</span>
|
|
112
|
+
{trailingAvatarUrls && trailingAvatarUrls.length > 0 ? (
|
|
113
|
+
<AvatarStackView avatarUrls={trailingAvatarUrls} />
|
|
114
|
+
) : null}
|
|
115
|
+
</>
|
|
116
|
+
)}
|
|
117
|
+
</button>
|
|
118
|
+
);
|
|
119
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { cn } from "@vetta-org/ui";
|
|
2
|
+
import type { JSX, ReactNode } from "react";
|
|
3
|
+
|
|
4
|
+
export interface SidebarProjectsSectionViewProps {
|
|
5
|
+
className?: string;
|
|
6
|
+
classNames?: {
|
|
7
|
+
list?: string;
|
|
8
|
+
toolbar?: string;
|
|
9
|
+
};
|
|
10
|
+
filterSelect: ReactNode;
|
|
11
|
+
addProjectMenu: ReactNode;
|
|
12
|
+
panel: ReactNode;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function SidebarProjectsSectionView({
|
|
16
|
+
className,
|
|
17
|
+
classNames,
|
|
18
|
+
filterSelect,
|
|
19
|
+
addProjectMenu,
|
|
20
|
+
panel,
|
|
21
|
+
}: SidebarProjectsSectionViewProps): JSX.Element {
|
|
22
|
+
return (
|
|
23
|
+
<div className={cn("flex min-h-0 flex-1 flex-col", className)}>
|
|
24
|
+
{/* Inline z-index keeps the dropdown above the project list below. */}
|
|
25
|
+
<div
|
|
26
|
+
className={cn("group flex items-center justify-between pb-1 pl-2 pr-3 pt-1", classNames?.toolbar)}
|
|
27
|
+
style={{ position: "relative", zIndex: 20 }}
|
|
28
|
+
>
|
|
29
|
+
{filterSelect}
|
|
30
|
+
{addProjectMenu}
|
|
31
|
+
</div>
|
|
32
|
+
{panel}
|
|
33
|
+
</div>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
export type {
|
|
2
|
+
BatchQueueStatusViewLabels,
|
|
3
|
+
BatchQueueStatusViewProps,
|
|
4
|
+
BatchQueueTaskItemView,
|
|
5
|
+
BatchQueueTaskStatus,
|
|
6
|
+
} from "./BatchQueueStatusView";
|
|
7
|
+
export { BatchQueueStatusView } from "./BatchQueueStatusView";
|
|
8
|
+
export type { ConversationTagDotsViewProps } from "./ConversationTagDotsView";
|
|
9
|
+
export { ConversationTagDotsView } from "./ConversationTagDotsView";
|
|
10
|
+
export type {
|
|
11
|
+
ConversationTagEditorDialogViewLabels,
|
|
12
|
+
ConversationTagEditorDialogViewProps,
|
|
13
|
+
ConversationTagEditorTagView,
|
|
14
|
+
} from "./ConversationTagEditorDialogView";
|
|
15
|
+
export { ConversationTagEditorDialogView } from "./ConversationTagEditorDialogView";
|
|
16
|
+
export type {
|
|
17
|
+
DefaultConversationSectionViewLabels,
|
|
18
|
+
DefaultConversationSectionViewProps,
|
|
19
|
+
} from "./DefaultConversationSectionView";
|
|
20
|
+
export { DefaultConversationSectionView } from "./DefaultConversationSectionView";
|
|
21
|
+
export type {
|
|
22
|
+
DefaultSessionListViewItem,
|
|
23
|
+
DefaultSessionListViewLabels,
|
|
24
|
+
DefaultSessionListViewProps,
|
|
25
|
+
} from "./DefaultSessionListView";
|
|
26
|
+
export { DefaultSessionListView } from "./DefaultSessionListView";
|
|
27
|
+
export type { DefaultSessionRowViewProps } from "./DefaultSessionRowView";
|
|
28
|
+
export { DefaultSessionRowView } from "./DefaultSessionRowView";
|
|
29
|
+
export type {
|
|
30
|
+
NewProjectDialogViewLabels,
|
|
31
|
+
NewProjectDialogViewProps,
|
|
32
|
+
} from "./NewProjectDialogView";
|
|
33
|
+
export { NewProjectDialogView } from "./NewProjectDialogView";
|
|
34
|
+
export type {
|
|
35
|
+
ProjectContextMenuScope,
|
|
36
|
+
ProjectContextMenuViewLabels,
|
|
37
|
+
ProjectContextMenuViewProps,
|
|
38
|
+
} from "./ProjectContextMenuView";
|
|
39
|
+
export { ProjectContextMenuView } from "./ProjectContextMenuView";
|
|
40
|
+
export type {
|
|
41
|
+
ProjectDetailPageViewLabels,
|
|
42
|
+
ProjectDetailPageViewProps,
|
|
43
|
+
ProjectDetailSaveStatus,
|
|
44
|
+
} from "./ProjectDetailPageView";
|
|
45
|
+
export { ProjectDetailPageView } from "./ProjectDetailPageView";
|
|
46
|
+
export type { ProjectGroupViewProps } from "./ProjectGroupView";
|
|
47
|
+
export { ProjectGroupView } from "./ProjectGroupView";
|
|
48
|
+
export type { ProjectRowViewProps } from "./ProjectRowView";
|
|
49
|
+
export { ProjectRowView } from "./ProjectRowView";
|
|
50
|
+
export { ProjectSessionsLoadingView } from "./ProjectSessionsLoadingView";
|
|
51
|
+
export type {
|
|
52
|
+
ProjectSessionsViewItem,
|
|
53
|
+
ProjectSessionsViewLabels,
|
|
54
|
+
ProjectSessionsViewProps,
|
|
55
|
+
} from "./ProjectSessionsView";
|
|
56
|
+
export { ProjectSessionsView } from "./ProjectSessionsView";
|
|
57
|
+
export { ProjectsLoadingView } from "./ProjectsLoadingView";
|
|
58
|
+
export type { ProjectsPanelMenusViewProps } from "./ProjectsPanelMenusView";
|
|
59
|
+
export { ProjectsPanelMenusView } from "./ProjectsPanelMenusView";
|
|
60
|
+
export type { ProjectsPanelViewProps } from "./ProjectsPanelView";
|
|
61
|
+
export { ProjectsPanelView } from "./ProjectsPanelView";
|
|
62
|
+
export type { QuickScrollLabels, QuickScrollOverlayProps } from "./QuickScrollOverlay";
|
|
63
|
+
export { QuickScrollOverlay } from "./QuickScrollOverlay";
|
|
64
|
+
export type {
|
|
65
|
+
ScheduleStatusViewLabels,
|
|
66
|
+
ScheduleStatusViewProps,
|
|
67
|
+
ScheduleTaskItemView,
|
|
68
|
+
} from "./ScheduleStatusView";
|
|
69
|
+
export { ScheduleStatusView } from "./ScheduleStatusView";
|
|
70
|
+
export type {
|
|
71
|
+
SessionContextMenuViewLabels,
|
|
72
|
+
SessionContextMenuViewProps,
|
|
73
|
+
} from "./SessionContextMenuView";
|
|
74
|
+
export { SessionContextMenuView } from "./SessionContextMenuView";
|
|
75
|
+
export type { SessionRenameInputViewProps } from "./SessionRenameInputView";
|
|
76
|
+
export { SessionRenameInputView } from "./SessionRenameInputView";
|
|
77
|
+
export type { SessionRowViewProps } from "./SessionRowView";
|
|
78
|
+
export { SessionRowView } from "./SessionRowView";
|
|
79
|
+
export type { SidebarProjectsSectionViewProps } from "./SidebarProjectsSectionView";
|
|
80
|
+
export { SidebarProjectsSectionView } from "./SidebarProjectsSectionView";
|
|
81
|
+
export type { ProjectSessionRowItem, ProjectTypeIconKey } from "./types";
|
|
82
|
+
export {
|
|
83
|
+
DEFAULT_VISIBLE_SESSIONS,
|
|
84
|
+
PROJECT_TYPE_ICONS,
|
|
85
|
+
VIRTUAL_SESSION_OVERSCAN,
|
|
86
|
+
VIRTUAL_SESSION_ROW_HEIGHT,
|
|
87
|
+
} from "./types";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** Plain session row data for project sidebar views (host maps domain types). */
|
|
2
|
+
export interface ProjectSessionRowItem {
|
|
3
|
+
path: string;
|
|
4
|
+
label: string;
|
|
5
|
+
active: boolean;
|
|
6
|
+
renaming: boolean;
|
|
7
|
+
running: boolean;
|
|
8
|
+
scheduled: boolean;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export type ProjectTypeIconKey = "normal" | "flowing" | "batch";
|
|
12
|
+
|
|
13
|
+
export const PROJECT_TYPE_ICONS: Record<ProjectTypeIconKey, string> = {
|
|
14
|
+
normal: "icon-[solar--folder-linear]",
|
|
15
|
+
flowing: "icon-[solar--transfer-horizontal-linear]",
|
|
16
|
+
batch: "icon-[solar--layers-minimalistic-linear]",
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const DEFAULT_VISIBLE_SESSIONS = 5;
|
|
20
|
+
export const VIRTUAL_SESSION_ROW_HEIGHT = 34;
|
|
21
|
+
export const VIRTUAL_SESSION_OVERSCAN = 120;
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { type RefObject, useEffect, useRef } from "react";
|
|
2
|
+
import type { VirtuosoHandle } from "react-virtuoso";
|
|
3
|
+
import { VIRTUAL_SESSION_ROW_HEIGHT } from "./types";
|
|
4
|
+
|
|
5
|
+
const SAFE_ZONE_TOP_RATIO = 1 / 3;
|
|
6
|
+
const SAFE_ZONE_BOTTOM_RATIO = 2 / 3;
|
|
7
|
+
const MIN_SCROLL_RANGE = VIRTUAL_SESSION_ROW_HEIGHT;
|
|
8
|
+
const MIN_SCROLL_DELTA = VIRTUAL_SESSION_ROW_HEIGHT / 2;
|
|
9
|
+
const LAYOUT_SETTLE_DELAY_MS = 370;
|
|
10
|
+
|
|
11
|
+
type ScrollAdjustment = "moved" | "stable" | "unavailable";
|
|
12
|
+
|
|
13
|
+
interface ActiveSessionAutoScrollOptions {
|
|
14
|
+
activeIndex: number;
|
|
15
|
+
activeKey: string | undefined;
|
|
16
|
+
enabled?: boolean;
|
|
17
|
+
scrollParent: HTMLElement | null;
|
|
18
|
+
virtuosoRef: RefObject<VirtuosoHandle | null>;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
interface ExpandedProjectAutoScrollOptions {
|
|
22
|
+
expanded: boolean;
|
|
23
|
+
projectRowRef: RefObject<HTMLElement | null>;
|
|
24
|
+
scrollParent: HTMLElement | null;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function prefersReducedMotion(): boolean {
|
|
28
|
+
return window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function hasUsefulScrollRange(scrollParent: HTMLElement): boolean {
|
|
32
|
+
return scrollParent.scrollHeight - scrollParent.clientHeight > MIN_SCROLL_RANGE;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function scrollElementIntoSafeZone(scrollParent: HTMLElement, element: HTMLElement): ScrollAdjustment {
|
|
36
|
+
if (!hasUsefulScrollRange(scrollParent)) return "unavailable";
|
|
37
|
+
const containerRect = scrollParent.getBoundingClientRect();
|
|
38
|
+
const rowRect = element.getBoundingClientRect();
|
|
39
|
+
const viewportHeight = containerRect.height;
|
|
40
|
+
const rowCenter = rowRect.top - containerRect.top + rowRect.height / 2;
|
|
41
|
+
const safeTop = viewportHeight * SAFE_ZONE_TOP_RATIO;
|
|
42
|
+
const safeBottom = viewportHeight * SAFE_ZONE_BOTTOM_RATIO;
|
|
43
|
+
if (rowCenter >= safeTop && rowCenter <= safeBottom) return "stable";
|
|
44
|
+
|
|
45
|
+
const delta = rowCenter - safeTop;
|
|
46
|
+
if (Math.abs(delta) <= MIN_SCROLL_DELTA) return "stable";
|
|
47
|
+
|
|
48
|
+
const maxScrollTop = Math.max(0, scrollParent.scrollHeight - scrollParent.clientHeight);
|
|
49
|
+
const targetTop = Math.min(maxScrollTop, Math.max(0, scrollParent.scrollTop + delta));
|
|
50
|
+
if (Math.abs(targetTop - scrollParent.scrollTop) <= MIN_SCROLL_DELTA) return "stable";
|
|
51
|
+
|
|
52
|
+
scrollParent.scrollTo({
|
|
53
|
+
top: targetTop,
|
|
54
|
+
behavior: prefersReducedMotion() ? "auto" : "smooth",
|
|
55
|
+
});
|
|
56
|
+
return "moved";
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function scrollMountedActiveRow(scrollParent: HTMLElement): boolean {
|
|
60
|
+
const activeRow = scrollParent.querySelector<HTMLElement>('[data-session-active="true"]');
|
|
61
|
+
return activeRow ? scrollElementIntoSafeZone(scrollParent, activeRow) !== "unavailable" : false;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* 点击时把行滚进安全区。**不阻塞导航**:滚动动画和 `openSession` 并行跑。
|
|
66
|
+
*
|
|
67
|
+
* 这里原本会返回一个「等滚动结束」的 Promise,调用方 `Promise.all` 完它(再叠加一个
|
|
68
|
+
* 「等面板 max-height 过渡结束」的 Promise)之后才发起会话切换,fallback 分别是 800ms
|
|
69
|
+
* 与 450ms。于是点一个不在列表中间的会话,切换要先干等几百毫秒才开始——而 openSession
|
|
70
|
+
* 内部本来已经做了「拿到 sessionId 就写 activeSession + navigate」的优化,全被这段等待抵消。
|
|
71
|
+
* 低配机上平滑滚动更慢、掉帧还可能收不到 scrollend / transitionend,直接吃满 fallback。
|
|
72
|
+
*
|
|
73
|
+
* 连点由 openSession 自己的 token 机制去重,不需要这里再排队。
|
|
74
|
+
*/
|
|
75
|
+
export function prepareSidebarSelection(element: HTMLElement): void {
|
|
76
|
+
const scrollParent = element.closest<HTMLElement>('[data-sidebar-selection-scroll="true"]');
|
|
77
|
+
if (!scrollParent) return;
|
|
78
|
+
scrollElementIntoSafeZone(scrollParent, element);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** Scrolls a newly expanded project row only when it falls outside the shared safety band. */
|
|
82
|
+
export function useExpandedProjectAutoScroll({
|
|
83
|
+
expanded,
|
|
84
|
+
projectRowRef,
|
|
85
|
+
scrollParent,
|
|
86
|
+
}: ExpandedProjectAutoScrollOptions): void {
|
|
87
|
+
const wasExpandedRef = useRef(expanded);
|
|
88
|
+
|
|
89
|
+
useEffect(() => {
|
|
90
|
+
if (!expanded) {
|
|
91
|
+
wasExpandedRef.current = false;
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
if (wasExpandedRef.current || !scrollParent) return;
|
|
95
|
+
wasExpandedRef.current = true;
|
|
96
|
+
|
|
97
|
+
let firstFrame = 0;
|
|
98
|
+
let secondFrame = 0;
|
|
99
|
+
let settleTimer = 0;
|
|
100
|
+
let cancelled = false;
|
|
101
|
+
const ensureProjectVisible = () => {
|
|
102
|
+
if (cancelled || !projectRowRef.current) return;
|
|
103
|
+
scrollElementIntoSafeZone(scrollParent, projectRowRef.current);
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
firstFrame = requestAnimationFrame(() => {
|
|
107
|
+
secondFrame = requestAnimationFrame(ensureProjectVisible);
|
|
108
|
+
});
|
|
109
|
+
settleTimer = window.setTimeout(ensureProjectVisible, LAYOUT_SETTLE_DELAY_MS);
|
|
110
|
+
|
|
111
|
+
return () => {
|
|
112
|
+
cancelled = true;
|
|
113
|
+
cancelAnimationFrame(firstFrame);
|
|
114
|
+
cancelAnimationFrame(secondFrame);
|
|
115
|
+
window.clearTimeout(settleTimer);
|
|
116
|
+
};
|
|
117
|
+
}, [expanded, projectRowRef, scrollParent]);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Keeps a newly selected session inside the middle safety band of its scroll viewport.
|
|
122
|
+
* Tiny scroll ranges and corrections are intentionally ignored to avoid distracting micro-movements.
|
|
123
|
+
*/
|
|
124
|
+
export function useActiveSessionAutoScroll({
|
|
125
|
+
activeIndex,
|
|
126
|
+
activeKey,
|
|
127
|
+
enabled = true,
|
|
128
|
+
scrollParent,
|
|
129
|
+
virtuosoRef,
|
|
130
|
+
}: ActiveSessionAutoScrollOptions): void {
|
|
131
|
+
const handledActiveKeyRef = useRef<string | null>(null);
|
|
132
|
+
|
|
133
|
+
useEffect(() => {
|
|
134
|
+
if (!activeKey) {
|
|
135
|
+
handledActiveKeyRef.current = null;
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
if (!enabled || !scrollParent || activeIndex < 0 || handledActiveKeyRef.current === activeKey) return;
|
|
139
|
+
handledActiveKeyRef.current = activeKey;
|
|
140
|
+
|
|
141
|
+
let firstFrame = 0;
|
|
142
|
+
let secondFrame = 0;
|
|
143
|
+
let settleTimer = 0;
|
|
144
|
+
let cancelled = false;
|
|
145
|
+
|
|
146
|
+
const ensureVisible = () => {
|
|
147
|
+
if (cancelled || !hasUsefulScrollRange(scrollParent)) return;
|
|
148
|
+
if (scrollMountedActiveRow(scrollParent)) return;
|
|
149
|
+
|
|
150
|
+
const viewportHeight = scrollParent.clientHeight;
|
|
151
|
+
virtuosoRef.current?.scrollToIndex({
|
|
152
|
+
index: activeIndex,
|
|
153
|
+
align: "start",
|
|
154
|
+
offset: -(viewportHeight * SAFE_ZONE_TOP_RATIO - VIRTUAL_SESSION_ROW_HEIGHT / 2),
|
|
155
|
+
behavior: prefersReducedMotion() ? "auto" : "smooth",
|
|
156
|
+
});
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
firstFrame = requestAnimationFrame(() => {
|
|
160
|
+
secondFrame = requestAnimationFrame(ensureVisible);
|
|
161
|
+
});
|
|
162
|
+
settleTimer = window.setTimeout(ensureVisible, LAYOUT_SETTLE_DELAY_MS);
|
|
163
|
+
|
|
164
|
+
return () => {
|
|
165
|
+
cancelled = true;
|
|
166
|
+
cancelAnimationFrame(firstFrame);
|
|
167
|
+
cancelAnimationFrame(secondFrame);
|
|
168
|
+
window.clearTimeout(settleTimer);
|
|
169
|
+
};
|
|
170
|
+
}, [activeIndex, activeKey, enabled, scrollParent, virtuosoRef]);
|
|
171
|
+
}
|
package/src/registry.ts
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { ThemeSurfaceConfig } from "@vetta-org/theme-sdk";
|
|
2
|
+
import type { ComponentType } from "react";
|
|
3
|
+
|
|
4
|
+
declare module "@vetta-org/theme-sdk" {
|
|
5
|
+
interface ThemeComponentRegistry {
|
|
6
|
+
readonly "app.mainContentBackground"?: ComponentType;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
interface ThemeSurfaceRegistry {
|
|
10
|
+
readonly "activity.panel"?: ThemeSurfaceConfig;
|
|
11
|
+
readonly "app.frame"?: ThemeSurfaceConfig;
|
|
12
|
+
readonly "app.frameOverlay"?: ThemeSurfaceConfig;
|
|
13
|
+
readonly "app.pageHeader"?: ThemeSurfaceConfig;
|
|
14
|
+
readonly "app.windowControls"?: ThemeSurfaceConfig;
|
|
15
|
+
readonly "chat.atPanel"?: ThemeSurfaceConfig;
|
|
16
|
+
readonly "chat.assistantMessage"?: ThemeSurfaceConfig;
|
|
17
|
+
readonly "chat.executionModeMenu"?: ThemeSurfaceConfig;
|
|
18
|
+
readonly "chat.inputActionBar"?: ThemeSurfaceConfig;
|
|
19
|
+
readonly "chat.inputBar"?: ThemeSurfaceConfig;
|
|
20
|
+
readonly "chat.inputBarToolbarLeft"?: ThemeSurfaceConfig;
|
|
21
|
+
readonly "chat.inputBarToolbarRight"?: ThemeSurfaceConfig;
|
|
22
|
+
readonly "chat.sendButton"?: ThemeSurfaceConfig;
|
|
23
|
+
readonly "chat.inputDrawer"?: ThemeSurfaceConfig;
|
|
24
|
+
readonly "chat.modelSelectorMenu"?: ThemeSurfaceConfig;
|
|
25
|
+
readonly "chat.modelSelectorReasoningMenu"?: ThemeSurfaceConfig;
|
|
26
|
+
readonly "chat.newSessionGuidingWords"?: ThemeSurfaceConfig;
|
|
27
|
+
readonly "chat.newSessionPage"?: ThemeSurfaceConfig;
|
|
28
|
+
readonly "chat.newSessionSceneCard"?: ThemeSurfaceConfig;
|
|
29
|
+
readonly "chat.newSessionSkillCard"?: ThemeSurfaceConfig;
|
|
30
|
+
readonly "chat.projectSelectorMenu"?: ThemeSurfaceConfig;
|
|
31
|
+
readonly "chat.questionPanel"?: ThemeSurfaceConfig;
|
|
32
|
+
readonly "chat.sessionViewerPage"?: ThemeSurfaceConfig;
|
|
33
|
+
readonly "chat.slashPanel"?: ThemeSurfaceConfig;
|
|
34
|
+
readonly "chat.todoPanel"?: ThemeSurfaceConfig;
|
|
35
|
+
readonly "chat.view"?: ThemeSurfaceConfig;
|
|
36
|
+
readonly "root.approval.appearance.panel"?: ThemeSurfaceConfig;
|
|
37
|
+
readonly "root.approval.batchTasks.panel"?: ThemeSurfaceConfig;
|
|
38
|
+
readonly "root.approval.manage.panel"?: ThemeSurfaceConfig;
|
|
39
|
+
readonly "root.approval.navigationOpen.panel"?: ThemeSurfaceConfig;
|
|
40
|
+
readonly "root.approval.schedulerAction.panel"?: ThemeSurfaceConfig;
|
|
41
|
+
readonly "root.approval.schedulerEdit.panel"?: ThemeSurfaceConfig;
|
|
42
|
+
readonly "root.commandMenu.panel"?: ThemeSurfaceConfig;
|
|
43
|
+
readonly "root.confirmDialog.panel"?: ThemeSurfaceConfig;
|
|
44
|
+
readonly "root.filePreviewDialog"?: ThemeSurfaceConfig;
|
|
45
|
+
readonly "root.filePreviewDialog.panel"?: ThemeSurfaceConfig;
|
|
46
|
+
readonly "root.flowingSendDialog.panel"?: ThemeSurfaceConfig;
|
|
47
|
+
readonly "root.genericActionApproval.panel"?: ThemeSurfaceConfig;
|
|
48
|
+
readonly "root.knowledgeDropOverlay"?: ThemeSurfaceConfig;
|
|
49
|
+
readonly "root.loginDialog.panel"?: ThemeSurfaceConfig;
|
|
50
|
+
readonly "root.updateRestartDialog.panel"?: ThemeSurfaceConfig;
|
|
51
|
+
readonly "root.workflowCompleteDialog.panel"?: ThemeSurfaceConfig;
|
|
52
|
+
readonly "settings.pageContent"?: ThemeSurfaceConfig;
|
|
53
|
+
readonly "sidebar.bottomBar"?: ThemeSurfaceConfig;
|
|
54
|
+
readonly "sidebar.messageCenter"?: ThemeSurfaceConfig;
|
|
55
|
+
readonly "sidebar.navigation"?: ThemeSurfaceConfig;
|
|
56
|
+
readonly "sidebar.navigationIndicator"?: ThemeSurfaceConfig;
|
|
57
|
+
readonly "sidebar.panel"?: ThemeSurfaceConfig;
|
|
58
|
+
readonly "sidebar.projects"?: ThemeSurfaceConfig;
|
|
59
|
+
readonly "sidebar.settingsMenu"?: ThemeSurfaceConfig;
|
|
60
|
+
readonly "sidebar.topBar"?: ThemeSurfaceConfig;
|
|
61
|
+
}
|
|
62
|
+
}
|