@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
@@ -2,6 +2,7 @@ import type { JSX, ReactNode } from "react";
2
2
  import { Button, Switch } from "@vetta-org/ui";
3
3
  import { MotionSelect } from "./MotionSelect";
4
4
  import { SettingRow, SettingSection, type SettingSectionMeta } from "./SettingChrome";
5
+ import { NotificationSettingsView, type NotificationSettingsViewProps } from "./NotificationSettingsView";
5
6
 
6
7
  export interface GeneralSettingsViewLabels {
7
8
  readonly title: string;
@@ -14,8 +15,6 @@ export interface GeneralSettingsViewLabels {
14
15
  readonly workspaceDescription: string;
15
16
  readonly sandboxTitle: string;
16
17
  readonly sandboxDescription: string;
17
- readonly systemNotifications: string;
18
- readonly systemNotificationsDescription: string;
19
18
  readonly debugMode: string;
20
19
  readonly debugModeDescription: string;
21
20
  readonly exportDiagnostics: string;
@@ -36,6 +35,7 @@ export interface GeneralSettingsViewProps {
36
35
  readonly labels: GeneralSettingsViewLabels;
37
36
  readonly sections: {
38
37
  readonly basics: SettingSectionMeta;
38
+ readonly notifications: SettingSectionMeta;
39
39
  readonly app: SettingSectionMeta;
40
40
  readonly developer: SettingSectionMeta;
41
41
  };
@@ -45,17 +45,18 @@ export interface GeneralSettingsViewProps {
45
45
  /** 与 App 引导同构:description + 右侧 action;有更新时 detail 挂在行下。 */
46
46
  readonly updatesDescription: string;
47
47
  readonly updatesAction: ReactNode;
48
- readonly updatesDetail: ReactNode;
48
+ readonly updatesDetail?: ReactNode;
49
49
  readonly executionMode: string;
50
50
  readonly onExecutionModeChange: (mode: string) => void;
51
51
  readonly sandboxUnavailableReason: string | null;
52
- readonly notificationsEnabled: boolean;
53
- readonly onNotificationsChange: (checked: boolean) => void;
52
+ readonly notifications: Omit<NotificationSettingsViewProps, "section">;
54
53
  readonly debugMode: boolean;
55
54
  readonly onDebugChange: (checked: boolean) => void;
56
55
  readonly exportingDiagnostics: boolean;
57
56
  readonly onExportDiagnostics: () => void;
58
57
  readonly onStartAppGuide: () => void;
58
+ /** 网络代理区块,由宿主注入(需要读 models.json 的服务商列表)。 */
59
+ readonly networkSection?: ReactNode;
59
60
  }
60
61
 
61
62
  /**
@@ -64,6 +65,7 @@ export interface GeneralSettingsViewProps {
64
65
  *
65
66
  * Grouped into 3 sections to reduce one-setting-per-card scatter:
66
67
  * - basics: workspace, sandbox, notifications
68
+ * - network: 应用代理(宿主注入)
67
69
  * - app: updates, setup guide
68
70
  * - developer: debug mode, diagnostics export
69
71
  */
@@ -79,13 +81,13 @@ export function GeneralSettingsView({
79
81
  executionMode,
80
82
  onExecutionModeChange,
81
83
  sandboxUnavailableReason,
82
- notificationsEnabled,
83
- onNotificationsChange,
84
+ notifications,
84
85
  debugMode,
85
86
  onDebugChange,
86
87
  exportingDiagnostics,
87
88
  onExportDiagnostics,
88
89
  onStartAppGuide,
90
+ networkSection,
89
91
  }: GeneralSettingsViewProps): JSX.Element {
90
92
  return (
91
93
  <div className="mx-auto w-full max-w-[680px] px-8 pt-2 pb-4">
@@ -94,15 +96,14 @@ export function GeneralSettingsView({
94
96
  <SettingSection title={labels.sections.basics} section={sections.basics}>
95
97
  <SettingRow title={labels.workspaceTitle} description={labels.workspaceDescription}>
96
98
  <div className="flex items-center gap-2">
97
- <button
99
+ <Button variant="field"
98
100
  type="button"
99
101
  onClick={onSelectWorkspace}
100
- className="flex items-center gap-2 rounded-lg border border-input bg-secondary px-3 py-1.5 text-[12px] text-foreground transition-colors hover:bg-accent"
101
102
  >
102
103
  <span className="icon-[mdi--folder-outline] h-3.5 w-3.5 shrink-0 text-muted-foreground" />
103
104
  <span className="max-w-[180px] truncate">{workspacePath}</span>
104
105
  <span className="icon-[mdi--chevron-down] h-3.5 w-3.5 shrink-0 text-muted-foreground" />
105
- </button>
106
+ </Button>
106
107
  <button
107
108
  type="button"
108
109
  onClick={onResetWorkspace}
@@ -117,7 +118,6 @@ export function GeneralSettingsView({
117
118
  <MotionSelect
118
119
  value={executionMode}
119
120
  onValueChange={onExecutionModeChange}
120
- triggerClassName="min-w-[120px]"
121
121
  options={[
122
122
  { value: "full-access", label: labels.fullAccess },
123
123
  {
@@ -129,15 +129,12 @@ export function GeneralSettingsView({
129
129
  ]}
130
130
  />
131
131
  </SettingRow>
132
- <SettingRow
133
- title={labels.systemNotifications}
134
- description={labels.systemNotificationsDescription}
135
- border={false}
136
- >
137
- <Switch checked={notificationsEnabled} onCheckedChange={onNotificationsChange} />
138
- </SettingRow>
139
132
  </SettingSection>
140
133
 
134
+ <NotificationSettingsView {...notifications} section={sections.notifications} />
135
+
136
+ {networkSection}
137
+
141
138
  <SettingSection title={labels.sections.app} section={sections.app}>
142
139
  {/* 与下方 App 引导同一 SettingRow:左标题+描述,右 outline sm 按钮。 */}
143
140
  <SettingRow
@@ -149,7 +146,7 @@ export function GeneralSettingsView({
149
146
  </SettingRow>
150
147
  {updatesDetail ? <div className="border-b border-border px-5 pb-4">{updatesDetail}</div> : null}
151
148
  <SettingRow title={labels.startAppGuide} description={labels.startAppGuideDescription} border={false}>
152
- <Button size="sm" variant="outline" onClick={onStartAppGuide}>
149
+ <Button variant="field" onClick={onStartAppGuide}>
153
150
  {labels.startAppGuideAction}
154
151
  </Button>
155
152
  </SettingRow>
@@ -164,7 +161,7 @@ export function GeneralSettingsView({
164
161
  description={labels.exportDiagnosticsDescription}
165
162
  border={false}
166
163
  >
167
- <Button size="sm" variant="outline" disabled={exportingDiagnostics} onClick={onExportDiagnostics}>
164
+ <Button variant="field" disabled={exportingDiagnostics} onClick={onExportDiagnostics}>
168
165
  {exportingDiagnostics ? labels.exporting : labels.export}
169
166
  </Button>
170
167
  </SettingRow>
@@ -49,7 +49,7 @@ export function ImChannelGuideDialogView({
49
49
  {/* 弹窗本体固定高度、不滚动:滚动条只出现在下面的内容区,
50
50
  页头与页脚始终可见;overflow-x-hidden 杜绝横向滚动条。 */}
51
51
  <DialogContent className="flex max-h-[min(90vh,760px)] flex-col gap-0 overflow-hidden p-0 sm:max-w-[560px]">
52
- <DialogHeader className="shrink-0 gap-3 border-b border-border px-6 pt-6 pb-5">
52
+ <DialogHeader className="shrink-0 gap-3 px-6 pt-6 pb-5">
53
53
  <div className="flex items-start gap-3.5">
54
54
  <div className="flex h-11 w-11 shrink-0 items-center justify-center rounded-2xl bg-primary/10 text-primary ring-1 ring-primary/15 ring-inset">
55
55
  <span className="icon-[mdi--book-open-page-variant-outline] h-5 w-5" />
@@ -115,7 +115,7 @@ export function ImChannelGuideDialogView({
115
115
  ))}
116
116
  </div>
117
117
 
118
- <DialogFooter className="shrink-0 border-t border-border px-6 py-4">
118
+ <DialogFooter className="mx-0 mb-0 shrink-0 px-6 py-4">
119
119
  <Button variant="primary" onClick={onClose}>
120
120
  {labels.close}
121
121
  </Button>
@@ -142,7 +142,7 @@ export function ImFeishuDialogView({
142
142
  {/* 动作按钮成组,justify-between 才是「说明 | 动作」两端分布,
143
143
  而不是把每个按钮都摊开。 */}
144
144
  <div className="flex items-center gap-2">
145
- <Button variant="outline" onClick={onTest} disabled={testing || !canTest}>
145
+ <Button variant="field" onClick={onTest} disabled={testing || !canTest}>
146
146
  {testing ? labels.testing : labels.testConnection}
147
147
  </Button>
148
148
  <Button variant="primary" onClick={onSave} disabled={!canSave || saving}>
@@ -35,7 +35,7 @@ export function ImLegacyImportBannerView({
35
35
  <Button variant="primary" size="sm" onClick={onImport} disabled={importDisabled}>
36
36
  {importLabel}
37
37
  </Button>
38
- <Button variant="outline" size="sm" onClick={onSkip}>
38
+ <Button variant="field" onClick={onSkip}>
39
39
  {skipLabel}
40
40
  </Button>
41
41
  </div>
@@ -1,6 +1,7 @@
1
1
  import type { JSX } from "react";
2
2
  import { Button, cn } from "@vetta-org/ui";
3
3
  import { SettingHeading, type SettingSectionMeta } from "./SettingChrome";
4
+ import { OVERLAY_BACKDROP_CLASS } from "@vetta-org/ui/utils";
4
5
 
5
6
  export interface ImLogEventView {
6
7
  readonly time: string;
@@ -37,7 +38,7 @@ export function ImLogDrawerView({
37
38
  labels,
38
39
  }: ImLogDrawerViewProps): JSX.Element {
39
40
  return (
40
- <div className="fixed inset-0 z-50 flex justify-end bg-black/40" onClick={onClose}>
41
+ <div className={cn("fixed inset-0 z-50 flex justify-end", OVERLAY_BACKDROP_CLASS)} onClick={onClose}>
41
42
  <div
42
43
  className="flex h-full w-[520px] flex-col border-l border-border bg-background shadow-xl"
43
44
  onClick={(event) => event.stopPropagation()}
@@ -0,0 +1,171 @@
1
+ import { json } from "@codemirror/lang-json";
2
+ import { HighlightStyle, syntaxHighlighting } from "@codemirror/language";
3
+ import { Compartment, EditorState } from "@codemirror/state";
4
+ import { EditorView, placeholder as editorPlaceholder } from "@codemirror/view";
5
+ import { tags } from "@lezer/highlight";
6
+ import { minimalSetup } from "codemirror";
7
+ import { useEffect, useRef, type JSX } from "react";
8
+
9
+ const jsonConfigHighlightStyle = HighlightStyle.define([
10
+ {
11
+ tag: [tags.propertyName, tags.definition(tags.propertyName)],
12
+ color: "var(--foreground)",
13
+ fontWeight: "500",
14
+ },
15
+ {
16
+ tag: [tags.string, tags.number, tags.bool, tags.null],
17
+ color: "color-mix(in srgb, var(--foreground) 82%, var(--primary))",
18
+ },
19
+ {
20
+ tag: [tags.punctuation, tags.brace, tags.squareBracket, tags.separator],
21
+ color: "color-mix(in srgb, var(--muted-foreground) 78%, transparent)",
22
+ },
23
+ ]);
24
+
25
+ const jsonConfigInputTheme = EditorView.theme({
26
+ "&": {
27
+ height: "100%",
28
+ color: "var(--foreground)",
29
+ backgroundColor: "transparent",
30
+ fontSize: "13px",
31
+ },
32
+ "&.cm-focused": {
33
+ outline: "none",
34
+ },
35
+ ".cm-scroller": {
36
+ overflow: "auto",
37
+ overscrollBehavior: "contain",
38
+ fontFamily: "var(--font-sans)",
39
+ lineHeight: "1.55",
40
+ },
41
+ ".cm-content": {
42
+ minHeight: "100%",
43
+ padding: "10px 12px",
44
+ caretColor: "var(--primary)",
45
+ },
46
+ ".cm-line": {
47
+ padding: "0",
48
+ },
49
+ ".cm-placeholder": {
50
+ color: "color-mix(in srgb, var(--muted-foreground) 40%, transparent)",
51
+ fontStyle: "normal",
52
+ },
53
+ ".cm-selectionBackground, &.cm-focused .cm-selectionBackground": {
54
+ backgroundColor: "color-mix(in srgb, var(--primary) 15%, transparent) !important",
55
+ },
56
+ ".cm-cursor, .cm-dropCursor": {
57
+ borderLeftColor: "var(--primary)",
58
+ },
59
+ });
60
+
61
+ export interface JsonConfigInputViewProps {
62
+ readonly value: string;
63
+ readonly onValueChange: (value: string) => void;
64
+ readonly placeholder: string;
65
+ readonly ariaLabel: string;
66
+ readonly ariaInvalid?: boolean;
67
+ readonly ariaDescribedBy?: string;
68
+ }
69
+
70
+ /** A restrained, theme-aware JSON field without IDE chrome or editor-only tools. */
71
+ export function JsonConfigInputView({
72
+ value,
73
+ onValueChange,
74
+ placeholder,
75
+ ariaLabel,
76
+ ariaInvalid = false,
77
+ ariaDescribedBy,
78
+ }: JsonConfigInputViewProps): JSX.Element {
79
+ const hostRef = useRef<HTMLDivElement>(null);
80
+ const viewRef = useRef<EditorView | null>(null);
81
+ const onValueChangeRef = useRef(onValueChange);
82
+ const applyingExternalValueRef = useRef(false);
83
+ const initialValueRef = useRef(value);
84
+ const initialPlaceholderRef = useRef(placeholder);
85
+ const initialAccessibilityRef = useRef({ ariaLabel, ariaInvalid, ariaDescribedBy });
86
+ const accessibilityCompartmentRef = useRef(new Compartment());
87
+ const placeholderCompartmentRef = useRef(new Compartment());
88
+ onValueChangeRef.current = onValueChange;
89
+
90
+ useEffect(() => {
91
+ const host = hostRef.current;
92
+ if (!host) return;
93
+
94
+ const initialAccessibility = initialAccessibilityRef.current;
95
+ const accessibilityAttributes: Record<string, string> = {
96
+ "aria-label": initialAccessibility.ariaLabel,
97
+ "aria-invalid": String(initialAccessibility.ariaInvalid),
98
+ spellcheck: "false",
99
+ autocapitalize: "off",
100
+ autocomplete: "off",
101
+ };
102
+ if (initialAccessibility.ariaDescribedBy) {
103
+ accessibilityAttributes["aria-describedby"] = initialAccessibility.ariaDescribedBy;
104
+ }
105
+
106
+ const state = EditorState.create({
107
+ doc: initialValueRef.current,
108
+ extensions: [
109
+ minimalSetup,
110
+ json(),
111
+ EditorView.lineWrapping,
112
+ jsonConfigInputTheme,
113
+ syntaxHighlighting(jsonConfigHighlightStyle),
114
+ accessibilityCompartmentRef.current.of(EditorView.contentAttributes.of(accessibilityAttributes)),
115
+ placeholderCompartmentRef.current.of(editorPlaceholder(initialPlaceholderRef.current)),
116
+ EditorView.updateListener.of((update) => {
117
+ if (update.docChanged && !applyingExternalValueRef.current) {
118
+ onValueChangeRef.current(update.state.doc.toString());
119
+ }
120
+ }),
121
+ ],
122
+ });
123
+ const view = new EditorView({ state, parent: host });
124
+ viewRef.current = view;
125
+
126
+ return () => {
127
+ view.destroy();
128
+ viewRef.current = null;
129
+ };
130
+ }, []);
131
+
132
+ useEffect(() => {
133
+ const view = viewRef.current;
134
+ if (!view) return;
135
+ const currentValue = view.state.doc.toString();
136
+ if (currentValue === value) return;
137
+ applyingExternalValueRef.current = true;
138
+ try {
139
+ view.dispatch({ changes: { from: 0, to: currentValue.length, insert: value } });
140
+ } finally {
141
+ applyingExternalValueRef.current = false;
142
+ }
143
+ }, [value]);
144
+
145
+ useEffect(() => {
146
+ const view = viewRef.current;
147
+ if (!view) return;
148
+ const accessibilityAttributes: Record<string, string> = {
149
+ "aria-label": ariaLabel,
150
+ "aria-invalid": String(ariaInvalid),
151
+ spellcheck: "false",
152
+ autocapitalize: "off",
153
+ autocomplete: "off",
154
+ };
155
+ if (ariaDescribedBy) accessibilityAttributes["aria-describedby"] = ariaDescribedBy;
156
+ view.dispatch({
157
+ effects: [
158
+ accessibilityCompartmentRef.current.reconfigure(EditorView.contentAttributes.of(accessibilityAttributes)),
159
+ placeholderCompartmentRef.current.reconfigure(editorPlaceholder(placeholder)),
160
+ ],
161
+ });
162
+ }, [ariaDescribedBy, ariaInvalid, ariaLabel, placeholder]);
163
+
164
+ return (
165
+ <div
166
+ ref={hostRef}
167
+ data-invalid={ariaInvalid ? "true" : "false"}
168
+ className="h-72 min-h-40 w-full resize-y overflow-hidden rounded-lg border border-input bg-card text-foreground transition-colors focus-within:border-ring data-[invalid=true]:border-destructive"
169
+ />
170
+ );
171
+ }
@@ -0,0 +1,292 @@
1
+ import type { JSX } from "react";
2
+ import { Button, Input, cn } from "@vetta-org/ui";
3
+
4
+ /** 单个候选模型的连通性测试结果。 */
5
+ export interface FetchedModelTestView {
6
+ readonly status: "testing" | "ok" | "fail";
7
+ readonly message?: string;
8
+ }
9
+
10
+ /** 候选模型行:接口返回的参数与勾选、测试状态都在这里。 */
11
+ export interface FetchedModelRowView {
12
+ readonly id: string;
13
+ readonly name?: string;
14
+ readonly ownedBy?: string;
15
+ readonly contextWindow?: number;
16
+ readonly maxTokens?: number;
17
+ readonly vision?: boolean;
18
+ readonly reasoning?: boolean;
19
+ /** 上游声明的思考档位,跟在「思考」标记后面。 */
20
+ readonly reasoningLevels?: readonly string[];
21
+ readonly selected: boolean;
22
+ readonly alreadyAdded: boolean;
23
+ readonly test?: FetchedModelTestView;
24
+ }
25
+
26
+ export interface ModelsFetchedModelsDrawerViewLabels {
27
+ readonly title: string;
28
+ /** 标题下的 provider 行。 */
29
+ readonly subtitle: string;
30
+ /** 已拉取到的候选数量说明;未就绪时为空串。 */
31
+ readonly hint: string;
32
+ readonly searchPlaceholder: string;
33
+ readonly clearSearch: string;
34
+ readonly listLabel: string;
35
+ readonly emptyList: string;
36
+ readonly emptySearch: string;
37
+ readonly selectAll: string;
38
+ readonly deselectAll: string;
39
+ readonly selectedCount: string;
40
+ readonly alreadyAdded: string;
41
+ readonly vision: string;
42
+ readonly thinking: string;
43
+ readonly testAction: string;
44
+ readonly testing: string;
45
+ readonly testOk: string;
46
+ readonly testFail: string;
47
+ readonly apply: string;
48
+ readonly cancel: string;
49
+ readonly retry: string;
50
+ readonly loading: string;
51
+ }
52
+
53
+ export interface ModelsFetchedModelsDrawerViewProps {
54
+ readonly labels: ModelsFetchedModelsDrawerViewLabels;
55
+ readonly status: "loading" | "ready" | "error";
56
+ readonly error?: string;
57
+ /** 当前可见的行(已按搜索词筛过)。 */
58
+ readonly rows: readonly FetchedModelRowView[];
59
+ /** 接口返回的候选总数,用于区分「没有模型」和「没有匹配」。 */
60
+ readonly totalCount: number;
61
+ readonly selectedCount: number;
62
+ readonly searchQuery: string;
63
+ readonly saving: boolean;
64
+ readonly onSearchQueryChange: (value: string) => void;
65
+ readonly onToggle: (modelId: string) => void;
66
+ readonly onSelectAll: () => void;
67
+ readonly onDeselectAll: () => void;
68
+ readonly onTest: (modelId: string) => void;
69
+ readonly onRetry: () => void;
70
+ readonly onApply: () => void;
71
+ readonly onClose: () => void;
72
+ }
73
+
74
+ /**
75
+ * 「从接口拉取模型」抽屉的展示层:服务商行右侧滑出,列出 `GET {baseUrl}/models`
76
+ * 返回的全部候选模型及其参数,勾选后批量写入。
77
+ *
78
+ * 全选/全不选只作用于 `rows`(当前可见项)——搜索后用户看到什么就选什么,
79
+ * 被筛掉的勾选状态保留在连接层的 `selected` 里。
80
+ */
81
+ export function ModelsFetchedModelsDrawerView({
82
+ labels,
83
+ status,
84
+ error,
85
+ rows,
86
+ totalCount,
87
+ selectedCount,
88
+ searchQuery,
89
+ saving,
90
+ onSearchQueryChange,
91
+ onToggle,
92
+ onSelectAll,
93
+ onDeselectAll,
94
+ onTest,
95
+ onRetry,
96
+ onApply,
97
+ onClose,
98
+ }: ModelsFetchedModelsDrawerViewProps): JSX.Element {
99
+ const selectableRows = rows.filter((row) => !row.alreadyAdded);
100
+ const canSelectAll = selectableRows.some((row) => !row.selected);
101
+ const canDeselectAll = rows.some((row) => row.selected);
102
+
103
+ return (
104
+ <div className="flex h-full flex-col">
105
+ <header className="border-b border-border px-5 py-4">
106
+ <h2 className="truncate text-[15px] font-semibold text-foreground">{labels.title}</h2>
107
+ <p className="mt-0.5 truncate text-[11px] text-muted-foreground/70">{labels.subtitle}</p>
108
+ </header>
109
+
110
+ {status === "loading" ? (
111
+ <div className="flex flex-1 items-center justify-center gap-2 text-muted-foreground">
112
+ <span className="icon-[solar--refresh-linear] h-5 w-5 animate-spin" />
113
+ <span className="text-[12px]">{labels.loading}</span>
114
+ </div>
115
+ ) : status === "error" ? (
116
+ <div className="flex flex-1 flex-col items-center justify-center gap-3 px-8 text-center">
117
+ <span className="icon-[solar--danger-triangle-linear] h-8 w-8 text-destructive" />
118
+ <p className="text-[12px] text-destructive">{error}</p>
119
+ <Button variant="field" onClick={onRetry}>
120
+ {labels.retry}
121
+ </Button>
122
+ </div>
123
+ ) : (
124
+ <>
125
+ <div className="flex items-center gap-2 border-b border-border/50 px-5 py-2.5">
126
+ <div className="relative min-w-0 flex-1">
127
+ <span
128
+ aria-hidden="true"
129
+ className="icon-[solar--magnifer-linear] pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground/60"
130
+ />
131
+ <Input
132
+ type="search"
133
+ value={searchQuery}
134
+ onChange={(event) => onSearchQueryChange(event.target.value)}
135
+ placeholder={labels.searchPlaceholder}
136
+ aria-label={labels.searchPlaceholder}
137
+ className="h-8 pl-8 pr-8 text-[12px]"
138
+ />
139
+ {searchQuery && (
140
+ <button
141
+ type="button"
142
+ onClick={() => onSearchQueryChange("")}
143
+ aria-label={labels.clearSearch}
144
+ className="absolute right-1.5 top-1/2 inline-flex h-5 w-5 -translate-y-1/2 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground"
145
+ >
146
+ <span aria-hidden="true" className="icon-[solar--close-circle-linear] h-3.5 w-3.5" />
147
+ </button>
148
+ )}
149
+ </div>
150
+ <Button variant="ghost" size="xs" onClick={onSelectAll} disabled={!canSelectAll}>
151
+ {labels.selectAll}
152
+ </Button>
153
+ <Button variant="ghost" size="xs" onClick={onDeselectAll} disabled={!canDeselectAll}>
154
+ {labels.deselectAll}
155
+ </Button>
156
+ </div>
157
+
158
+ <div className="flex items-center justify-between gap-3 px-5 py-2 text-[11px] text-muted-foreground">
159
+ <span className="min-w-0 truncate">{labels.hint}</span>
160
+ <span className="shrink-0">{labels.selectedCount}</span>
161
+ </div>
162
+
163
+ <div
164
+ role="region"
165
+ aria-label={labels.listLabel}
166
+ tabIndex={0}
167
+ className="min-h-0 flex-1 overflow-y-auto overscroll-contain border-t border-border/50 outline-none focus-visible:ring-1 focus-visible:ring-ring/60"
168
+ >
169
+ {rows.length === 0 && (
170
+ <div className="px-5 py-6 text-center text-[12px] text-muted-foreground">
171
+ {totalCount > 0 ? labels.emptySearch : labels.emptyList}
172
+ </div>
173
+ )}
174
+ {rows.map((row) => (
175
+ <FetchedModelRow key={row.id} row={row} labels={labels} onToggle={onToggle} onTest={onTest} />
176
+ ))}
177
+ </div>
178
+
179
+ <footer className="flex items-center justify-end gap-2 border-t border-border px-5 py-3">
180
+ <Button size="sm" onClick={onApply} disabled={saving || selectedCount === 0}>
181
+ {labels.apply}
182
+ </Button>
183
+ <Button variant="ghost" size="sm" onClick={onClose}>
184
+ {labels.cancel}
185
+ </Button>
186
+ </footer>
187
+ </>
188
+ )}
189
+ </div>
190
+ );
191
+ }
192
+
193
+ function FetchedModelRow({
194
+ row,
195
+ labels,
196
+ onToggle,
197
+ onTest,
198
+ }: {
199
+ readonly row: FetchedModelRowView;
200
+ readonly labels: ModelsFetchedModelsDrawerViewLabels;
201
+ readonly onToggle: (modelId: string) => void;
202
+ readonly onTest: (modelId: string) => void;
203
+ }): JSX.Element {
204
+ const subtitle = [row.name, row.ownedBy].filter(Boolean).join(" · ");
205
+
206
+ return (
207
+ <div className="flex items-center gap-3 border-b border-border/50 px-5 py-2.5 last:border-b-0 hover:bg-accent/40">
208
+ <button
209
+ type="button"
210
+ aria-pressed={row.selected}
211
+ onClick={() => onToggle(row.id)}
212
+ className="flex min-w-0 flex-1 items-center gap-2.5 text-left"
213
+ >
214
+ <span
215
+ aria-hidden="true"
216
+ className={cn(
217
+ "h-3.5 w-3.5 shrink-0",
218
+ row.selected ? "icon-[mdi--checkbox-marked] text-primary" : "icon-[mdi--checkbox-blank-outline] text-muted-foreground",
219
+ )}
220
+ />
221
+ <span className="min-w-0 flex-1">
222
+ <span className="flex items-center gap-2">
223
+ <span className="truncate text-[12px] font-medium text-foreground">{row.id}</span>
224
+ {row.alreadyAdded && (
225
+ <span className="shrink-0 rounded-full bg-muted px-1.5 py-0.5 text-[9px] text-muted-foreground">
226
+ {labels.alreadyAdded}
227
+ </span>
228
+ )}
229
+ </span>
230
+ {subtitle && <span className="mt-0.5 block truncate text-[10px] text-muted-foreground/70">{subtitle}</span>}
231
+ </span>
232
+ </button>
233
+
234
+ <span className="flex shrink-0 items-center gap-2 text-[10px] text-muted-foreground">
235
+ {row.contextWindow != null && <span>{(row.contextWindow / 1024).toFixed(0)}K ctx</span>}
236
+ {row.maxTokens != null && <span>{(row.maxTokens / 1024).toFixed(0)}K max</span>}
237
+ {row.vision && (
238
+ <span className="rounded bg-primary/10 px-1 py-0.5 text-[9px] text-primary">{labels.vision}</span>
239
+ )}
240
+ {row.reasoning && (
241
+ <span className="rounded bg-accent px-1 py-0.5 text-[9px] text-muted-foreground">
242
+ {labels.thinking}
243
+ {row.reasoningLevels?.length ? ` · ${row.reasoningLevels.join("/")}` : ""}
244
+ </span>
245
+ )}
246
+ </span>
247
+
248
+ <FetchedModelTestControl row={row} labels={labels} onTest={onTest} />
249
+ </div>
250
+ );
251
+ }
252
+
253
+ function FetchedModelTestControl({
254
+ row,
255
+ labels,
256
+ onTest,
257
+ }: {
258
+ readonly row: FetchedModelRowView;
259
+ readonly labels: ModelsFetchedModelsDrawerViewLabels;
260
+ readonly onTest: (modelId: string) => void;
261
+ }): JSX.Element {
262
+ const test = row.test;
263
+ if (test?.status === "testing") {
264
+ return (
265
+ <Button variant="ghost" size="xs" disabled className="shrink-0">
266
+ <span className="icon-[solar--refresh-linear] h-3 w-3 animate-spin" />
267
+ {labels.testing}
268
+ </Button>
269
+ );
270
+ }
271
+ if (test?.status === "ok" || test?.status === "fail") {
272
+ const ok = test.status === "ok";
273
+ return (
274
+ <Button
275
+ variant="ghost"
276
+ size="xs"
277
+ onClick={() => onTest(row.id)}
278
+ title={test.message}
279
+ className={cn("shrink-0", ok ? "text-emerald-400" : "text-destructive")}
280
+ >
281
+ <span className={cn("h-3 w-3", ok ? "icon-[solar--check-circle-linear]" : "icon-[solar--danger-triangle-linear]")} />
282
+ {ok ? labels.testOk : labels.testFail}
283
+ </Button>
284
+ );
285
+ }
286
+ return (
287
+ <Button variant="ghost" size="xs" onClick={() => onTest(row.id)} title={labels.testAction} className="shrink-0">
288
+ <span className="icon-[solar--plug-circle-linear] h-3 w-3" />
289
+ {labels.testAction}
290
+ </Button>
291
+ );
292
+ }