@vetta-org/theme-ui 0.1.0 → 0.1.2

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.
Files changed (301) hide show
  1. package/package.json +735 -7
  2. package/src/action-approval/AppearanceActionPickerView.tsx +2 -78
  3. package/src/action-approval/AppearanceApprovalDrawerView.tsx +2 -9
  4. package/src/action-approval/BatchTasksApprovalFrameView.tsx +4 -1
  5. package/src/action-approval/GenericActionApprovalView.tsx +2 -9
  6. package/src/action-approval/ManageActionApprovalFrameView.tsx +4 -1
  7. package/src/action-approval/NavigationOpenApprovalView.tsx +2 -9
  8. package/src/action-approval/SchedulerActionApprovalDialogView.tsx +3 -1
  9. package/src/action-approval/SchedulerEditApprovalDrawerView.tsx +3 -10
  10. package/src/action-approval/index.ts +0 -1
  11. package/src/activity/ActivityPanel.tsx +13 -10
  12. package/src/activity/ActivityPanelFrame.test.tsx +32 -0
  13. package/src/activity/ActivityPanelFrame.tsx +3 -2
  14. package/src/activity/BackgroundTasksTabPanelView.tsx +1 -1
  15. package/src/activity/BrowserPanelView.tsx +48 -49
  16. package/src/activity/DebugTabPanelView.tsx +1 -1
  17. package/src/activity/MarkdownPreviewView.tsx +56 -59
  18. package/src/activity/PluginTabPickerView.tsx +5 -3
  19. package/src/activity/PortsTabPanelView.tsx +911 -0
  20. package/src/activity/ToolCallsSubTabView.tsx +1 -1
  21. package/src/activity/WorkflowTabPanelView.tsx +1 -1
  22. package/src/activity/index.ts +9 -0
  23. package/src/app/AppBackground.tsx +1 -1
  24. package/src/app/AppBootLoadingView.tsx +4 -2
  25. package/src/app-shell/DefaultWindowControls.tsx +1 -1
  26. package/src/app-shell/PageHeaderActionGroup.tsx +1 -1
  27. package/src/app-shell/PageHeaderContent.tsx +36 -7
  28. package/src/app-shell/PageHeaderFrame.tsx +15 -3
  29. package/src/app-shell/PageHeaderSidebarTrigger.tsx +1 -1
  30. package/src/app-shell/PageHeaderTitle.tsx +1 -1
  31. package/src/app-shell/WindowControlButton.tsx +1 -1
  32. package/src/app-shell/header-crowding.test.ts +62 -0
  33. package/src/app-shell/header-crowding.tsx +137 -0
  34. package/src/appearance/BackgroundImageFrame.tsx +1 -1
  35. package/src/appearance/CenterSliceImageFrame.tsx +1 -1
  36. package/src/appearance/CornerImageFrame.tsx +1 -1
  37. package/src/appearance/HorizontalSliceImageFrame.tsx +1 -1
  38. package/src/appearance/NineSliceImageFrame.tsx +1 -1
  39. package/src/appearance/ThemeSurface.tsx +1 -1
  40. package/src/batch-tasks/BatchProjectFoldersFieldView.tsx +2 -1
  41. package/src/batch-tasks/BatchTaskProjectActionsView.test.tsx +97 -0
  42. package/src/batch-tasks/BatchTaskProjectActionsView.tsx +45 -35
  43. package/src/batch-tasks/batchTaskUi.tsx +0 -29
  44. package/src/bottom-panel/BottomPanelView.test.tsx +43 -0
  45. package/src/bottom-panel/BottomPanelView.tsx +222 -0
  46. package/src/bottom-panel/index.ts +26 -0
  47. package/src/chat/AgentAvatarView.tsx +1 -1
  48. package/src/chat/AnnotationViews.tsx +107 -0
  49. package/src/chat/AskUserQuestionView.tsx +18 -11
  50. package/src/chat/AssistantMessageView.tsx +48 -13
  51. package/src/chat/AtPanelView.test.tsx +61 -0
  52. package/src/chat/AtPanelView.tsx +63 -38
  53. package/src/chat/BashTerminalCard.tsx +1 -2
  54. package/src/chat/ChatHeaderActionsView.tsx +74 -18
  55. package/src/chat/CompactionStepView.test.tsx +34 -0
  56. package/src/chat/CompactionStepView.tsx +85 -0
  57. package/src/chat/ExecutionModeSelectorView.tsx +20 -5
  58. package/src/chat/HeaderActionBarView.tsx +731 -0
  59. package/src/chat/HeaderActionOverflowMenu.tsx +137 -0
  60. package/src/chat/InlineModelPicker.test.tsx +81 -0
  61. package/src/chat/InlineModelPicker.tsx +201 -0
  62. package/src/chat/InlineTokenChip.tsx +2 -68
  63. package/src/chat/InputBarBackground.tsx +1 -1
  64. package/src/chat/InputBarPlaceholder.tsx +26 -3
  65. package/src/chat/LiveThinkingView.tsx +51 -37
  66. package/src/chat/MessageBoundaryViews.tsx +21 -0
  67. package/src/chat/MessageFeedContext.tsx +13 -5
  68. package/src/chat/MessageFeedLayoutView.tsx +28 -3
  69. package/src/chat/MessageFeedView.test.tsx +81 -0
  70. package/src/chat/MessageFeedView.tsx +72 -152
  71. package/src/chat/MessageInputView.tsx +1 -1
  72. package/src/chat/MessageLayoutView.tsx +1 -1
  73. package/src/chat/MessageSelectionContextMenuView.tsx +4 -1
  74. package/src/chat/MessageTimelineView.tsx +1 -1
  75. package/src/chat/MessageView.tsx +1 -1
  76. package/src/chat/MessageVisualView.tsx +1 -1
  77. package/src/chat/ModelConfiguration.tsx +283 -0
  78. package/src/chat/ModelSelectorTrigger.tsx +63 -0
  79. package/src/chat/ModelSelectorView.tsx +1037 -223
  80. package/src/chat/NewSession.ts +1 -37
  81. package/src/chat/NewSessionPicker.tsx +3 -2
  82. package/src/chat/ProjectSelectorView.tsx +3 -2
  83. package/src/chat/ReasoningStepSlider.tsx +61 -0
  84. package/src/chat/RemoteSessionBadgeView.tsx +24 -0
  85. package/src/chat/SkillPromptAreaView.tsx +5 -19
  86. package/src/chat/TeamMemberReplyCardView.test.tsx +33 -0
  87. package/src/chat/TeamMemberReplyCardView.tsx +133 -0
  88. package/src/chat/TextBlockView.tsx +7 -770
  89. package/src/chat/TodoProgress.tsx +25 -53
  90. package/src/chat/TodoStatusBarView.tsx +14 -5
  91. package/src/chat/UserMessageView.tsx +113 -33
  92. package/src/chat/header-action-narrow.test.ts +21 -0
  93. package/src/chat/header-action-narrow.ts +38 -0
  94. package/src/chat/index.ts +32 -27
  95. package/src/chat/markdown-link.ts +7 -279
  96. package/src/chat/send-button.css +4 -22
  97. package/src/chat/streaming-reveal.test.ts +218 -0
  98. package/src/chat/streaming-reveal.ts +13 -0
  99. package/src/file-explorer/ConfirmDeleteDialogView.tsx +2 -1
  100. package/src/file-explorer/FileContextMenuView.tsx +44 -11
  101. package/src/file-explorer/FileExplorerSettingsView.tsx +97 -0
  102. package/src/file-explorer/FileTreeCreateRow.tsx +1 -1
  103. package/src/file-explorer/FileTreeNodeView.tsx +59 -18
  104. package/src/file-explorer/FileTreeView.tsx +236 -129
  105. package/src/file-explorer/file-tree-dom.ts +23 -0
  106. package/src/file-explorer/file-tree-rows.test.ts +74 -0
  107. package/src/file-explorer/file-tree-rows.ts +168 -0
  108. package/src/file-explorer/index.ts +17 -0
  109. package/src/file-explorer/types.ts +3 -0
  110. package/src/file-explorer/useFileTreeMarqueeSelection.ts +24 -16
  111. package/src/file-preview/FilePreviewDialogView.tsx +2 -2
  112. package/src/file-preview/FilePreviewView.tsx +12 -2
  113. package/src/file-preview/TextFileEditorView.tsx +2 -1
  114. package/src/index.ts +1 -0
  115. package/src/knowledge/KnowledgeHowItWorksDialogView.tsx +1 -1
  116. package/src/layout/AppFrame.tsx +3 -2
  117. package/src/layout/MainContentFrame.tsx +7 -2
  118. package/src/layout/ResizeHandle.tsx +68 -17
  119. package/src/layout/SidebarDock.tsx +75 -19
  120. package/src/layout/SidebarOverlay.tsx +1 -1
  121. package/src/layout/index.ts +1 -1
  122. package/src/layout/resize-handle-axis.test.ts +51 -0
  123. package/src/live-indicators.test.ts +43 -0
  124. package/src/markdown/CodeBlock.tsx +123 -0
  125. package/src/markdown/InlineTokenChip.tsx +68 -0
  126. package/src/markdown/MarkdownContent.tsx +411 -0
  127. package/src/markdown/MarkdownImage.tsx +51 -0
  128. package/src/markdown/MathFormula.tsx +46 -0
  129. package/src/markdown/MermaidBlock.tsx +43 -0
  130. package/src/markdown/RichCodeBlock.tsx +127 -0
  131. package/src/markdown/SvgPreview.tsx +45 -0
  132. package/src/markdown/WebsiteIcon.tsx +94 -0
  133. package/src/markdown/builtin-renderers.tsx +43 -0
  134. package/src/markdown/definition.tsx +49 -0
  135. package/src/markdown/host.tsx +18 -0
  136. package/src/markdown/index.ts +11 -0
  137. package/src/markdown/inline-tokens.ts +187 -0
  138. package/src/markdown/markdown-link.ts +279 -0
  139. package/src/markdown/math-client.ts +116 -0
  140. package/src/markdown/math-render.ts +23 -0
  141. package/src/markdown/math-syntax.ts +80 -0
  142. package/src/markdown/math.worker.ts +16 -0
  143. package/src/markdown/nodes.ts +15 -0
  144. package/src/markdown/preview-policy.ts +43 -0
  145. package/src/markdown/rich-labels.ts +49 -0
  146. package/src/markdown/rich-syntax.ts +93 -0
  147. package/src/markdown/stable-blocks.test.ts +90 -0
  148. package/src/markdown/stable-blocks.ts +124 -0
  149. package/src/markdown/streaming-reveal.ts +297 -0
  150. package/src/markdown/streaming.test.ts +57 -0
  151. package/src/markdown/streaming.ts +211 -0
  152. package/src/markdown/use-render-snapshot.ts +24 -0
  153. package/src/markdown/use-rich-visibility.ts +24 -0
  154. package/src/overlays/CommandMenuRow.tsx +38 -9
  155. package/src/overlays/CommandMenuView.tsx +77 -117
  156. package/src/overlays/ConfirmDialogView.tsx +25 -20
  157. package/src/overlays/ReleaseNoteMarkdown.tsx +29 -0
  158. package/src/overlays/SplashOptionRow.tsx +46 -0
  159. package/src/overlays/SplashPanel.tsx +85 -0
  160. package/src/overlays/SplashParts.tsx +213 -0
  161. package/src/overlays/UpdateCheckerView.tsx +34 -18
  162. package/src/overlays/UpdateRestartDialogView.tsx +139 -54
  163. package/src/overlays/command-menu-types.ts +2 -0
  164. package/src/overlays/command-menu.css +1 -20
  165. package/src/overlays/index.ts +14 -1
  166. package/src/plugin-ui/index.ts +8 -0
  167. package/src/project/ConversationTagDotsView.tsx +1 -1
  168. package/src/project/ConversationTagEditorDialogView.tsx +4 -1
  169. package/src/project/DefaultConversationSectionView.tsx +4 -4
  170. package/src/project/DefaultSessionListView.tsx +5 -31
  171. package/src/project/DefaultSessionRowView.tsx +106 -55
  172. package/src/project/ManageSessionsSplashView.tsx +439 -0
  173. package/src/project/NewProjectDialogView.tsx +3 -10
  174. package/src/project/ProjectContextMenuView.tsx +30 -139
  175. package/src/project/ProjectDetailPageView.test.tsx +140 -0
  176. package/src/project/ProjectDetailPageView.tsx +372 -165
  177. package/src/project/ProjectGroupView.tsx +1 -1
  178. package/src/project/ProjectRowView.tsx +29 -12
  179. package/src/project/ProjectSessionsView.tsx +25 -47
  180. package/src/project/QuickScrollOverlay.tsx +1 -1
  181. package/src/project/SessionContextMenuView.tsx +15 -7
  182. package/src/project/SessionRowMoreButton.tsx +50 -0
  183. package/src/project/SessionRowView.tsx +106 -63
  184. package/src/project/SessionTitleMarquee.tsx +54 -0
  185. package/src/project/SidebarProjectDisclosure.tsx +60 -0
  186. package/src/project/SidebarProjectsSectionView.tsx +6 -1
  187. package/src/project/index.ts +12 -0
  188. package/src/project/session-row-transition.ts +9 -0
  189. package/src/project/types.ts +4 -2
  190. package/src/project/useActiveSessionAutoScroll.ts +10 -4
  191. package/src/registry.ts +0 -2
  192. package/src/scheduler/AutomationDetailPaneView.tsx +68 -0
  193. package/src/scheduler/AutomationPageView.tsx +118 -121
  194. package/src/scheduler/ExecutionHistoryView.tsx +7 -5
  195. package/src/scheduler/TaskListView.tsx +52 -201
  196. package/src/scheduler/index.ts +7 -12
  197. package/src/settings/AchievementSettingsView.tsx +0 -1
  198. package/src/settings/AppshotSettingsView.tsx +0 -1
  199. package/src/settings/BuiltinMcpSectionView.tsx +1 -1
  200. package/src/settings/EnvironmentGitRowView.tsx +156 -0
  201. package/src/settings/EnvironmentSettingsView.tsx +25 -3
  202. package/src/settings/GeneralSettingsView.tsx +17 -20
  203. package/src/settings/ImChannelGuideDialogView.tsx +2 -2
  204. package/src/settings/ImFeishuDialogView.tsx +1 -1
  205. package/src/settings/ImLegacyImportBannerView.tsx +1 -1
  206. package/src/settings/ImLogDrawerView.tsx +2 -1
  207. package/src/settings/JsonConfigInputView.tsx +171 -0
  208. package/src/settings/ModelsFetchedModelsDrawerView.tsx +292 -0
  209. package/src/settings/ModelsProvidersSectionView.tsx +26 -23
  210. package/src/settings/MotionSelect.tsx +9 -7
  211. package/src/settings/NotificationSettingsView.tsx +79 -0
  212. package/src/settings/PermissionsSettingsView.tsx +3 -7
  213. package/src/settings/PresetProviderModelsListView.tsx +141 -24
  214. package/src/settings/PresetProviderRowView.tsx +205 -182
  215. package/src/settings/ProxySettingsSectionView.tsx +182 -0
  216. package/src/settings/QrBindDialogView.tsx +1 -1
  217. package/src/settings/QuickPanelSettingsSectionView.tsx +0 -2
  218. package/src/settings/RemoteMcpSectionView.tsx +1 -1
  219. package/src/settings/SettingChrome.tsx +2 -2
  220. package/src/settings/SettingsAiAssistButtonView.tsx +9 -119
  221. package/src/settings/SettingsFormFields.tsx +4 -7
  222. package/src/settings/SettingsSidebarView.tsx +64 -3
  223. package/src/settings/ShortcutRecorderView.test.tsx +108 -0
  224. package/src/settings/ShortcutRecorderView.tsx +15 -9
  225. package/src/settings/ShortcutsSettingsView.tsx +1 -1
  226. package/src/settings/SpaceEditorDialogView.tsx +120 -0
  227. package/src/settings/SpacesSettingsView.tsx +105 -0
  228. package/src/settings/WebhookEndpointListView.tsx +4 -5
  229. package/src/settings/index.ts +41 -29
  230. package/src/shared/ActivityStatusDot.tsx +69 -0
  231. package/src/shared/AvatarStackView.tsx +13 -13
  232. package/src/shared/BotAvatar.tsx +11 -9
  233. package/src/shared/CodeBlockCopyButton.tsx +1 -1
  234. package/src/shared/ContextMenuView.tsx +4 -11
  235. package/src/shared/MarkdownTable.tsx +2 -2
  236. package/src/shared/SyntaxHighlightedCode.tsx +0 -0
  237. package/src/shared/TabBar.outline.test.tsx +59 -0
  238. package/src/shared/TabBar.tsx +22 -17
  239. package/src/shared/VettaKbd.test.tsx +52 -0
  240. package/src/shared/VettaKbd.tsx +81 -0
  241. package/src/shared/connected-tab-outline.test.ts +2 -2
  242. package/src/shared/connected-tab-outline.ts +2 -1
  243. package/src/shared/index.ts +6 -0
  244. package/src/shared/kbd-keys.test.ts +61 -0
  245. package/src/shared/kbd-keys.ts +253 -0
  246. package/src/shared/provider-icon/icons.ts +4 -2
  247. package/src/shared/provider-icon/index.tsx +1 -1
  248. package/src/shared/provider-icon/magpie.svg +1 -0
  249. package/src/sidebar/AddProjectMenuTriggerView.tsx +25 -15
  250. package/src/sidebar/DefaultSidebar.tsx +3 -1
  251. package/src/sidebar/MessageCenterDialogView.tsx +3 -2
  252. package/src/sidebar/MessageCenterEmptyState.tsx +1 -1
  253. package/src/sidebar/MessageCenterTabs.tsx +1 -1
  254. package/src/sidebar/MessageCenterToolbarButton.tsx +1 -1
  255. package/src/sidebar/MessageCenterTriggerView.tsx +2 -2
  256. package/src/sidebar/ProjectsPanelEmptyState.tsx +26 -7
  257. package/src/sidebar/SessionStatusIcon.tsx +16 -1
  258. package/src/sidebar/SettingsMenuThemeSection.tsx +1 -1
  259. package/src/sidebar/SettingsMenuTriggerView.test.tsx +42 -0
  260. package/src/sidebar/SettingsMenuTriggerView.tsx +28 -50
  261. package/src/sidebar/ShowMoreSessionsButton.tsx +1 -1
  262. package/src/sidebar/SidebarFilterSelectView.tsx +8 -16
  263. package/src/sidebar/SidebarNavBadgeView.tsx +1 -1
  264. package/src/sidebar/SidebarNavIcon.tsx +1 -1
  265. package/src/sidebar/SidebarNavItemButton.tsx +1 -1
  266. package/src/sidebar/SidebarNavMorePanel.tsx +19 -7
  267. package/src/sidebar/SidebarNavigation.tsx +24 -15
  268. package/src/sidebar/SidebarPanel.tsx +11 -2
  269. package/src/sidebar/SidebarSectionTriggerLabel.tsx +20 -0
  270. package/src/sidebar/SidebarTopBar.tsx +10 -7
  271. package/src/sidebar/WaitingPulseBadge.tsx +19 -0
  272. package/src/sidebar/index.ts +1 -16
  273. package/src/skills/index.ts +0 -19
  274. package/src/skills/skill-icon.tsx +4 -8
  275. package/src/styles.css +24 -6
  276. package/src/chat/DefaultSceneCarousel.tsx +0 -113
  277. package/src/chat/SceneCard.tsx +0 -138
  278. package/src/scheduler/HistoryDrawerView.tsx +0 -149
  279. package/src/scheduler/TaskFormDialogView.tsx +0 -60
  280. package/src/settings/SubscriptionActionsView.tsx +0 -63
  281. package/src/settings/SubscriptionCardsView.tsx +0 -212
  282. package/src/settings/TeamDetailView.tsx +0 -148
  283. package/src/settings/TeamDialogsView.tsx +0 -151
  284. package/src/settings/TeamListView.tsx +0 -57
  285. package/src/settings/TeamSettingsView.tsx +0 -51
  286. package/src/settings/TokenActivityChartView.tsx +0 -286
  287. package/src/settings/UsageStatsView.tsx +0 -101
  288. package/src/settings/shouldCloseEmptyApiKeyEditor.test.ts +0 -135
  289. package/src/settings/shouldCloseEmptyApiKeyEditor.ts +0 -40
  290. package/src/settings/token-activity.test.ts +0 -195
  291. package/src/settings/token-activity.ts +0 -320
  292. package/src/sidebar/AddProjectMenuItem.tsx +0 -21
  293. package/src/sidebar/AddProjectMenuPopoverView.tsx +0 -52
  294. package/src/sidebar/NotificationMessageListView.tsx +0 -136
  295. package/src/sidebar/SettingsMenuAccountSection.tsx +0 -32
  296. package/src/sidebar/SettingsMenuQuotaSection.tsx +0 -45
  297. package/src/skills/SceneCardView.tsx +0 -194
  298. package/src/skills/SkillCardView.tsx +0 -186
  299. package/src/skills/SkillDetailDialogView.tsx +0 -138
  300. package/src/skills/SkillTagGroupView.tsx +0 -56
  301. package/src/skills/SkillToggleSwitch.tsx +0 -31
