@vetta-org/theme-ui 0.1.1 → 0.2.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 +740 -20
- package/src/action-approval/AppearanceActionPickerView.tsx +2 -78
- package/src/action-approval/AppearanceApprovalDrawerView.tsx +2 -9
- package/src/action-approval/BatchTasksApprovalFrameView.tsx +4 -1
- package/src/action-approval/GenericActionApprovalView.tsx +2 -9
- package/src/action-approval/ManageActionApprovalFrameView.tsx +4 -1
- package/src/action-approval/NavigationOpenApprovalView.tsx +2 -9
- package/src/action-approval/SchedulerActionApprovalDialogView.tsx +3 -1
- package/src/action-approval/SchedulerEditApprovalDrawerView.tsx +3 -10
- package/src/action-approval/index.ts +0 -1
- package/src/activity/ActivityPanel.tsx +13 -10
- package/src/activity/ActivityPanelFrame.test.tsx +32 -0
- package/src/activity/ActivityPanelFrame.tsx +3 -2
- package/src/activity/BackgroundTasksTabPanelView.tsx +1 -1
- package/src/activity/BrowserPanelView.tsx +48 -49
- package/src/activity/CodePreview.tsx +15 -1
- package/src/activity/DebugTabPanelView.tsx +1 -1
- package/src/activity/MarkdownPreviewView.test.tsx +53 -0
- package/src/activity/MarkdownPreviewView.tsx +135 -62
- package/src/activity/PluginTabPickerView.tsx +5 -3
- package/src/activity/PortsTabPanelView.tsx +911 -0
- package/src/activity/ToolCallsSubTabView.tsx +1 -1
- package/src/activity/WorkflowTabPanelView.tsx +1 -1
- package/src/activity/index.ts +9 -0
- package/src/app/AppBackground.tsx +1 -1
- package/src/app/AppBootLoadingView.tsx +4 -2
- package/src/app-shell/DefaultWindowControls.tsx +1 -1
- package/src/app-shell/PageHeaderActionGroup.tsx +1 -1
- package/src/app-shell/PageHeaderContent.tsx +36 -7
- package/src/app-shell/PageHeaderFrame.tsx +15 -3
- package/src/app-shell/PageHeaderSidebarTrigger.tsx +1 -1
- package/src/app-shell/PageHeaderTitle.tsx +1 -1
- package/src/app-shell/WindowControlButton.tsx +1 -1
- package/src/app-shell/header-crowding.test.ts +62 -0
- package/src/app-shell/header-crowding.tsx +137 -0
- package/src/appearance/BackgroundImageFrame.tsx +1 -1
- package/src/appearance/CenterSliceImageFrame.tsx +1 -1
- package/src/appearance/CornerImageFrame.tsx +1 -1
- package/src/appearance/HorizontalSliceImageFrame.tsx +1 -1
- package/src/appearance/NineSliceImageFrame.tsx +1 -1
- package/src/appearance/ThemeSurface.tsx +1 -1
- package/src/batch-tasks/BatchProjectFoldersFieldView.tsx +2 -1
- package/src/batch-tasks/BatchTaskProjectActionsView.test.tsx +97 -0
- package/src/batch-tasks/BatchTaskProjectActionsView.tsx +45 -35
- package/src/batch-tasks/batchTaskUi.tsx +0 -29
- package/src/bottom-panel/BottomPanelView.test.tsx +43 -0
- package/src/bottom-panel/BottomPanelView.tsx +222 -0
- package/src/bottom-panel/index.ts +26 -0
- package/src/chat/AgentAvatarView.tsx +1 -1
- package/src/chat/AnnotationViews.tsx +107 -0
- package/src/chat/AskUserQuestionView.tsx +18 -11
- package/src/chat/AssistantMessageView.tsx +48 -13
- package/src/chat/AtPanelView.test.tsx +61 -0
- package/src/chat/AtPanelView.tsx +63 -38
- package/src/chat/BashTerminalCard.tsx +1 -2
- package/src/chat/ChatHeaderActionsView.tsx +74 -18
- package/src/chat/CompactionStepView.test.tsx +34 -0
- package/src/chat/CompactionStepView.tsx +85 -0
- package/src/chat/ContextRingView.test.tsx +81 -0
- package/src/chat/ContextRingView.tsx +78 -62
- package/src/chat/ExecutionModeSelectorView.tsx +20 -5
- package/src/chat/HeaderActionBarView.tsx +806 -0
- package/src/chat/HeaderActionOverflowMenu.tsx +128 -0
- package/src/chat/InlineModelPicker.test.tsx +81 -0
- package/src/chat/InlineModelPicker.tsx +201 -0
- package/src/chat/InlineTokenChip.tsx +2 -68
- package/src/chat/InputBarBackground.tsx +1 -1
- package/src/chat/InputBarPlaceholder.tsx +26 -3
- package/src/chat/LiveThinkingView.tsx +51 -37
- package/src/chat/MessageBoundaryViews.tsx +21 -0
- package/src/chat/MessageFeedContext.tsx +13 -5
- package/src/chat/MessageFeedLayoutView.tsx +29 -3
- package/src/chat/MessageFeedView.test.tsx +81 -0
- package/src/chat/MessageFeedView.tsx +72 -152
- package/src/chat/MessageInputView.tsx +6 -2
- package/src/chat/MessageLayoutView.tsx +1 -1
- package/src/chat/MessageSelectionContextMenuView.tsx +4 -1
- package/src/chat/MessageTimelineView.tsx +1 -1
- package/src/chat/MessageView.tsx +1 -1
- package/src/chat/MessageVisualView.tsx +1 -1
- package/src/chat/ModelConfiguration.tsx +283 -0
- package/src/chat/ModelSelectorTrigger.tsx +63 -0
- package/src/chat/ModelSelectorView.tsx +1037 -223
- package/src/chat/NewSession.ts +1 -37
- package/src/chat/NewSessionPicker.tsx +3 -2
- package/src/chat/ProjectSelectorView.tsx +3 -2
- package/src/chat/ReasoningStepSlider.tsx +61 -0
- package/src/chat/RemoteSessionBadgeView.tsx +24 -0
- package/src/chat/SkillPromptAreaView.tsx +5 -19
- package/src/chat/TeamMemberReplyCardView.test.tsx +33 -0
- package/src/chat/TeamMemberReplyCardView.tsx +133 -0
- package/src/chat/TextBlockView.tsx +7 -770
- package/src/chat/TodoProgress.tsx +25 -53
- package/src/chat/TodoStatusBarView.tsx +14 -5
- package/src/chat/UserMessageView.tsx +113 -33
- package/src/chat/header-action-narrow.test.ts +21 -0
- package/src/chat/header-action-narrow.ts +38 -0
- package/src/chat/index.ts +33 -27
- package/src/chat/markdown-link.ts +7 -279
- package/src/chat/message-feed-fade.css +80 -0
- package/src/chat/message-feed-fade.test.tsx +75 -0
- package/src/chat/send-button.css +4 -22
- package/src/chat/streaming-reveal.test.ts +218 -0
- package/src/chat/streaming-reveal.ts +13 -0
- package/src/file-explorer/ConfirmDeleteDialogView.tsx +2 -1
- package/src/file-explorer/FileContextMenuView.tsx +44 -11
- package/src/file-explorer/FileExplorerSettingsView.tsx +97 -0
- package/src/file-explorer/FileTreeCreateRow.tsx +1 -1
- package/src/file-explorer/FileTreeNodeView.tsx +59 -18
- package/src/file-explorer/FileTreeView.tsx +236 -129
- package/src/file-explorer/file-tree-dom.ts +23 -0
- package/src/file-explorer/file-tree-rows.test.ts +74 -0
- package/src/file-explorer/file-tree-rows.ts +168 -0
- package/src/file-explorer/index.ts +17 -0
- package/src/file-explorer/types.ts +3 -0
- package/src/file-explorer/useFileTreeMarqueeSelection.ts +24 -16
- package/src/file-preview/FilePreviewDialogView.tsx +2 -2
- package/src/file-preview/FilePreviewView.tsx +12 -2
- package/src/file-preview/ReadonlyCodeView.tsx +46 -0
- package/src/file-preview/TextFileEditorView.tsx +2 -1
- package/src/file-preview/syntax-tokens.css +1 -1
- package/src/image-assets.d.ts +4 -0
- package/src/index.ts +1 -0
- package/src/knowledge/KnowledgeHowItWorksDialogView.tsx +1 -1
- package/src/layout/AppFrame.tsx +3 -2
- package/src/layout/MainContentFrame.tsx +7 -2
- package/src/layout/ResizeHandle.tsx +68 -17
- package/src/layout/SidebarDock.tsx +75 -19
- package/src/layout/SidebarOverlay.tsx +1 -1
- package/src/layout/index.ts +1 -1
- package/src/layout/resize-handle-axis.test.ts +51 -0
- package/src/live-indicators.test.ts +43 -0
- package/src/markdown/CodeBlock.tsx +123 -0
- package/src/markdown/FileLinkBadge.tsx +77 -0
- package/src/markdown/InlineTokenChip.tsx +68 -0
- package/src/markdown/MarkdownContent.tsx +418 -0
- package/src/markdown/MarkdownImage.tsx +41 -0
- package/src/markdown/MathFormula.tsx +46 -0
- package/src/markdown/MermaidBlock.tsx +82 -0
- package/src/markdown/RichCodeBlock.tsx +127 -0
- package/src/markdown/SvgPreview.tsx +45 -0
- package/src/markdown/WebsiteIcon.tsx +94 -0
- package/src/markdown/builtin-renderers.tsx +43 -0
- package/src/markdown/definition.tsx +49 -0
- package/src/markdown/host.tsx +18 -0
- package/src/markdown/image-actions.ts +29 -0
- package/src/markdown/index.ts +12 -0
- package/src/markdown/inline-tokens.ts +187 -0
- package/src/markdown/markdown-link.ts +279 -0
- package/src/markdown/math-client.ts +116 -0
- package/src/markdown/math-render.ts +23 -0
- package/src/markdown/math-syntax.ts +80 -0
- package/src/markdown/math.worker.ts +16 -0
- package/src/markdown/nodes.ts +15 -0
- package/src/markdown/preview-policy.test.ts +31 -0
- package/src/markdown/preview-policy.ts +76 -0
- package/src/markdown/progressive-chunks.test.ts +43 -0
- package/src/markdown/progressive-chunks.ts +58 -0
- package/src/markdown/rich-labels.ts +55 -0
- package/src/markdown/rich-syntax.ts +93 -0
- package/src/markdown/stable-blocks.test.ts +90 -0
- package/src/markdown/stable-blocks.ts +124 -0
- package/src/markdown/streaming-reveal.ts +297 -0
- package/src/markdown/streaming.test.ts +57 -0
- package/src/markdown/streaming.ts +211 -0
- package/src/markdown/use-render-snapshot.ts +24 -0
- package/src/markdown/use-rich-visibility.ts +24 -0
- package/src/overlays/CommandMenuRow.tsx +77 -17
- package/src/overlays/CommandMenuView.tsx +163 -118
- package/src/overlays/ConfirmDialogView.tsx +25 -20
- package/src/overlays/DiagnosticsExportDialogView.tsx +236 -0
- package/src/overlays/MagpieHandoverDialogView.tsx +217 -0
- package/src/overlays/ReleaseNoteMarkdown.test.tsx +24 -0
- package/src/overlays/ReleaseNoteMarkdown.tsx +55 -0
- package/src/overlays/SplashOptionRow.tsx +46 -0
- package/src/overlays/SplashPanel.tsx +85 -0
- package/src/overlays/SplashParts.tsx +217 -0
- package/src/overlays/UpdateCheckerView.tsx +34 -18
- package/src/overlays/UpdateRestartDialogView.tsx +203 -53
- package/src/overlays/assets/diagnostics-banner.webp +0 -0
- package/src/overlays/command-menu-types.ts +15 -1
- package/src/overlays/command-menu.css +1 -20
- package/src/overlays/index.ts +26 -1
- package/src/plugin-ui/index.ts +10 -0
- package/src/project/ConversationTagDotsView.tsx +1 -1
- package/src/project/ConversationTagEditorDialogView.tsx +4 -1
- package/src/project/DefaultConversationSectionView.tsx +15 -24
- package/src/project/DefaultSessionListView.tsx +5 -31
- package/src/project/DefaultSessionRowView.tsx +114 -55
- package/src/project/ManageSessionsSplashView.tsx +439 -0
- package/src/project/NewProjectDialogView.tsx +3 -10
- package/src/project/ProjectContextMenuView.tsx +30 -139
- package/src/project/ProjectDetailPageView.test.tsx +140 -0
- package/src/project/ProjectDetailPageView.tsx +372 -165
- package/src/project/ProjectGroupView.tsx +1 -1
- package/src/project/ProjectRowView.tsx +29 -12
- package/src/project/ProjectSessionsView.tsx +25 -47
- package/src/project/QuickScrollOverlay.tsx +1 -1
- package/src/project/SessionContextMenuView.tsx +15 -7
- package/src/project/SessionRowMoreButton.tsx +50 -0
- package/src/project/SessionRowView.tsx +106 -63
- package/src/project/SessionTitleMarquee.tsx +54 -0
- package/src/project/SidebarProjectDisclosure.tsx +60 -0
- package/src/project/SidebarProjectsSectionView.tsx +6 -1
- package/src/project/index.ts +12 -0
- package/src/project/session-row-transition.ts +9 -0
- package/src/project/types.ts +4 -2
- package/src/project/useActiveSessionAutoScroll.ts +10 -4
- package/src/registry.ts +0 -2
- package/src/scheduler/AutomationDetailPaneView.tsx +68 -0
- package/src/scheduler/AutomationPageView.tsx +118 -121
- package/src/scheduler/ExecutionHistoryView.tsx +7 -5
- package/src/scheduler/TaskListView.tsx +52 -201
- package/src/scheduler/index.ts +7 -12
- package/src/settings/AppshotSettingsView.tsx +0 -1
- package/src/settings/ArchivedProjectsSettingsView.tsx +122 -1
- package/src/settings/BuiltinMcpSectionView.tsx +1 -1
- package/src/settings/EnvironmentGitRowView.tsx +156 -0
- package/src/settings/EnvironmentSettingsView.tsx +25 -3
- package/src/settings/GeneralSettingsView.tsx +18 -24
- package/src/settings/ImChannelGuideDialogView.tsx +2 -2
- package/src/settings/ImFeishuDialogView.tsx +1 -1
- package/src/settings/ImLegacyImportBannerView.tsx +1 -1
- package/src/settings/ImLogDrawerView.tsx +2 -1
- package/src/settings/JsonConfigInputView.tsx +171 -0
- package/src/settings/LauncherSettingsView.test.tsx +95 -0
- package/src/settings/LauncherSettingsView.tsx +273 -0
- package/src/settings/ModelsFetchedModelsDrawerView.tsx +292 -0
- package/src/settings/ModelsProvidersSectionView.tsx +26 -23
- package/src/settings/MotionSelect.tsx +9 -7
- package/src/settings/NotificationSettingsView.tsx +79 -0
- package/src/settings/PermissionsSettingsView.tsx +3 -7
- package/src/settings/PetActionGalleryView.test.tsx +163 -0
- package/src/settings/PetActionGalleryView.tsx +216 -0
- package/src/settings/PetSettingsView.test.tsx +117 -0
- package/src/settings/PetSettingsView.tsx +86 -22
- package/src/settings/PresetProviderModelsListView.tsx +141 -24
- package/src/settings/PresetProviderRowView.tsx +147 -185
- package/src/settings/ProxySettingsSectionView.tsx +182 -0
- package/src/settings/QrBindDialogView.tsx +1 -1
- package/src/settings/RemoteMcpSectionView.tsx +1 -1
- package/src/settings/SettingChrome.tsx +2 -2
- package/src/settings/SettingsAiAssistButtonView.tsx +9 -119
- package/src/settings/SettingsFormFields.tsx +4 -7
- package/src/settings/SettingsSidebarView.tsx +64 -3
- package/src/settings/ShortcutRecorderView.test.tsx +108 -0
- package/src/settings/ShortcutRecorderView.tsx +15 -9
- package/src/settings/ShortcutsSettingsView.tsx +1 -5
- package/src/settings/SpaceEditorDialogView.tsx +158 -0
- package/src/settings/SpacesSettingsView.tsx +150 -0
- package/src/settings/WebhookEndpointListView.tsx +4 -5
- package/src/settings/assets/space-editor-illustration.webp +0 -0
- package/src/settings/index.ts +59 -68
- package/src/shared/ActivityStatusDot.tsx +69 -0
- package/src/shared/AvatarStackView.tsx +13 -13
- package/src/shared/BotAvatar.tsx +11 -9
- package/src/shared/CodeBlockCopyButton.tsx +1 -1
- package/src/shared/ContextMenuView.tsx +4 -11
- package/src/shared/MarkdownTable.tsx +2 -2
- package/src/shared/SegmentedControl.test.tsx +68 -0
- package/src/shared/SegmentedControl.tsx +10 -2
- package/src/shared/SyntaxHighlightedCode.tsx +0 -0
- package/src/shared/TabBar.outline.test.tsx +59 -0
- package/src/shared/TabBar.tsx +23 -18
- package/src/shared/VettaKbd.test.tsx +52 -0
- package/src/shared/VettaKbd.tsx +100 -0
- package/src/shared/connected-tab-outline.test.ts +2 -2
- package/src/shared/connected-tab-outline.ts +2 -1
- package/src/shared/index.ts +7 -0
- package/src/shared/kbd-keys.test.ts +61 -0
- package/src/shared/kbd-keys.ts +253 -0
- package/src/shared/platform.ts +9 -0
- package/src/shared/provider-icon/icons.ts +4 -2
- package/src/shared/provider-icon/index.tsx +1 -1
- package/src/shared/provider-icon/magpie.svg +1 -0
- package/src/sidebar/AddProjectMenuTriggerView.tsx +33 -24
- package/src/sidebar/DefaultSidebar.tsx +3 -1
- package/src/sidebar/MessageCenterDialogView.tsx +3 -2
- package/src/sidebar/MessageCenterEmptyState.tsx +1 -1
- package/src/sidebar/MessageCenterTabs.tsx +1 -1
- package/src/sidebar/MessageCenterToolbarButton.tsx +1 -1
- package/src/sidebar/MessageCenterTriggerView.tsx +2 -2
- package/src/sidebar/ProjectsPanelEmptyState.tsx +26 -7
- package/src/sidebar/SessionStatusIcon.tsx +16 -1
- package/src/sidebar/SettingsMenuThemeSection.tsx +1 -1
- package/src/sidebar/SettingsMenuTriggerView.test.tsx +42 -0
- package/src/sidebar/SettingsMenuTriggerView.tsx +29 -50
- package/src/sidebar/ShowMoreSessionsButton.tsx +1 -1
- package/src/sidebar/SidebarFilterSelectView.tsx +8 -16
- package/src/sidebar/SidebarNavBadgeView.tsx +1 -1
- package/src/sidebar/SidebarNavIcon.tsx +1 -1
- package/src/sidebar/SidebarNavItemButton.tsx +1 -1
- package/src/sidebar/SidebarNavMorePanel.tsx +19 -7
- package/src/sidebar/SidebarNavigation.tsx +24 -15
- package/src/sidebar/SidebarPanel.tsx +11 -2
- package/src/sidebar/SidebarSectionActionButton.test.tsx +91 -0
- package/src/sidebar/SidebarSectionActionButton.tsx +52 -0
- package/src/sidebar/SidebarSectionTriggerLabel.tsx +20 -0
- package/src/sidebar/SidebarTopBar.tsx +10 -7
- package/src/sidebar/WaitingPulseBadge.tsx +19 -0
- package/src/sidebar/index.ts +1 -16
- package/src/skills/index.ts +0 -19
- package/src/skills/skill-icon.tsx +4 -8
- package/src/styles.css +26 -6
- package/src/chat/DefaultSceneCarousel.tsx +0 -113
- package/src/chat/SceneCard.tsx +0 -138
- package/src/scheduler/HistoryDrawerView.tsx +0 -149
- package/src/scheduler/TaskFormDialogView.tsx +0 -60
- package/src/settings/AchievementNavigationButtonView.tsx +0 -90
- package/src/settings/AchievementPromotionDialogView.tsx +0 -91
- package/src/settings/AchievementSettingsView.tsx +0 -44
- package/src/settings/PetBubbleStylePreviewView.tsx +0 -44
- package/src/settings/QuickPanelSettingsSectionView.tsx +0 -66
- package/src/settings/SubscriptionActionsView.tsx +0 -63
- package/src/settings/SubscriptionCardsView.tsx +0 -212
- package/src/settings/TeamDetailView.tsx +0 -148
- package/src/settings/TeamDialogsView.tsx +0 -151
- package/src/settings/TeamListView.tsx +0 -57
- package/src/settings/TeamSettingsView.tsx +0 -51
- package/src/settings/TokenActivityChartView.tsx +0 -286
- package/src/settings/UsageStatsView.tsx +0 -101
- package/src/settings/achievements/AchievementCurtains.tsx +0 -50
- package/src/settings/achievements/AchievementPromotionBadge3D.tsx +0 -350
- package/src/settings/achievements/AchievementPromotionConfetti.tsx +0 -71
- package/src/settings/achievements/AchievementTitle.tsx +0 -52
- package/src/settings/achievements/index.ts +0 -13
- package/src/settings/shouldCloseEmptyApiKeyEditor.test.ts +0 -135
- package/src/settings/shouldCloseEmptyApiKeyEditor.ts +0 -40
- package/src/settings/token-activity.test.ts +0 -195
- package/src/settings/token-activity.ts +0 -320
- package/src/sidebar/AddProjectMenuItem.tsx +0 -21
- package/src/sidebar/AddProjectMenuPopoverView.tsx +0 -52
- package/src/sidebar/NotificationMessageListView.tsx +0 -136
- package/src/sidebar/SettingsMenuAccountSection.tsx +0 -32
- package/src/sidebar/SettingsMenuQuotaSection.tsx +0 -45
- package/src/skills/SceneCardView.tsx +0 -194
- package/src/skills/SkillCardView.tsx +0 -186
- package/src/skills/SkillDetailDialogView.tsx +0 -138
- package/src/skills/SkillTagGroupView.tsx +0 -56
- package/src/skills/SkillToggleSwitch.tsx +0 -31
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { CSSProperties, JSX } from "react";
|
|
2
|
-
import { cn } from "@vetta-org/ui";
|
|
2
|
+
import { cn } from "@vetta-org/ui/utils";
|
|
3
|
+
import { ActivityStatusDot, ActivityStatusDotStyles } from "../shared/ActivityStatusDot";
|
|
3
4
|
|
|
4
5
|
export interface TodoStatusItem {
|
|
5
6
|
readonly id: number;
|
|
@@ -41,44 +42,34 @@ export interface TodoTimelineLabels {
|
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
/**
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
45
|
+
* 待办专属的动效标记。CSS 里不写关键帧:毛玻璃窗口每出一帧都要整窗重合成,一个任务里同时亮着的
|
|
46
|
+
* 标签和转弧各自 60fps 逐帧插值会把 GPU 顶满。呼吸与转动由宿主(desktop 的 live-animations)
|
|
47
|
+
* 按类名挂 steps(16) 的合成器动画,并与其它「进行中」指示器锁同一相位;没有宿主动画时是静止外观。
|
|
48
|
+
* - `todo-label-sheen`:标签的呼吸(只动 opacity;别改回 background-position 扫光,那会每帧重绘文字)
|
|
47
49
|
* - `todo-marker-spin`:进行中条目的转动弧
|
|
50
|
+
*
|
|
51
|
+
* 状态点不在这里——它和底部面板共用 `ActivityStatusDotStyles`。
|
|
48
52
|
*/
|
|
49
|
-
export const TODO_PROGRESS_CSS =
|
|
50
|
-
@keyframes todo-dot-halo {
|
|
51
|
-
0% { transform: scale(0.7); opacity: 0.55; }
|
|
52
|
-
70% { transform: scale(2.1); opacity: 0; }
|
|
53
|
-
100% { transform: scale(2.1); opacity: 0; }
|
|
54
|
-
}
|
|
55
|
-
@keyframes todo-dot-core {
|
|
56
|
-
0%, 100% { opacity: 1; }
|
|
57
|
-
50% { opacity: 0.55; }
|
|
58
|
-
}
|
|
59
|
-
@keyframes todo-label-sheen { from { background-position: 160% 0; } to { background-position: -160% 0; } }
|
|
60
|
-
@keyframes todo-marker-spin { to { transform: rotate(360deg); } }
|
|
61
|
-
`;
|
|
53
|
+
export const TODO_PROGRESS_CSS = "";
|
|
62
54
|
|
|
63
55
|
/** 关键帧注入点:每个待办根节点渲染一次,样式内容相同不会互相干扰。 */
|
|
64
56
|
export function TodoProgressStyles(): JSX.Element {
|
|
65
|
-
return
|
|
57
|
+
return (
|
|
58
|
+
<>
|
|
59
|
+
<style>{TODO_PROGRESS_CSS}</style>
|
|
60
|
+
<ActivityStatusDotStyles />
|
|
61
|
+
</>
|
|
62
|
+
);
|
|
66
63
|
}
|
|
67
64
|
|
|
68
|
-
|
|
69
|
-
const SHEEN_HIGHLIGHT = "color-mix(in srgb, var(--primary) 35%, white)";
|
|
70
|
-
|
|
71
|
-
/** 标签光斑:以主色为底、高光横向扫过;静态时退回纯色,避免完成态还在闪。 */
|
|
65
|
+
/** 标签呼吸:进行中用主色轻微呼吸;静态时退回纯色,避免完成态还在闪。 */
|
|
72
66
|
export function todoLabelSheenStyle(active: boolean): CSSProperties {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
color: "transparent",
|
|
80
|
-
animation: "todo-label-sheen 2.6s linear infinite",
|
|
81
|
-
};
|
|
67
|
+
return { color: active ? "var(--primary)" : "var(--muted-foreground)" };
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** 与 `todoLabelSheenStyle(true)` 配套的类名:呼吸由宿主的 live-animations 按类名挂上。 */
|
|
71
|
+
export function todoLabelSheenClassName(active: boolean): string | undefined {
|
|
72
|
+
return active ? "todo-label-sheen" : undefined;
|
|
82
73
|
}
|
|
83
74
|
|
|
84
75
|
/**
|
|
@@ -86,24 +77,7 @@ export function todoLabelSheenStyle(active: boolean): CSSProperties {
|
|
|
86
77
|
* 取代了原先的数字徽标。
|
|
87
78
|
*/
|
|
88
79
|
export function TodoStatusDot({ allDone, className }: { allDone: boolean; className?: string }): JSX.Element {
|
|
89
|
-
return
|
|
90
|
-
<span aria-hidden className={cn("relative flex h-2 w-2 shrink-0 items-center justify-center", className)}>
|
|
91
|
-
{allDone ? (
|
|
92
|
-
<span className="h-1.5 w-1.5 rounded-full bg-emerald-500 shadow-[0_0_0_2px_color-mix(in_srgb,var(--color-emerald-500)_18%,transparent)]" />
|
|
93
|
-
) : (
|
|
94
|
-
<>
|
|
95
|
-
<span
|
|
96
|
-
className="absolute h-1.5 w-1.5 rounded-full bg-primary"
|
|
97
|
-
style={{ animation: "todo-dot-halo 2.2s ease-out infinite" }}
|
|
98
|
-
/>
|
|
99
|
-
<span
|
|
100
|
-
className="relative h-1.5 w-1.5 rounded-full bg-primary"
|
|
101
|
-
style={{ animation: "todo-dot-core 2.2s ease-in-out infinite" }}
|
|
102
|
-
/>
|
|
103
|
-
</>
|
|
104
|
-
)}
|
|
105
|
-
</span>
|
|
106
|
-
);
|
|
80
|
+
return <ActivityStatusDot pulse={!allDone} tone={allDone ? "emerald" : "primary"} className={className} />;
|
|
107
81
|
}
|
|
108
82
|
|
|
109
83
|
/** 细进度条:popover 头部与活动面板头部共用。 */
|
|
@@ -130,10 +104,7 @@ function TodoMarker({ status }: { status: TodoStatusItem["status"] }): JSX.Eleme
|
|
|
130
104
|
return (
|
|
131
105
|
<span className="relative flex h-[15px] w-[15px] items-center justify-center">
|
|
132
106
|
<span className="absolute inset-0 rounded-full border border-primary/25" />
|
|
133
|
-
<span
|
|
134
|
-
className="absolute inset-0 rounded-full border border-transparent border-t-primary border-r-primary"
|
|
135
|
-
style={{ animation: "todo-marker-spin 1.1s linear infinite" }}
|
|
136
|
-
/>
|
|
107
|
+
<span className="todo-marker-spin absolute inset-0 rounded-full border border-transparent border-t-primary border-r-primary" />
|
|
137
108
|
<span className="h-1 w-1 rounded-full bg-primary" />
|
|
138
109
|
</span>
|
|
139
110
|
);
|
|
@@ -190,6 +161,7 @@ export function TodoTimeline({ items, labels, size = "sm", className }: TodoTime
|
|
|
190
161
|
text,
|
|
191
162
|
isDone && "text-muted-foreground line-through decoration-muted-foreground/40",
|
|
192
163
|
!isDone && !isActive && "text-foreground",
|
|
164
|
+
todoLabelSheenClassName(isActive),
|
|
193
165
|
)}
|
|
194
166
|
style={isActive ? todoLabelSheenStyle(true) : undefined}
|
|
195
167
|
title={item.content}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { AnimatePresence, motion } from "motion/react";
|
|
2
2
|
import { type JSX, useState } from "react";
|
|
3
|
-
import { cn,
|
|
3
|
+
import { cn, FROSTED_SURFACE_CLASS } from "@vetta-org/ui/utils";
|
|
4
|
+
import { Popover, PopoverContent, PopoverTrigger } from "@vetta-org/ui/popover";
|
|
4
5
|
import { ThemeSurface } from "../appearance/ThemeSurface";
|
|
5
6
|
import {
|
|
6
7
|
selectTodoStatusSummary,
|
|
@@ -10,6 +11,7 @@ import {
|
|
|
10
11
|
type TodoStatusItem,
|
|
11
12
|
TodoTimeline,
|
|
12
13
|
type TodoTimelineLabels,
|
|
14
|
+
todoLabelSheenClassName,
|
|
13
15
|
todoLabelSheenStyle,
|
|
14
16
|
} from "./TodoProgress";
|
|
15
17
|
|
|
@@ -71,7 +73,10 @@ export function TodoStatusBarView({
|
|
|
71
73
|
<TodoStatusDot allDone={summary.allDone} />
|
|
72
74
|
<span className="shrink-0 tabular-nums text-muted-foreground">{summary.progressLabel}</span>
|
|
73
75
|
<span
|
|
74
|
-
className=
|
|
76
|
+
className={cn(
|
|
77
|
+
"min-w-0 flex-1 truncate text-left font-medium",
|
|
78
|
+
todoLabelSheenClassName(!summary.allDone),
|
|
79
|
+
)}
|
|
75
80
|
style={todoLabelSheenStyle(!summary.allDone)}
|
|
76
81
|
>
|
|
77
82
|
{label}
|
|
@@ -87,7 +92,9 @@ export function TodoStatusBarView({
|
|
|
87
92
|
align="start"
|
|
88
93
|
sideOffset={8}
|
|
89
94
|
className={cn(
|
|
90
|
-
|
|
95
|
+
// 外观跟模型选择弹层一致:沿用 FLOATING_SURFACE_CLASS 的外投影与深色细线,只把底色换成同款毛玻璃。
|
|
96
|
+
FROSTED_SURFACE_CLASS,
|
|
97
|
+
"w-[min(22rem,calc(100vw-2rem))] overflow-visible p-0",
|
|
91
98
|
classNames?.content,
|
|
92
99
|
)}
|
|
93
100
|
style={{ animation: "none" }}
|
|
@@ -97,7 +104,9 @@ export function TodoStatusBarView({
|
|
|
97
104
|
animate={{ opacity: 1, scale: 1, y: 0 }}
|
|
98
105
|
exit={{ opacity: 0, scale: 0.97, y: 6 }}
|
|
99
106
|
transition={{ duration: 0.12, ease: [0.16, 1, 0.3, 1] }}
|
|
100
|
-
|
|
107
|
+
// 这里的 motion.div 就是 PopoverContent 本体(asChild),圆角来自 FLOATING_SURFACE_CLASS;
|
|
108
|
+
// 再写 rounded-[inherit] 会和它并排成两条声明,按样式表顺序覆盖成继承自 portal 的 0。
|
|
109
|
+
className="relative overflow-visible"
|
|
101
110
|
>
|
|
102
111
|
<ThemeSurface slot="chat.todoPanel" />
|
|
103
112
|
<div className="relative z-10 flex max-h-[min(22rem,55vh)] flex-col overflow-hidden rounded-[inherit]">
|
|
@@ -123,7 +132,7 @@ export function TodoStatusBarView({
|
|
|
123
132
|
setOpen(false);
|
|
124
133
|
onOpenPanel();
|
|
125
134
|
}}
|
|
126
|
-
className="flex shrink-0 items-center justify-center gap-1
|
|
135
|
+
className="flex shrink-0 items-center justify-center gap-1 px-3 pb-2 pt-1.5 text-[11px] text-muted-foreground transition-colors hover:bg-muted/50 hover:text-foreground"
|
|
127
136
|
>
|
|
128
137
|
<span aria-hidden className="icon-[solar--arrow-right-up-linear] h-3 w-3" />
|
|
129
138
|
{labels.openPanel}
|
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
import { motion } from "motion/react";
|
|
2
2
|
import type { HTMLMotionProps, Transition } from "motion/react";
|
|
3
3
|
import { Slot } from "radix-ui";
|
|
4
|
-
import type {
|
|
5
|
-
|
|
6
|
-
ComponentPropsWithoutRef,
|
|
7
|
-
JSX,
|
|
8
|
-
MouseEvent,
|
|
9
|
-
ReactNode,
|
|
10
|
-
} from "react";
|
|
11
|
-
import { forwardRef, useCallback, useLayoutEffect, useRef, useState } from "react";
|
|
4
|
+
import type { ButtonHTMLAttributes, ComponentPropsWithoutRef, JSX, MouseEvent, ReactNode } from "react";
|
|
5
|
+
import { forwardRef, useCallback, useEffect, useLayoutEffect, useRef, useState } from "react";
|
|
12
6
|
|
|
13
7
|
const HIDDEN_VISUAL_STATE = { opacity: 0, scale: 0.82, x: 14, y: 12 };
|
|
14
8
|
const VISIBLE_VISUAL_STATE = { opacity: 1, scale: 1, x: 0, y: 0 };
|
|
@@ -28,6 +22,40 @@ const MESSAGE_STYLE = { originX: 1, originY: 1 };
|
|
|
28
22
|
const USER_MESSAGE_COLLAPSED_LINES = 10;
|
|
29
23
|
const USER_MESSAGE_COLLAPSED_MAX_HEIGHT = `${USER_MESSAGE_COLLAPSED_LINES * 1.6}em`;
|
|
30
24
|
|
|
25
|
+
const pendingOverflowMeasurements = new Set<() => void>();
|
|
26
|
+
let overflowPaintFrame: number | null = null;
|
|
27
|
+
let overflowMeasurementFrame: number | null = null;
|
|
28
|
+
|
|
29
|
+
/** Batch geometry reads from all newly mounted history rows after their first paint. */
|
|
30
|
+
function scheduleOverflowMeasurement(measure: () => void): () => void {
|
|
31
|
+
pendingOverflowMeasurements.add(measure);
|
|
32
|
+
if (overflowPaintFrame === null && overflowMeasurementFrame === null) {
|
|
33
|
+
overflowPaintFrame = window.requestAnimationFrame(() => {
|
|
34
|
+
overflowPaintFrame = null;
|
|
35
|
+
overflowMeasurementFrame = window.requestAnimationFrame(() => {
|
|
36
|
+
overflowMeasurementFrame = null;
|
|
37
|
+
const measurements = [...pendingOverflowMeasurements];
|
|
38
|
+
pendingOverflowMeasurements.clear();
|
|
39
|
+
for (const runMeasurement of measurements) runMeasurement();
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return () => {
|
|
45
|
+
pendingOverflowMeasurements.delete(measure);
|
|
46
|
+
if (pendingOverflowMeasurements.size === 0) {
|
|
47
|
+
if (overflowPaintFrame !== null) {
|
|
48
|
+
window.cancelAnimationFrame(overflowPaintFrame);
|
|
49
|
+
overflowPaintFrame = null;
|
|
50
|
+
}
|
|
51
|
+
if (overflowMeasurementFrame !== null) {
|
|
52
|
+
window.cancelAnimationFrame(overflowMeasurementFrame);
|
|
53
|
+
overflowMeasurementFrame = null;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
|
|
31
59
|
export type UserMessageEntryState = "static" | "hidden" | "enter";
|
|
32
60
|
|
|
33
61
|
export interface UserMessageViewLabels {
|
|
@@ -35,7 +63,6 @@ export interface UserMessageViewLabels {
|
|
|
35
63
|
edit: string;
|
|
36
64
|
fork: string;
|
|
37
65
|
skillBadge: string;
|
|
38
|
-
sceneBadge: string;
|
|
39
66
|
branchPrev: string;
|
|
40
67
|
branchNext: string;
|
|
41
68
|
branchPosition: string;
|
|
@@ -63,9 +90,7 @@ export function UserMessageText({
|
|
|
63
90
|
const measureOverflow = useCallback(() => {
|
|
64
91
|
const content = contentRef.current;
|
|
65
92
|
if (!content) return;
|
|
66
|
-
|
|
67
|
-
const collapsedHeight = fontSize * 1.6 * USER_MESSAGE_COLLAPSED_LINES;
|
|
68
|
-
setCanExpand(content.scrollHeight > collapsedHeight + 1);
|
|
93
|
+
setCanExpand(content.scrollHeight > content.clientHeight + 1);
|
|
69
94
|
}, []);
|
|
70
95
|
|
|
71
96
|
// Expand is sticky for the lifetime of this mount (session switch / refresh remounts).
|
|
@@ -74,17 +99,24 @@ export function UserMessageText({
|
|
|
74
99
|
setExpanded(false);
|
|
75
100
|
}, [contentKey]);
|
|
76
101
|
|
|
77
|
-
|
|
78
|
-
measureOverflow();
|
|
102
|
+
useEffect(() => {
|
|
79
103
|
const content = contentRef.current;
|
|
80
104
|
if (!content) return;
|
|
81
|
-
|
|
105
|
+
let cancelMeasurement = scheduleOverflowMeasurement(measureOverflow);
|
|
106
|
+
const observer = new ResizeObserver(() => {
|
|
107
|
+
cancelMeasurement();
|
|
108
|
+
cancelMeasurement = scheduleOverflowMeasurement(measureOverflow);
|
|
109
|
+
});
|
|
82
110
|
observer.observe(content);
|
|
83
|
-
return () =>
|
|
84
|
-
|
|
111
|
+
return () => {
|
|
112
|
+
cancelMeasurement();
|
|
113
|
+
observer.disconnect();
|
|
114
|
+
};
|
|
115
|
+
}, [measureOverflow, contentKey]);
|
|
85
116
|
|
|
86
117
|
return (
|
|
87
118
|
<div
|
|
119
|
+
ref={contentRef}
|
|
88
120
|
className="relative min-w-0 max-w-full overflow-hidden"
|
|
89
121
|
style={{ maxHeight: expanded ? undefined : USER_MESSAGE_COLLAPSED_MAX_HEIGHT }}
|
|
90
122
|
>
|
|
@@ -92,7 +124,6 @@ export function UserMessageText({
|
|
|
92
124
|
给每条都套一层动画组件只是白付出订阅与逐帧调度的开销。 */}
|
|
93
125
|
{shouldAnimateIn || shouldHoldHidden ? (
|
|
94
126
|
<motion.div
|
|
95
|
-
ref={contentRef}
|
|
96
127
|
className="min-w-0 max-w-full"
|
|
97
128
|
initial={shouldAnimateIn ? TEXT_INITIAL : false}
|
|
98
129
|
animate={shouldHoldHidden ? TEXT_INITIAL : TEXT_VISIBLE}
|
|
@@ -101,12 +132,12 @@ export function UserMessageText({
|
|
|
101
132
|
{children}
|
|
102
133
|
</motion.div>
|
|
103
134
|
) : (
|
|
104
|
-
<div
|
|
135
|
+
<div className="min-w-0 max-w-full">
|
|
105
136
|
{children}
|
|
106
137
|
</div>
|
|
107
138
|
)}
|
|
108
139
|
{canExpand && !expanded && (
|
|
109
|
-
<div className="absolute inset-x-0 bottom-0 flex h-20 items-end justify-center bg-gradient-to-t from-secondary via-secondary/80 to-secondary/0 pb-1.5">
|
|
140
|
+
<div data-user-message-expand-fade="" className="absolute inset-x-0 bottom-0 flex h-20 items-end justify-center bg-gradient-to-t from-secondary via-secondary/80 to-secondary/0 pb-1.5">
|
|
110
141
|
<button
|
|
111
142
|
type="button"
|
|
112
143
|
onClick={() => setExpanded(true)}
|
|
@@ -123,22 +154,15 @@ export function UserMessageText({
|
|
|
123
154
|
|
|
124
155
|
export function SkillBadgeView({
|
|
125
156
|
name,
|
|
126
|
-
type = "skill",
|
|
127
157
|
skillLabel,
|
|
128
|
-
sceneLabel,
|
|
129
158
|
}: {
|
|
130
159
|
name: string;
|
|
131
|
-
type?: "skill" | "scene";
|
|
132
160
|
skillLabel: string;
|
|
133
|
-
sceneLabel: string;
|
|
134
161
|
}): JSX.Element {
|
|
135
|
-
const icon =
|
|
136
|
-
type === "scene" ? "icon-[solar--clapperboard-open-linear]" : "icon-[solar--magic-stick-linear]";
|
|
137
|
-
const label = type === "scene" ? sceneLabel : skillLabel;
|
|
138
162
|
return (
|
|
139
163
|
<span className="inline-flex items-center gap-1 rounded-lg bg-primary/10 px-2 py-0.5 text-[12px] font-medium text-primary">
|
|
140
|
-
<span className=
|
|
141
|
-
<span className="text-primary/75">{
|
|
164
|
+
<span className="icon-[solar--magic-stick-linear] h-3 w-3" />
|
|
165
|
+
<span className="text-primary/75">{skillLabel}</span>
|
|
142
166
|
{name}
|
|
143
167
|
</span>
|
|
144
168
|
);
|
|
@@ -192,8 +216,8 @@ export function UserMessageFrame({
|
|
|
192
216
|
}: ComponentPropsWithoutRef<"div"> & {
|
|
193
217
|
entryState: UserMessageEntryState;
|
|
194
218
|
onEntryComplete?: () => void;
|
|
195
|
-
onContextMenu
|
|
196
|
-
onActionsVisibleChange
|
|
219
|
+
onContextMenu?: (event: MouseEvent<HTMLDivElement>) => void;
|
|
220
|
+
onActionsVisibleChange?: (visible: boolean) => void;
|
|
197
221
|
children: ReactNode;
|
|
198
222
|
}): JSX.Element {
|
|
199
223
|
const shouldAnimateIn = entryState === "enter";
|
|
@@ -202,11 +226,11 @@ export function UserMessageFrame({
|
|
|
202
226
|
onContextMenu,
|
|
203
227
|
onMouseEnter: (event: MouseEvent<HTMLDivElement>) => {
|
|
204
228
|
onMouseEnter?.(event);
|
|
205
|
-
if (!event.defaultPrevented) onActionsVisibleChange(true);
|
|
229
|
+
if (!event.defaultPrevented) onActionsVisibleChange?.(true);
|
|
206
230
|
},
|
|
207
231
|
onMouseLeave: (event: MouseEvent<HTMLDivElement>) => {
|
|
208
232
|
onMouseLeave?.(event);
|
|
209
|
-
if (!event.defaultPrevented) onActionsVisibleChange(false);
|
|
233
|
+
if (!event.defaultPrevented) onActionsVisibleChange?.(false);
|
|
210
234
|
},
|
|
211
235
|
};
|
|
212
236
|
if (!shouldAnimateIn && !shouldHoldHidden) {
|
|
@@ -232,10 +256,66 @@ export function UserMessageFrame({
|
|
|
232
256
|
);
|
|
233
257
|
}
|
|
234
258
|
|
|
259
|
+
/** One row of actions under a user bubble; collapses when none of its actions render. */
|
|
260
|
+
export function UserMessageActionBar({ children }: { readonly children?: ReactNode }): JSX.Element {
|
|
261
|
+
return <div className="flex h-6 items-center justify-end gap-1 whitespace-nowrap empty:hidden">{children}</div>;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
export interface UserMessageBranchSwitcherLabels {
|
|
265
|
+
readonly previous: string;
|
|
266
|
+
readonly next: string;
|
|
267
|
+
/** Full description of the position, e.g. "Branch 2 of 3". */
|
|
268
|
+
readonly position: string;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/** Previous / next between sibling branches of a user message, with the current position. */
|
|
272
|
+
export function UserMessageBranchSwitcher({
|
|
273
|
+
index,
|
|
274
|
+
total,
|
|
275
|
+
onPrevious,
|
|
276
|
+
onNext,
|
|
277
|
+
labels,
|
|
278
|
+
}: {
|
|
279
|
+
/** Zero-based index of the shown branch. */
|
|
280
|
+
readonly index: number;
|
|
281
|
+
readonly total: number;
|
|
282
|
+
readonly onPrevious: () => void;
|
|
283
|
+
readonly onNext: () => void;
|
|
284
|
+
readonly labels: UserMessageBranchSwitcherLabels;
|
|
285
|
+
}): JSX.Element {
|
|
286
|
+
return (
|
|
287
|
+
<div className="flex h-6 items-center justify-end gap-1 whitespace-nowrap">
|
|
288
|
+
<span className="inline-flex items-center gap-0.5 text-[11px] text-muted-foreground/70">
|
|
289
|
+
<UserMessageAction
|
|
290
|
+
onClick={onPrevious}
|
|
291
|
+
disabled={index <= 0}
|
|
292
|
+
title={labels.previous}
|
|
293
|
+
aria-label={labels.previous}
|
|
294
|
+
>
|
|
295
|
+
<span className="icon-[solar--alt-arrow-left-linear] h-3.5 w-3.5" />
|
|
296
|
+
</UserMessageAction>
|
|
297
|
+
<span className="min-w-[2.5rem] text-center tabular-nums" title={labels.position}>
|
|
298
|
+
{index + 1}/{total}
|
|
299
|
+
</span>
|
|
300
|
+
<UserMessageAction
|
|
301
|
+
onClick={onNext}
|
|
302
|
+
disabled={index >= total - 1}
|
|
303
|
+
title={labels.next}
|
|
304
|
+
aria-label={labels.next}
|
|
305
|
+
>
|
|
306
|
+
<span className="icon-[solar--alt-arrow-right-linear] h-3.5 w-3.5" />
|
|
307
|
+
</UserMessageAction>
|
|
308
|
+
</span>
|
|
309
|
+
</div>
|
|
310
|
+
);
|
|
311
|
+
}
|
|
312
|
+
|
|
235
313
|
export const UserMessage = {
|
|
236
314
|
Frame: UserMessageFrame,
|
|
237
315
|
Text: UserMessageText,
|
|
238
316
|
Action: UserMessageAction,
|
|
317
|
+
ActionBar: UserMessageActionBar,
|
|
318
|
+
BranchSwitcher: UserMessageBranchSwitcher,
|
|
239
319
|
SkillBadge: SkillBadgeView,
|
|
240
320
|
SettingsAssistBadge: SettingsAssistBadgeView,
|
|
241
321
|
} as const;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { narrowOverflowBadge, partitionHeaderActionsForNarrow } from "./header-action-narrow";
|
|
3
|
+
|
|
4
|
+
describe("partitionHeaderActionsForNarrow", () => {
|
|
5
|
+
it("keeps the pin beside the panel and folds the other actions, including stowed ones, into the menu", () => {
|
|
6
|
+
const split = partitionHeaderActionsForNarrow(
|
|
7
|
+
[{ key: "export" }, { key: "pin", retainWhenNarrow: true }, { key: "terminal" }],
|
|
8
|
+
[{ key: "bottom" }, { key: "stowed-pin", retainWhenNarrow: true }],
|
|
9
|
+
);
|
|
10
|
+
expect(split.retained.map((item) => item.key)).toEqual(["pin", "stowed-pin"]);
|
|
11
|
+
expect(split.overflow.map((item) => item.key)).toEqual(["export", "terminal", "bottom"]);
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
describe("narrowOverflowBadge", () => {
|
|
16
|
+
it("sums counts and falls back to a dot when nothing is numbered", () => {
|
|
17
|
+
expect(narrowOverflowBadge([{ badge: 2 }, { badge: true }, { badge: 3 }])).toBe(5);
|
|
18
|
+
expect(narrowOverflowBadge([{ badge: true }])).toBe(true);
|
|
19
|
+
expect(narrowOverflowBadge([{}])).toBeUndefined();
|
|
20
|
+
});
|
|
21
|
+
});
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/** 挤窄分栏只关心这两件事,避免和按钮组视图互相引用。 */
|
|
2
|
+
export interface NarrowHeaderAction {
|
|
3
|
+
readonly retainWhenNarrow?: boolean;
|
|
4
|
+
readonly badge?: number | true;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface NarrowHeaderSplit<T extends NarrowHeaderAction> {
|
|
8
|
+
/** 收进「更多」菜单的动作,顶栏在前、收纳在后。 */
|
|
9
|
+
readonly overflow: readonly T[];
|
|
10
|
+
/** 挤窄时仍留在活动面板开关旁边的动作(窗口置顶)。 */
|
|
11
|
+
readonly retained: readonly T[];
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** 页头挤窄时:标了 `retainWhenNarrow` 的留下,其余(含已经收纳的)进下拉菜单。 */
|
|
15
|
+
export function partitionHeaderActionsForNarrow<T extends NarrowHeaderAction>(
|
|
16
|
+
top: readonly T[],
|
|
17
|
+
tray: readonly T[],
|
|
18
|
+
): NarrowHeaderSplit<T> {
|
|
19
|
+
const overflow: T[] = [];
|
|
20
|
+
const retained: T[] = [];
|
|
21
|
+
for (const item of [...top, ...tray]) {
|
|
22
|
+
if (item.retainWhenNarrow) retained.push(item);
|
|
23
|
+
else overflow.push(item);
|
|
24
|
+
}
|
|
25
|
+
return { overflow, retained };
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** 菜单触发器上的角标:有数字就加总,否则只要有人带红点就显示一枚。 */
|
|
29
|
+
export function narrowOverflowBadge(items: readonly NarrowHeaderAction[]): number | true | undefined {
|
|
30
|
+
let count = 0;
|
|
31
|
+
let dot = false;
|
|
32
|
+
for (const item of items) {
|
|
33
|
+
if (item.badge === true) dot = true;
|
|
34
|
+
else if (typeof item.badge === "number" && item.badge > 0) count += item.badge;
|
|
35
|
+
}
|
|
36
|
+
if (count > 0) return count;
|
|
37
|
+
return dot ? true : undefined;
|
|
38
|
+
}
|
package/src/chat/index.ts
CHANGED
|
@@ -2,13 +2,7 @@ import "../registry";
|
|
|
2
2
|
import type { ComponentType } from "react";
|
|
3
3
|
import type { InputBarBackground } from "./InputBarBackground";
|
|
4
4
|
import type { InputBarPlaceholder } from "./InputBarPlaceholder";
|
|
5
|
-
import type {
|
|
6
|
-
NewSessionGuidingWordsProps,
|
|
7
|
-
NewSessionHeroProps,
|
|
8
|
-
NewSessionSceneCarouselProps,
|
|
9
|
-
NewSessionSkillBadgeRowProps,
|
|
10
|
-
} from "./NewSession";
|
|
11
|
-
import type { SceneCard } from "./SceneCard";
|
|
5
|
+
import type { NewSessionGuidingWordsProps, NewSessionHeroProps, NewSessionSkillBadgeRowProps } from "./NewSession";
|
|
12
6
|
import type { SkillCard } from "./SkillCard";
|
|
13
7
|
import type { TodoStatusBarView } from "./TodoStatusBarView";
|
|
14
8
|
|
|
@@ -18,8 +12,6 @@ declare module "@vetta-org/theme-sdk" {
|
|
|
18
12
|
readonly "chat.inputBarPlaceholder"?: typeof InputBarPlaceholder;
|
|
19
13
|
readonly "chat.newSessionGuidingWords"?: ComponentType<NewSessionGuidingWordsProps>;
|
|
20
14
|
readonly "chat.newSessionHero"?: ComponentType<NewSessionHeroProps>;
|
|
21
|
-
readonly "chat.newSessionSceneCard"?: typeof SceneCard;
|
|
22
|
-
readonly "chat.newSessionSceneCarousel"?: ComponentType<NewSessionSceneCarouselProps>;
|
|
23
15
|
readonly "chat.newSessionSkillBadgeRow"?: ComponentType<NewSessionSkillBadgeRowProps>;
|
|
24
16
|
readonly "chat.newSessionSkillCard"?: typeof SkillCard;
|
|
25
17
|
readonly "chat.todoStatusBar"?: typeof TodoStatusBarView;
|
|
@@ -30,6 +22,7 @@ export type { ActionButtonBarItem, ActionButtonBarViewProps } from "./ActionButt
|
|
|
30
22
|
export { ActionButtonBarView } from "./ActionButtonBarView";
|
|
31
23
|
export type { AgentAvatarSize, AgentAvatarViewProps } from "./AgentAvatarView";
|
|
32
24
|
export { AgentAvatarView } from "./AgentAvatarView";
|
|
25
|
+
export { AnnotationComposer, AnnotationHistoryView, AnnotationTurnView } from "./AnnotationViews";
|
|
33
26
|
export type { AppshotCardViewLabels, AppshotCardViewProps } from "./AppshotCardView";
|
|
34
27
|
export { AppshotCardView } from "./AppshotCardView";
|
|
35
28
|
export type {
|
|
@@ -44,6 +37,7 @@ export {
|
|
|
44
37
|
AssistantMessage,
|
|
45
38
|
AssistantMessageFold,
|
|
46
39
|
AssistantMessagePredictingStatus,
|
|
40
|
+
AssistantMessageProcessContainer,
|
|
47
41
|
AssistantMessageStreamingStatus,
|
|
48
42
|
StreamingIndicator,
|
|
49
43
|
} from "./AssistantMessageView";
|
|
@@ -80,10 +74,14 @@ export type { ChatExportHostViewProps } from "./ChatExportHostView";
|
|
|
80
74
|
export { ChatExportHostView } from "./ChatExportHostView";
|
|
81
75
|
export {
|
|
82
76
|
ChatHeaderActions,
|
|
77
|
+
ChatHeaderBottomPanelAction,
|
|
83
78
|
ChatHeaderExportAction,
|
|
84
79
|
ChatHeaderPanelAction,
|
|
85
80
|
ChatHeaderPinAction,
|
|
81
|
+
ChatHeaderTerminalAction,
|
|
86
82
|
} from "./ChatHeaderActionsView";
|
|
83
|
+
export type { CompactionStepViewProps } from "./CompactionStepView";
|
|
84
|
+
export { CompactionStepView } from "./CompactionStepView";
|
|
87
85
|
export type { ContextRingViewProps } from "./ContextRingView";
|
|
88
86
|
export { CIRCUMFERENCE as CONTEXT_RING_CIRCUMFERENCE, ContextRingView } from "./ContextRingView";
|
|
89
87
|
export type { CopyIconButtonLabels, CopyIconButtonProps } from "./CopyIconButton";
|
|
@@ -92,10 +90,6 @@ export {
|
|
|
92
90
|
DefaultGuidingWords,
|
|
93
91
|
NEW_SESSION_GUIDING_WORDS_SLOT_MIN_H_CLASS,
|
|
94
92
|
} from "./DefaultGuidingWords";
|
|
95
|
-
export {
|
|
96
|
-
DefaultSceneCarousel,
|
|
97
|
-
NEW_SESSION_SCENE_SLOT_MIN_H_CLASS,
|
|
98
|
-
} from "./DefaultSceneCarousel";
|
|
99
93
|
export {
|
|
100
94
|
DefaultSkillBadgeRow,
|
|
101
95
|
NEW_SESSION_SKILL_BADGE_SLOT_MIN_H_CLASS,
|
|
@@ -124,6 +118,17 @@ export type {
|
|
|
124
118
|
GuideBadgeViewItem,
|
|
125
119
|
} from "./GuideBadgeSwiperView";
|
|
126
120
|
export { GuideBadgeSwiperView } from "./GuideBadgeSwiperView";
|
|
121
|
+
export type {
|
|
122
|
+
HeaderActionBarItem,
|
|
123
|
+
HeaderActionBarLabels,
|
|
124
|
+
HeaderActionBarViewProps,
|
|
125
|
+
HeaderActionBehavior,
|
|
126
|
+
HeaderActionPopoverApi,
|
|
127
|
+
HeaderActionTone,
|
|
128
|
+
HeaderActionZone,
|
|
129
|
+
} from "./HeaderActionBarView";
|
|
130
|
+
export { HeaderActionBarView, headerActionToneBadgeClass, LABELED_TOP_ACTIONS_MAX } from "./HeaderActionBarView";
|
|
131
|
+
export { InlineModelPicker } from "./InlineModelPicker";
|
|
127
132
|
export type { InlineTokenChipProps } from "./InlineTokenChip";
|
|
128
133
|
export { InlineTokenChip } from "./InlineTokenChip";
|
|
129
134
|
export type {
|
|
@@ -170,11 +175,13 @@ export type { SegmentShellProps, ToolCallGroupViewProps } from "./MessageBlockSe
|
|
|
170
175
|
export { ErrorBlockView, SegmentShell, ToolCallGroupView } from "./MessageBlockSegmentsView";
|
|
171
176
|
export type {
|
|
172
177
|
CompactionBoundaryViewProps,
|
|
178
|
+
DelegationNoticeViewProps,
|
|
173
179
|
ForkOriginBannerViewProps,
|
|
174
180
|
ModelSwitchBoundaryViewProps,
|
|
175
181
|
} from "./MessageBoundaryViews";
|
|
176
182
|
export {
|
|
177
183
|
CompactionBoundaryView,
|
|
184
|
+
DelegationNoticeView,
|
|
178
185
|
ForkOriginBannerView,
|
|
179
186
|
ModelSwitchBoundaryView,
|
|
180
187
|
} from "./MessageBoundaryViews";
|
|
@@ -201,7 +208,6 @@ export {
|
|
|
201
208
|
export type {
|
|
202
209
|
MessageFeedPrimitiveProps,
|
|
203
210
|
MessageFeedRootProps,
|
|
204
|
-
MessageFeedVirtualListChild,
|
|
205
211
|
MessageFeedVirtualListProps,
|
|
206
212
|
} from "./MessageFeedView";
|
|
207
213
|
export {
|
|
@@ -296,23 +302,23 @@ export {
|
|
|
296
302
|
MessageVisualEventBubble,
|
|
297
303
|
MessageVisualOutgoingBubble,
|
|
298
304
|
} from "./MessageVisualView";
|
|
305
|
+
export type { ModelConfigurationGroup, ModelConfigurationMember } from "./ModelConfiguration";
|
|
306
|
+
export { ModelConfigurationOverview, ModelConfigurationPopover } from "./ModelConfiguration";
|
|
299
307
|
export type {
|
|
308
|
+
ModelSelectorFavorites,
|
|
300
309
|
ModelSelectorLabels,
|
|
301
310
|
ModelSelectorOptionView,
|
|
302
311
|
ModelSelectorProviderGroup,
|
|
312
|
+
ModelSelectorTriggerVariant,
|
|
303
313
|
ModelSelectorViewProps,
|
|
304
314
|
} from "./ModelSelectorView";
|
|
305
|
-
export { ModelSelectorView } from "./ModelSelectorView";
|
|
315
|
+
export { ModelSelectorView, ModelVisionIcon } from "./ModelSelectorView";
|
|
306
316
|
export type {
|
|
307
317
|
NewSessionGuidingWordsGroup,
|
|
308
318
|
NewSessionGuidingWordsProps,
|
|
309
319
|
NewSessionHeroAvatar,
|
|
310
320
|
NewSessionHeroIdentity,
|
|
311
321
|
NewSessionHeroProps,
|
|
312
|
-
NewSessionSceneActionState,
|
|
313
|
-
NewSessionSceneCarouselLabels,
|
|
314
|
-
NewSessionSceneCarouselProps,
|
|
315
|
-
NewSessionSceneItem,
|
|
316
322
|
NewSessionSelection,
|
|
317
323
|
NewSessionSkillBadgeRowLabels,
|
|
318
324
|
NewSessionSkillBadgeRowProps,
|
|
@@ -390,6 +396,8 @@ export type {
|
|
|
390
396
|
export { QueueCardView } from "./QueueCardView";
|
|
391
397
|
export type { ReadImageViewProps } from "./ReadImageView";
|
|
392
398
|
export { ReadImageView } from "./ReadImageView";
|
|
399
|
+
export type { RemoteSessionBadgeViewProps } from "./RemoteSessionBadgeView";
|
|
400
|
+
export { RemoteSessionBadgeView } from "./RemoteSessionBadgeView";
|
|
393
401
|
export type {
|
|
394
402
|
SandboxGrantsBadgeViewLabels,
|
|
395
403
|
SandboxGrantsBadgeViewProps,
|
|
@@ -402,14 +410,6 @@ export type {
|
|
|
402
410
|
SandboxPermissionRequestModel,
|
|
403
411
|
} from "./SandboxPermissionCard";
|
|
404
412
|
export { SandboxPermissionCard } from "./SandboxPermissionCard";
|
|
405
|
-
export type {
|
|
406
|
-
SceneCardActionState,
|
|
407
|
-
SceneCardClassNames,
|
|
408
|
-
SceneCardModel,
|
|
409
|
-
SceneCardProps,
|
|
410
|
-
SceneCardState,
|
|
411
|
-
} from "./SceneCard";
|
|
412
|
-
export { SceneCard } from "./SceneCard";
|
|
413
413
|
export type { SendButtonLabels, SendButtonProps } from "./SendButton";
|
|
414
414
|
export { SendButton } from "./SendButton";
|
|
415
415
|
export type {
|
|
@@ -429,6 +429,8 @@ export type {
|
|
|
429
429
|
export { SkillPromptAreaView } from "./SkillPromptAreaView";
|
|
430
430
|
export type { SuggestionBubblesViewProps } from "./SuggestionBubblesView";
|
|
431
431
|
export { SuggestionBubblesView } from "./SuggestionBubblesView";
|
|
432
|
+
export type { TeamMemberReplyCardViewProps, TeamMemberReplyState } from "./TeamMemberReplyCardView";
|
|
433
|
+
export { TeamMemberReplyCardView } from "./TeamMemberReplyCardView";
|
|
432
434
|
export type {
|
|
433
435
|
InlineTokenAnnotation,
|
|
434
436
|
InlineTokenPiece,
|
|
@@ -470,6 +472,7 @@ export {
|
|
|
470
472
|
TodoProgressStyles,
|
|
471
473
|
TodoStatusDot,
|
|
472
474
|
TodoTimeline,
|
|
475
|
+
todoLabelSheenClassName,
|
|
473
476
|
todoLabelSheenStyle,
|
|
474
477
|
} from "./TodoProgress";
|
|
475
478
|
export type { TodoStatusBarLabels, TodoStatusBarViewProps } from "./TodoStatusBarView";
|
|
@@ -502,6 +505,7 @@ export type {
|
|
|
502
505
|
} from "./UserMessageContextMenuView";
|
|
503
506
|
export { UserMessageContextMenuView } from "./UserMessageContextMenuView";
|
|
504
507
|
export type {
|
|
508
|
+
UserMessageBranchSwitcherLabels,
|
|
505
509
|
UserMessageEntryState,
|
|
506
510
|
UserMessageViewLabels,
|
|
507
511
|
} from "./UserMessageView";
|
|
@@ -510,6 +514,8 @@ export {
|
|
|
510
514
|
SkillBadgeView,
|
|
511
515
|
UserMessage,
|
|
512
516
|
UserMessageAction,
|
|
517
|
+
UserMessageActionBar,
|
|
518
|
+
UserMessageBranchSwitcher,
|
|
513
519
|
UserMessageFrame,
|
|
514
520
|
UserMessageText,
|
|
515
521
|
} from "./UserMessageView";
|