@@ -1,219 +1,70 @@
1
- import type { JSX, MouseEvent } from "react";
2
- import { motion } from "motion/react";
1
+ import { cn } from "@vetta-org/ui";
2
+ import type { JSX } from "react";
3
+
4
+ /** active 已开启、running 运行中、paused 已暂停、suspended 目标失效而暂停、done 一次性任务已完成。 */
5
+ export type TaskListItemTone = "active" | "running" | "paused" | "suspended" | "done";
3
6
 
4
7
  export interface TaskListItemView {
5
- readonly cron: string;
6
- readonly enabled: boolean;
7
- readonly executionModeLabel: string;
8
8
  readonly id: string;
9
- readonly isOnce: boolean;
10
- readonly isRunning: boolean;
11
- readonly isSelected: boolean;
12
- readonly lastRunLabel: string;
13
- readonly lastRunStatus: "success" | "failed" | null;
14
9
  readonly name: string;
15
- readonly prompt: string;
16
- readonly scheduleLabel: string;
17
- readonly statusLabel: string;
18
- }
19
-
20
- export interface TaskListViewLabels {
21
- readonly delete: string;
22
- readonly edit: string;
23
- readonly enable: string;
24
- readonly failed: string;
25
- readonly once: string;
26
- readonly pause: string;
27
- readonly runNow: string;
28
- readonly success: string;
10
+ /** 第二行,如「每天 9:00 · 下次运行 18 小时后」。 */
11
+ readonly subtitle: string;
12
+ readonly tone: TaskListItemTone;
13
+ readonly isSelected: boolean;
29
14
  }
30
15
 
31
16
  export interface TaskListViewProps {
32
17
  readonly items: readonly TaskListItemView[];
33
- readonly labels: TaskListViewLabels;
34
- readonly onDeleteTask: (taskId: string) => void;
35
- readonly onEditTask: (taskId: string) => void;
36
- readonly onRunTask: (taskId: string) => void;
18
+ /** 筛选或搜索后为空时的提示;无任务时由页面展示推荐模板,传 undefined 即不显示。 */
19
+ readonly emptyLabel?: string;
37
20
  readonly onSelectTask: (id: string) => void;
38
- readonly onToggleTask: (taskId: string) => void;
39
21
  }
40
22
 
41
- export function TaskListView({
42
- items,
43
- labels,
44
- onDeleteTask,
45
- onEditTask,
46
- onRunTask,
47
- onSelectTask,
48
- onToggleTask,
49
- }: TaskListViewProps): JSX.Element {
23
+ const TONE_ICON: Record<TaskListItemTone, string> = {
24
+ active: "icon-[mdi--circle-outline] text-primary",
25
+ running: "icon-[mdi--progress-clock] text-primary",
26
+ paused: "icon-[mdi--pause-circle-outline] text-muted-foreground/60",
27
+ suspended: "icon-[mdi--alert-circle-outline] text-amber-500",
28
+ done: "icon-[mdi--check-circle-outline] text-muted-foreground/60",
29
+ };
30
+
31
+ /** 单行列表:状态圆点 + 名称 + 计划摘要。只有背景色过渡,没有位移或缩放动画。 */
32
+ export function TaskListView({ items, emptyLabel, onSelectTask }: TaskListViewProps): JSX.Element {
33
+ if (items.length === 0) {
34
+ return emptyLabel ? (
35
+ <p className="px-3 py-8 text-center text-[13px] text-muted-foreground/60">{emptyLabel}</p>
36
+ ) : (
37
+ <></>
38
+ );
39
+ }
50
40
  return (
51
- <motion.div
52
- className="grid grid-cols-3 gap-4"
53
- initial="hidden"
54
- animate="show"
55
- variants={{
56
- hidden: {},
57
- show: { transition: { staggerChildren: 0.05 } },
58
- }}
59
- >
41
+ <ul className="flex flex-col gap-1">
60
42
  {items.map((item) => (
61
- <motion.div
62
- key={item.id}
63
- layout
64
- variants={{
65
- hidden: { opacity: 0, y: 14, scale: 0.96 },
66
- show: { opacity: 1, y: 0, scale: 1 },
67
- }}
68
- transition={{ type: "spring", stiffness: 320, damping: 26 }}
69
- whileHover={{ y: -2 }}
70
- onClick={() => onSelectTask(item.id)}
71
- className={`group relative flex cursor-pointer flex-col overflow-hidden rounded-2xl p-5 transition-colors duration-300 ${
72
- item.isSelected ? "bg-primary/10 ring-1 ring-inset ring-primary/30" : "bg-card hover:bg-accent"
73
- }`}
74
- >
75
- <div className="relative flex items-start gap-2.5">
76
- <div className="mt-1 flex h-2 w-2 shrink-0">
77
- <span className="relative inline-flex h-2 w-2">
78
- {item.isRunning && (
79
- <span className="absolute inline-flex h-full w-full animate-ping rounded-full bg-emerald-400 opacity-60" />
43
+ <li key={item.id}>
44
+ <button
45
+ type="button"
46
+ aria-current={item.isSelected ? "true" : undefined}
47
+ onClick={() => onSelectTask(item.id)}
48
+ className={cn(
49
+ "flex w-full items-start gap-3 rounded-lg px-3 py-2.5 text-left transition-colors",
50
+ item.isSelected ? "bg-primary/10" : "hover:bg-accent/50",
51
+ )}
52
+ >
53
+ <span aria-hidden="true" className={cn(TONE_ICON[item.tone], "mt-0.5 h-4 w-4 shrink-0")} />
54
+ <span className="min-w-0 flex-1">
55
+ <span
56
+ className={cn(
57
+ "block truncate text-[14px]",
58
+ item.tone === "paused" || item.tone === "done" ? "text-muted-foreground" : "text-foreground",
80
59
  )}
81
- <span
82
- className={`relative inline-flex h-2 w-2 rounded-full ${
83
- item.isRunning ? "bg-emerald-500" : item.enabled ? "bg-primary" : "bg-muted-foreground/40"
84
- }`}
85
- />
60
+ >
61
+ {item.name}
86
62
  </span>
87
- </div>
88
- <div className="min-w-0 flex-1">
89
- <h3 className="truncate text-[14px] font-semibold tracking-tight text-foreground">{item.name}</h3>
90
- <p className="mt-0.5 truncate text-[11px] text-muted-foreground/50">
91
- {item.statusLabel}
92
- {item.isOnce && ` · ${labels.once}`}
93
- </p>
94
- </div>
95
-
96
- <div
97
- className={`flex items-center gap-0.5 transition-opacity duration-200 ${
98
- item.isSelected ? "opacity-100" : "opacity-0 group-hover:opacity-100"
99
- }`}
100
- >
101
- <ActionButton
102
- icon="icon-[mdi--play]"
103
- title={labels.runNow}
104
- onClick={(event) => {
105
- event.stopPropagation();
106
- onRunTask(item.id);
107
- }}
108
- />
109
- <ActionButton
110
- icon={item.enabled ? "icon-[mdi--pause]" : "icon-[mdi--play-outline]"}
111
- title={item.enabled ? labels.pause : labels.enable}
112
- onClick={(event) => {
113
- event.stopPropagation();
114
- onToggleTask(item.id);
115
- }}
116
- />
117
- <ActionButton
118
- icon="icon-[mdi--pencil-outline]"
119
- title={labels.edit}
120
- onClick={(event) => {
121
- event.stopPropagation();
122
- onEditTask(item.id);
123
- }}
124
- />
125
- <ActionButton
126
- icon="icon-[mdi--delete-outline]"
127
- title={labels.delete}
128
- variant="danger"
129
- onClick={(event) => {
130
- event.stopPropagation();
131
- onDeleteTask(item.id);
132
- }}
133
- />
134
- </div>
135
- </div>
136
-
137
- <div className="relative mt-4 flex items-center gap-2 rounded-xl border border-border/30 bg-background/40 px-3 py-2.5">
138
- <div className="flex h-7 w-7 shrink-0 items-center justify-center rounded-lg bg-primary/10 ring-1 ring-inset ring-primary/15">
139
- <span className="icon-[mdi--clock-time-eight-outline] h-3.5 w-3.5 text-primary" />
140
- </div>
141
- <div className="min-w-0 flex-1">
142
- <p className="truncate text-[12px] font-medium text-foreground">{item.scheduleLabel}</p>
143
- <p className="mt-0.5 truncate font-mono text-[10px] text-muted-foreground/50">{item.cron}</p>
144
- </div>
145
- </div>
146
-
147
- <div className="relative mt-3 flex-1">
148
- <p className="line-clamp-2 text-[12px] leading-relaxed text-muted-foreground/70">{item.prompt}</p>
149
- </div>
150
-
151
- <div className="relative mt-4 flex flex-wrap items-center gap-1.5 border-t border-border/30 pt-3 text-[11px]">
152
- <MetaPill icon="icon-[mdi--shield-outline]" text={item.executionModeLabel} />
153
- <div className="ml-auto flex items-center gap-1.5">
154
- {item.lastRunStatus && (
155
- <span
156
- className={`flex h-5 items-center gap-1 rounded-full px-2 text-[10px] font-medium ${
157
- item.lastRunStatus === "success"
158
- ? "bg-emerald-500/10 text-emerald-400"
159
- : "bg-destructive/10 text-destructive"
160
- }`}
161
- >
162
- <span
163
- className={`h-3 w-3 ${
164
- item.lastRunStatus === "success" ? "icon-[mdi--check-circle]" : "icon-[mdi--alert-circle]"
165
- }`}
166
- />
167
- {item.lastRunStatus === "success" ? labels.success : labels.failed}
168
- </span>
169
- )}
170
- <span className="flex items-center gap-1 text-muted-foreground/50">
171
- <span className="icon-[mdi--history] h-3 w-3" />
172
- {item.lastRunLabel}
173
- </span>
174
- </div>
175
- </div>
176
- </motion.div>
63
+ <span className="mt-0.5 block truncate text-[12px] text-muted-foreground/70">{item.subtitle}</span>
64
+ </span>
65
+ </button>
66
+ </li>
177
67
  ))}
178
- </motion.div>
179
- );
180
- }
181
-
182
- function MetaPill({ icon, text }: { readonly icon: string; readonly text: string }): JSX.Element {
183
- return (
184
- <span className="flex h-5 items-center gap-1 rounded-full bg-accent/40 px-2 text-[10px] text-muted-foreground/70">
185
- <span className={`${icon} h-3 w-3 opacity-70`} />
186
- <span className="max-w-[110px] truncate">{text}</span>
187
- </span>
188
- );
189
- }
190
-
191
- function ActionButton({
192
- icon,
193
- title,
194
- variant,
195
- onClick,
196
- }: {
197
- readonly icon: string;
198
- readonly title: string;
199
- readonly variant?: "danger";
200
- readonly onClick: (event: MouseEvent) => void;
201
- }): JSX.Element {
202
- return (
203
- <motion.button
204
- type="button"
205
- title={title}
206
- onClick={onClick}
207
- whileHover={{ scale: 1.04 }}
208
- whileTap={{ scale: 0.94 }}
209
- transition={{ type: "spring", stiffness: 400, damping: 22 }}
210
- className={`flex h-7 w-7 items-center justify-center rounded-lg transition-colors duration-150 ${
211
- variant === "danger"
212
- ? "text-muted-foreground/60 hover:bg-destructive/10 hover:text-destructive"
213
- : "text-muted-foreground/60 hover:bg-primary/10 hover:text-primary"
214
- }`}
215
- >
216
- <span className={`${icon} text-[14px]`} />
217
- </motion.button>
68
+ </ul>
218
69
  );
219
70
  }
@@ -1,4 +1,10 @@
1
1
  export type {
2
+ AutomationDetailPaneViewProps,
3
+ AutomationDetailStatusTone,
4
+ } from "./AutomationDetailPaneView";
5
+ export { AutomationDetailPaneView } from "./AutomationDetailPaneView";
6
+ export type {
7
+ AutomationFilterTab,
2
8
  AutomationPageViewLabels,
3
9
  AutomationPageViewProps,
4
10
  AutomationRecommendationItem,
@@ -12,19 +18,8 @@ export type {
12
18
  } from "./ExecutionHistoryView";
13
19
  export { ExecutionHistoryView } from "./ExecutionHistoryView";
14
20
  export type {
15
- HistoryDrawerTaskView,
16
- HistoryDrawerViewLabels,
17
- HistoryDrawerViewProps,
18
- } from "./HistoryDrawerView";
19
- export { HistoryDrawerView } from "./HistoryDrawerView";
20
- export type {
21
- TaskFormDialogViewLabels,
22
- TaskFormDialogViewProps,
23
- } from "./TaskFormDialogView";
24
- export { TaskFormDialogView } from "./TaskFormDialogView";
25
- export type {
21
+ TaskListItemTone,
26
22
  TaskListItemView,
27
- TaskListViewLabels,
28
23
  TaskListViewProps,
29
24
  } from "./TaskListView";
30
25
  export { TaskListView } from "./TaskListView";
@@ -32,7 +32,6 @@ export function AchievementSettingsView({
32
32
  value={selectedSetId}
33
33
  onValueChange={onSelectSetId}
34
34
  options={setOptions.map((set) => ({ value: set.id, label: set.label }))}
35
- triggerClassName="min-w-40"
36
35
  aria-label={setSelectorLabel}
37
36
  />
38
37
  </div>
@@ -94,7 +94,6 @@ export function AppshotSettingsView({
94
94
  value={gestureValue}
95
95
  onValueChange={onGestureChange}
96
96
  options={gestureOptions}
97
- triggerClassName="min-w-[150px]"
98
97
  />
99
98
  </SettingRow>
100
99
  </SettingSection>
@@ -143,7 +143,7 @@ function BuiltinMcpCard({
143
143
  <div className="mt-auto flex justify-end pt-1">
144
144
  {added ? (
145
145
  discover ? (
146
- <Button variant="outline" size="sm" disabled className="opacity-80">
146
+ <Button variant="field" disabled className="opacity-80">
147
147
  <span className="icon-[mdi--check] h-3.5 w-3.5 text-emerald-400" />
148
148
  {labels.added}
149
149
  </Button>
@@ -0,0 +1,156 @@
1
+ import type { JSX } from "react";
2
+ import { SettingRow } from "./SettingChrome";
3
+
4
+ export type EnvironmentGitInstallGuideView =
5
+ | { readonly kind: "xcode-clt" }
6
+ | { readonly kind: "managed-download"; readonly version: string }
7
+ | { readonly kind: "package-manager"; readonly command: string | null }
8
+ | { readonly kind: "manual" };
9
+
10
+ export interface EnvironmentGitStatusView {
11
+ readonly available: boolean;
12
+ readonly source?: "managed" | "system";
13
+ readonly version?: string;
14
+ readonly install: EnvironmentGitInstallGuideView;
15
+ }
16
+
17
+ export interface EnvironmentGitViewLabels {
18
+ readonly copied: string;
19
+ readonly copy: string;
20
+ readonly description: string;
21
+ readonly detecting: string;
22
+ readonly download: string;
23
+ readonly installManaged: string;
24
+ readonly installXcode: string;
25
+ readonly installing: string;
26
+ readonly managedHint: string;
27
+ readonly managedSuffix: string;
28
+ readonly manualHint: string;
29
+ readonly missing: string;
30
+ readonly packageManagerFallback: string;
31
+ readonly packageManagerHint: string;
32
+ readonly ready: string;
33
+ readonly redetect: string;
34
+ readonly xcodeHint: string;
35
+ readonly xcodeLaunched: string;
36
+ }
37
+
38
+ export interface EnvironmentGitRowViewProps {
39
+ readonly busy: "detect" | "install" | null;
40
+ readonly commandCopied: boolean;
41
+ readonly installerLaunched: boolean;
42
+ readonly labels: EnvironmentGitViewLabels;
43
+ readonly onCopyCommand: (command: string) => void;
44
+ readonly onInstall: () => void;
45
+ readonly onOpenDownload: () => void;
46
+ readonly onRedetect: () => void;
47
+ readonly status: EnvironmentGitStatusView;
48
+ }
49
+
50
+ const BUTTON_CLASS =
51
+ "flex items-center gap-1.5 rounded-lg border border-input bg-secondary px-3 py-1.5 text-[12px] text-foreground transition-colors hover:bg-accent disabled:opacity-50";
52
+ const LINK_CLASS = "text-primary underline-offset-2 hover:underline";
53
+
54
+ function GitInstallHint({
55
+ commandCopied,
56
+ installerLaunched,
57
+ labels,
58
+ onCopyCommand,
59
+ onOpenDownload,
60
+ status,
61
+ }: EnvironmentGitRowViewProps): JSX.Element {
62
+ const guide = status.install;
63
+ if (guide.kind === "xcode-clt") {
64
+ return <p>{installerLaunched ? labels.xcodeLaunched : labels.xcodeHint}</p>;
65
+ }
66
+ if (guide.kind === "managed-download") {
67
+ return (
68
+ <p>
69
+ {labels.managedHint}{" "}
70
+ <button type="button" className={LINK_CLASS} onClick={onOpenDownload}>
71
+ {labels.download}
72
+ </button>
73
+ </p>
74
+ );
75
+ }
76
+ if (guide.kind === "package-manager" && guide.command) {
77
+ const { command } = guide;
78
+ return (
79
+ <div className="space-y-2">
80
+ <p>{labels.packageManagerHint}</p>
81
+ <div className="flex items-center gap-2">
82
+ <code className="min-w-0 flex-1 truncate rounded-md bg-muted px-2.5 py-1.5 font-mono text-[12px] text-foreground">
83
+ {command}
84
+ </code>
85
+ <button type="button" className={BUTTON_CLASS} onClick={() => onCopyCommand(command)}>
86
+ <span className="icon-[mdi--content-copy] h-3.5 w-3.5 text-muted-foreground" />
87
+ {commandCopied ? labels.copied : labels.copy}
88
+ </button>
89
+ </div>
90
+ </div>
91
+ );
92
+ }
93
+ return (
94
+ <p>
95
+ {guide.kind === "package-manager" ? labels.packageManagerFallback : labels.manualHint}{" "}
96
+ <button type="button" className={LINK_CLASS} onClick={onOpenDownload}>
97
+ {labels.download}
98
+ </button>
99
+ </p>
100
+ );
101
+ }
102
+
103
+ /** Git 行:可用时显示版本与来源,缺失时给出当前平台的安装引导。 */
104
+ export function EnvironmentGitRowView(props: EnvironmentGitRowViewProps): JSX.Element {
105
+ const { busy, labels, onInstall, onRedetect, status } = props;
106
+ const guide = status.install;
107
+ const installLabel =
108
+ guide.kind === "xcode-clt" ? labels.installXcode : guide.kind === "managed-download" ? labels.installManaged : null;
109
+ const readyText = [labels.ready, status.version, status.source === "managed" ? labels.managedSuffix : null]
110
+ .filter(Boolean)
111
+ .join(" · ");
112
+
113
+ return (
114
+ <>
115
+ <SettingRow title="Git" description={labels.description} border={false}>
116
+ <div className="flex items-center gap-3">
117
+ <div className="flex items-center gap-1.5">
118
+ <span
119
+ className={
120
+ status.available
121
+ ? "icon-[mdi--check-circle] h-4 w-4 text-emerald-500"
122
+ : "icon-[mdi--alert-circle-outline] h-4 w-4 text-amber-500"
123
+ }
124
+ />
125
+ <span className={`text-[12px] ${status.available ? "text-emerald-500" : "text-amber-500"}`}>
126
+ {status.available ? readyText : busy === "install" ? labels.installing : labels.missing}
127
+ </span>
128
+ </div>
129
+ {!status.available && installLabel && (
130
+ <button type="button" disabled={busy !== null} onClick={onInstall} className={BUTTON_CLASS}>
131
+ {busy === "install" ? (
132
+ <span className="icon-[mdi--loading] h-3.5 w-3.5 animate-spin" />
133
+ ) : (
134
+ <span className="icon-[mdi--download-outline] h-3.5 w-3.5 text-muted-foreground" />
135
+ )}
136
+ {installLabel}
137
+ </button>
138
+ )}
139
+ {!status.available && (
140
+ <button type="button" disabled={busy !== null} onClick={onRedetect} className={BUTTON_CLASS}>
141
+ <span
142
+ className={`icon-[mdi--refresh] h-3.5 w-3.5 text-muted-foreground ${busy === "detect" ? "animate-spin" : ""}`}
143
+ />
144
+ {busy === "detect" ? labels.detecting : labels.redetect}
145
+ </button>
146
+ )}
147
+ </div>
148
+ </SettingRow>
149
+ {!status.available && (
150
+ <div className="px-5 pb-4 text-[12px] leading-relaxed text-muted-foreground">
151
+ <GitInstallHint {...props} />
152
+ </div>
153
+ )}
154
+ </>
155
+ );
156
+ }
@@ -1,4 +1,11 @@
1
+ import { Button } from "@vetta-org/ui";
1
2
  import type { JSX, ReactNode } from "react";
3
+ import {
4
+ type EnvironmentGitRowViewProps,
5
+ EnvironmentGitRowView,
6
+ type EnvironmentGitStatusView,
7
+ type EnvironmentGitViewLabels,
8
+ } from "./EnvironmentGitRowView";
2
9
  import { SettingRow, SettingSection, type SettingSectionMeta } from "./SettingChrome";
3
10
 
4
11
  export type EnvironmentRuntimeKindView = "node" | "python";
@@ -14,6 +21,7 @@ export interface EnvironmentSettingsViewLabels {
14
21
  readonly fetch: string;
15
22
  readonly fetchAgain: string;
16
23
  readonly fetching: string;
24
+ readonly git: EnvironmentGitViewLabels;
17
25
  readonly loading: string;
18
26
  readonly notReady: string;
19
27
  readonly npmRegistry: string;
@@ -26,6 +34,7 @@ export interface EnvironmentSettingsViewLabels {
26
34
  readonly sections: {
27
35
  readonly mirrors: string;
28
36
  readonly runtime: string;
37
+ readonly tools: string;
29
38
  };
30
39
  readonly title: string;
31
40
  }
@@ -33,6 +42,8 @@ export interface EnvironmentSettingsViewLabels {
33
42
  export interface EnvironmentSettingsViewProps {
34
43
  readonly busy: EnvironmentRuntimeKindView | null;
35
44
  readonly error: string | null;
45
+ /** Git 行的交互状态与回调;状态与文案分别来自 status.git 与 labels.git。 */
46
+ readonly git: Omit<EnvironmentGitRowViewProps, "labels" | "status">;
36
47
  readonly headerAction?: ReactNode;
37
48
  readonly labels: EnvironmentSettingsViewLabels;
38
49
  readonly mirrors?: {
@@ -41,10 +52,12 @@ export interface EnvironmentSettingsViewProps {
41
52
  } | null;
42
53
  readonly onReinstall: (kind: EnvironmentRuntimeKindView) => void;
43
54
  readonly runtimeSection: SettingSectionMeta;
55
+ readonly toolsSection: SettingSectionMeta;
44
56
  readonly mirrorsSection: SettingSectionMeta;
45
57
  readonly status: {
46
58
  readonly node: EnvironmentRuntimeStatusView;
47
59
  readonly python: EnvironmentRuntimeStatusView;
60
+ readonly git: EnvironmentGitStatusView;
48
61
  } | null;
49
62
  }
50
63
 
@@ -94,11 +107,10 @@ function RuntimeCard({
94
107
  <span className={`text-[12px] ${stateClass}`}>{stateText}</span>
95
108
  </div>
96
109
  {status.supported && (
97
- <button
110
+ <Button variant="field"
98
111
  type="button"
99
112
  disabled={busy}
100
113
  onClick={onReinstall}
101
- className="flex items-center gap-1.5 rounded-lg border border-input bg-secondary px-3 py-1.5 text-[12px] text-foreground transition-colors hover:bg-accent disabled:opacity-50"
102
114
  >
103
115
  {busy ? (
104
116
  <span className="icon-[mdi--loading] h-3.5 w-3.5 animate-spin" />
@@ -106,7 +118,7 @@ function RuntimeCard({
106
118
  <span className="icon-[mdi--download-outline] h-3.5 w-3.5 text-muted-foreground" />
107
119
  )}
108
120
  {status.ready ? labels.fetchAgain : labels.fetch}
109
- </button>
121
+ </Button>
110
122
  )}
111
123
  </div>
112
124
  </SettingRow>
@@ -116,6 +128,7 @@ function RuntimeCard({
116
128
  export function EnvironmentSettingsView({
117
129
  busy,
118
130
  error,
131
+ git,
119
132
  headerAction,
120
133
  labels,
121
134
  mirrors,
@@ -123,6 +136,7 @@ export function EnvironmentSettingsView({
123
136
  onReinstall,
124
137
  runtimeSection,
125
138
  status,
139
+ toolsSection,
126
140
  }: EnvironmentSettingsViewProps): JSX.Element {
127
141
  return (
128
142
  <div className="mx-auto w-full max-w-[680px] px-8 pt-2 pb-4">
@@ -163,6 +177,14 @@ export function EnvironmentSettingsView({
163
177
  )}
164
178
  </SettingSection>
165
179
 
180
+ <SettingSection title={labels.sections.tools} section={toolsSection}>
181
+ {status ? (
182
+ <EnvironmentGitRowView {...git} labels={labels.git} status={status.git} />
183
+ ) : (
184
+ <div className="px-5 py-4 text-[12px] text-muted-foreground">{labels.loading}</div>
185
+ )}
186
+ </SettingSection>
187
+
166
188
  <SettingSection title={labels.sections.mirrors} section={mirrorsSection}>
167
189
  <SettingRow title={labels.npmRegistry} description={labels.npmRegistryDescription} border>
168
190
  <span className="text-[12px] text-muted-foreground">{mirrors?.npmRegistry ?? "—"}</span>