@vetta-org/theme-ui 0.1.2 → 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.
Files changed (78) hide show
  1. package/package.json +8 -16
  2. package/src/activity/ActivityPanelFrame.tsx +1 -1
  3. package/src/activity/CodePreview.tsx +15 -1
  4. package/src/activity/MarkdownPreviewView.test.tsx +53 -0
  5. package/src/activity/MarkdownPreviewView.tsx +86 -10
  6. package/src/chat/ContextRingView.test.tsx +81 -0
  7. package/src/chat/ContextRingView.tsx +78 -62
  8. package/src/chat/HeaderActionBarView.tsx +122 -47
  9. package/src/chat/HeaderActionOverflowMenu.tsx +11 -20
  10. package/src/chat/MessageFeedLayoutView.tsx +6 -5
  11. package/src/chat/MessageInputView.tsx +5 -1
  12. package/src/chat/index.ts +2 -1
  13. package/src/chat/message-feed-fade.css +80 -0
  14. package/src/chat/message-feed-fade.test.tsx +75 -0
  15. package/src/file-preview/ReadonlyCodeView.tsx +46 -0
  16. package/src/file-preview/syntax-tokens.css +1 -1
  17. package/src/image-assets.d.ts +4 -0
  18. package/src/markdown/FileLinkBadge.tsx +77 -0
  19. package/src/markdown/MarkdownContent.tsx +12 -5
  20. package/src/markdown/MarkdownImage.tsx +6 -16
  21. package/src/markdown/MermaidBlock.tsx +50 -11
  22. package/src/markdown/image-actions.ts +29 -0
  23. package/src/markdown/index.ts +1 -0
  24. package/src/markdown/preview-policy.test.ts +31 -0
  25. package/src/markdown/preview-policy.ts +33 -0
  26. package/src/markdown/progressive-chunks.test.ts +43 -0
  27. package/src/markdown/progressive-chunks.ts +58 -0
  28. package/src/markdown/rich-labels.ts +6 -0
  29. package/src/overlays/CommandMenuRow.tsx +43 -12
  30. package/src/overlays/CommandMenuView.tsx +96 -11
  31. package/src/overlays/DiagnosticsExportDialogView.tsx +236 -0
  32. package/src/overlays/MagpieHandoverDialogView.tsx +217 -0
  33. package/src/overlays/ReleaseNoteMarkdown.test.tsx +24 -0
  34. package/src/overlays/ReleaseNoteMarkdown.tsx +26 -0
  35. package/src/overlays/SplashPanel.tsx +4 -4
  36. package/src/overlays/SplashParts.tsx +6 -2
  37. package/src/overlays/UpdateRestartDialogView.tsx +65 -0
  38. package/src/overlays/assets/diagnostics-banner.webp +0 -0
  39. package/src/overlays/command-menu-types.ts +13 -1
  40. package/src/overlays/index.ts +12 -0
  41. package/src/plugin-ui/index.ts +2 -0
  42. package/src/project/DefaultConversationSectionView.tsx +13 -22
  43. package/src/project/DefaultSessionRowView.tsx +8 -0
  44. package/src/settings/ArchivedProjectsSettingsView.tsx +122 -1
  45. package/src/settings/GeneralSettingsView.tsx +2 -5
  46. package/src/settings/LauncherSettingsView.test.tsx +95 -0
  47. package/src/settings/LauncherSettingsView.tsx +273 -0
  48. package/src/settings/PetActionGalleryView.test.tsx +163 -0
  49. package/src/settings/PetActionGalleryView.tsx +216 -0
  50. package/src/settings/PetSettingsView.test.tsx +117 -0
  51. package/src/settings/PetSettingsView.tsx +86 -22
  52. package/src/settings/PresetProviderRowView.tsx +37 -98
  53. package/src/settings/ShortcutsSettingsView.tsx +0 -4
  54. package/src/settings/SpaceEditorDialogView.tsx +94 -56
  55. package/src/settings/SpacesSettingsView.tsx +53 -8
  56. package/src/settings/assets/space-editor-illustration.webp +0 -0
  57. package/src/settings/index.ts +18 -39
  58. package/src/shared/SegmentedControl.test.tsx +68 -0
  59. package/src/shared/SegmentedControl.tsx +10 -2
  60. package/src/shared/TabBar.tsx +2 -2
  61. package/src/shared/VettaKbd.tsx +20 -1
  62. package/src/shared/index.ts +2 -1
  63. package/src/shared/platform.ts +9 -0
  64. package/src/sidebar/AddProjectMenuTriggerView.tsx +11 -12
  65. package/src/sidebar/SettingsMenuTriggerView.tsx +2 -1
  66. package/src/sidebar/SidebarSectionActionButton.test.tsx +91 -0
  67. package/src/sidebar/SidebarSectionActionButton.tsx +52 -0
  68. package/src/styles.css +2 -0
  69. package/src/settings/AchievementNavigationButtonView.tsx +0 -90
  70. package/src/settings/AchievementPromotionDialogView.tsx +0 -91
  71. package/src/settings/AchievementSettingsView.tsx +0 -43
  72. package/src/settings/PetBubbleStylePreviewView.tsx +0 -44
  73. package/src/settings/QuickPanelSettingsSectionView.tsx +0 -64
  74. package/src/settings/achievements/AchievementCurtains.tsx +0 -50
  75. package/src/settings/achievements/AchievementPromotionBadge3D.tsx +0 -350
  76. package/src/settings/achievements/AchievementPromotionConfetti.tsx +0 -71
  77. package/src/settings/achievements/AchievementTitle.tsx +0 -52
  78. package/src/settings/achievements/index.ts +0 -13
@@ -1,4 +1,4 @@
1
- import { useState, type JSX, type ReactNode } from "react";
1
+ import type { JSX, ReactNode } from "react";
2
2
  import { Button, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, Switch, cn } from "@vetta-org/ui";
3
3
  import { InputField } from "./SettingsFormFields";
4
4
 
@@ -9,13 +9,14 @@ export interface PresetProviderRowModelView {
9
9
  readonly isOpen: boolean;
10
10
  readonly adopted: boolean;
11
11
  readonly enabled: boolean;
12
- readonly autoKey: boolean;
13
12
  readonly baseUrl?: string;
14
13
  readonly offline: boolean;
15
14
  readonly models: readonly unknown[];
16
15
  readonly refreshing: boolean;
17
16
  readonly hasApiKey: boolean;
18
17
  readonly modelsError: string | null;
18
+ /** 由外部程序接入并管理(如 Magpie):只展示是否已接入,没有任何操作按钮。 */
19
+ readonly managedBy?: string;
19
20
  }
20
21
 
21
22
  export interface PresetProviderRowViewLabels {
@@ -38,9 +39,13 @@ export interface PresetProviderRowViewLabels {
38
39
  readonly refreshModels: string;
39
40
  readonly refreshingModels: string;
40
41
  readonly copyApiKey: string;
41
- readonly editBaseUrl: string;
42
- readonly baseUrlPlaceholder: string;
43
42
  readonly toggleProvider: (name: string) => string;
43
+ /** 外部管理且已接入时,副标题里模型数后面的说明,如「由 Magpie 管理」。 */
44
+ readonly managedConnected: string;
45
+ /** 外部管理但还没接入时的副标题,告诉用户去哪里接入。 */
46
+ readonly managedNotConnected: string;
47
+ /** 外部管理的行右侧按钮,打开接入说明。 */
48
+ readonly managedGuide: string;
44
49
  }
45
50
 
46
51
  export interface PresetProviderRowViewProps {
@@ -53,11 +58,11 @@ export interface PresetProviderRowViewProps {
53
58
  readonly onDraftKeyChange: (key: string) => void;
54
59
  readonly onAdopt: () => void;
55
60
  readonly onToggleEnabled: (next: boolean) => void;
56
- /** 返回是否已保存;保存成功后关闭地址弹窗。 */
57
- readonly onChangeBaseUrl: (url: string) => Promise<boolean>;
58
61
  readonly onRemove: () => void;
59
62
  readonly onRefreshModels: () => void;
60
63
  readonly onCopyApiKey: () => void;
64
+ /** 外部管理的行(如 Magpie)打开接入说明;不传则不显示按钮。 */
65
+ readonly onOpenManagedGuide?: () => void;
61
66
  readonly icon: ReactNode;
62
67
  readonly modelsList?: ReactNode;
63
68
  }
@@ -72,30 +77,22 @@ export function PresetProviderRowView({
72
77
  onDraftKeyChange,
73
78
  onAdopt,
74
79
  onToggleEnabled,
75
- onChangeBaseUrl,
76
80
  onRemove,
77
81
  onRefreshModels,
78
82
  onCopyApiKey,
83
+ onOpenManagedGuide,
79
84
  icon,
80
85
  modelsList,
81
86
  }: PresetProviderRowViewProps): JSX.Element {
87
+ // 外部管理的(如 Magpie)只在对方那边开关,这里不给任何操作。
88
+ const managed = Boolean(row.managedBy);
82
89
  // 已下线的旧条目不在内置目录里,给不了 key 也拉不到模型。
83
- const canEditKey = !row.offline && !row.autoKey;
90
+ const canEditKey = !managed && !row.offline;
84
91
  const keyDialogOpen = canEditKey && row.isOpen;
85
- // 内置密钥的服务(如 Magpie)不填 key,但地址(端口)要能改。
86
- const canEditUrl = row.autoKey && !row.offline;
87
- const [urlDraft, setUrlDraft] = useState<string | null>(null);
88
- const urlDialogOpen = canEditUrl && urlDraft !== null;
89
92
 
90
93
  const tryAdopt = (): void => {
91
94
  if (draftKey.trim() && !saving) onAdopt();
92
95
  };
93
- // 内置服务(Magpie)只开放端口:主机与路径固定,草稿里只放端口号。
94
- const portValid = urlDraft !== null && /^\d{1,5}$/.test(urlDraft) && Number(urlDraft) >= 1 && Number(urlDraft) <= 65535;
95
- const submitUrl = async (): Promise<void> => {
96
- if (urlDraft === null || !portValid || saving || !row.baseUrl) return;
97
- if (await onChangeBaseUrl(withPort(row.baseUrl, urlDraft))) setUrlDraft(null);
98
- };
99
96
 
100
97
  return (
101
98
  <div className="border-b border-border last:border-b-0">
@@ -129,14 +126,31 @@ export function PresetProviderRowView({
129
126
  )}
130
127
  </div>
131
128
  <div className="mt-0.5 truncate text-[11px] text-muted-foreground">
132
- {labels.modelsCount(row.models.length)}
133
- {canEditUrl && row.baseUrl ? ` · ${row.baseUrl}` : ""}
129
+ {managed && !row.adopted ? (
130
+ labels.managedNotConnected
131
+ ) : (
132
+ <>
133
+ {labels.modelsCount(row.models.length)}
134
+ {managed ? ` · ${labels.managedConnected}` : ""}
135
+ </>
136
+ )}
134
137
  </div>
135
138
  </div>
136
139
  </button>
137
140
 
138
141
  <div className="flex h-8 items-center justify-end gap-1.5">
139
- {row.adopted && !row.offline && (
142
+ {managed && onOpenManagedGuide && (
143
+ <Button
144
+ variant="ghost"
145
+ size="sm"
146
+ onClick={onOpenManagedGuide}
147
+ className="h-7 gap-1 rounded-full px-2.5 text-[12px] text-muted-foreground hover:text-foreground"
148
+ >
149
+ <span className="icon-[mdi--help-circle-outline] h-3.5 w-3.5" />
150
+ {labels.managedGuide}
151
+ </Button>
152
+ )}
153
+ {row.adopted && !row.offline && !managed && (
140
154
  <Button
141
155
  variant="ghost"
142
156
  size="icon-sm"
@@ -160,19 +174,7 @@ export function PresetProviderRowView({
160
174
  <span className={cn("h-3.5 w-3.5", row.adopted ? "icon-[mdi--key-outline]" : "icon-[mdi--key-plus]")} />
161
175
  </Button>
162
176
  )}
163
- {canEditUrl && (
164
- <Button
165
- variant="ghost"
166
- size="icon-sm"
167
- onClick={() => setUrlDraft(portOf(row.baseUrl))}
168
- title={labels.editBaseUrl}
169
- aria-label={labels.editBaseUrl}
170
- className="text-muted-foreground hover:text-foreground"
171
- >
172
- <span className="icon-[mdi--link-variant] h-3.5 w-3.5" />
173
- </Button>
174
- )}
175
- {row.adopted && !row.autoKey && (
177
+ {row.adopted && !managed && (
176
178
  <Button
177
179
  variant="ghost"
178
180
  size="icon-sm"
@@ -184,7 +186,7 @@ export function PresetProviderRowView({
184
186
  <span className="icon-[mdi--delete-outline] h-3.5 w-3.5" />
185
187
  </Button>
186
188
  )}
187
- {!row.offline && (
189
+ {!row.offline && !managed && (
188
190
  <Switch
189
191
  size="sm"
190
192
  checked={row.enabled}
@@ -257,69 +259,6 @@ export function PresetProviderRowView({
257
259
  </DialogFooter>
258
260
  </DialogContent>
259
261
  </Dialog>
260
-
261
- <Dialog open={urlDialogOpen} onOpenChange={(next) => !next && !saving && setUrlDraft(null)}>
262
- <DialogContent className="sm:max-w-[420px]">
263
- <DialogHeader>
264
- <DialogTitle>{row.displayName}</DialogTitle>
265
- <DialogDescription>{labels.editBaseUrl}</DialogDescription>
266
- </DialogHeader>
267
- <div className="flex flex-col gap-2">
268
- <span className="text-[14px] font-medium text-foreground">
269
- {labels.baseUrlPlaceholder}
270
- </span>
271
- <div className="flex items-center gap-2">
272
- <span className="shrink-0 text-[14px] text-muted-foreground">{hostPrefix(row.baseUrl)}</span>
273
- <InputField
274
- value={urlDraft ?? ""}
275
- onChange={(value) => setUrlDraft(value.replace(/\D/g, "").slice(0, 5))}
276
- placeholder={labels.baseUrlPlaceholder}
277
- disabled={saving}
278
- autoFocus
279
- aria-label={labels.editBaseUrl}
280
- className="h-10 w-28 rounded-xl px-3.5 text-[15px] md:text-[15px]"
281
- onKeyDown={(event) => {
282
- if (event.key === "Enter") {
283
- event.preventDefault();
284
- void submitUrl();
285
- }
286
- }}
287
- />
288
- </div>
289
- </div>
290
- <DialogFooter>
291
- <Button variant="ghost" size="sm" onClick={() => setUrlDraft(null)} disabled={saving}>
292
- {labels.cancel}
293
- </Button>
294
- <Button variant="primary" size="sm" onClick={() => void submitUrl()} disabled={!portValid || saving}>
295
- {labels.save}
296
- </Button>
297
- </DialogFooter>
298
- </DialogContent>
299
- </Dialog>
300
262
  </div>
301
263
  );
302
264
  }
303
-
304
- function portOf(baseUrl: string | undefined): string {
305
- try {
306
- return baseUrl ? new URL(baseUrl).port : "";
307
- } catch {
308
- return "";
309
- }
310
- }
311
-
312
- /** 端口输入框左侧的固定前缀,如 `http://127.0.0.1:`。 */
313
- function hostPrefix(baseUrl: string | undefined): string {
314
- try {
315
- return baseUrl ? `${new URL(baseUrl).protocol}//${new URL(baseUrl).hostname}:` : "";
316
- } catch {
317
- return "";
318
- }
319
- }
320
-
321
- function withPort(baseUrl: string, port: string): string {
322
- const url = new URL(baseUrl);
323
- url.port = port;
324
- return url.toString().replace(/\/$/, "");
325
- }
@@ -18,7 +18,6 @@ export interface ShortcutsSettingsViewProps {
18
18
  readonly aiAssistSlot: ReactNode;
19
19
  readonly onResetAll: () => void;
20
20
  readonly shortcutActions: readonly ShortcutActionRowView[];
21
- readonly quickPanelSection: ReactNode;
22
21
  }
23
22
 
24
23
  export function ShortcutsSettingsView({
@@ -30,7 +29,6 @@ export function ShortcutsSettingsView({
30
29
  aiAssistSlot,
31
30
  onResetAll,
32
31
  shortcutActions,
33
- quickPanelSection,
34
32
  }: ShortcutsSettingsViewProps): JSX.Element {
35
33
  return (
36
34
  <div className="mx-auto w-full max-w-[680px] px-8 pt-2 pb-4">
@@ -58,8 +56,6 @@ export function ShortcutsSettingsView({
58
56
  ))}
59
57
  </SettingSection>
60
58
 
61
- {quickPanelSection}
62
-
63
59
  <p className="mt-4 text-[12px] leading-relaxed text-muted-foreground/50">{shortcutHint}</p>
64
60
  </div>
65
61
  );
@@ -8,7 +8,9 @@ import {
8
8
  DialogFooter,
9
9
  DialogHeader,
10
10
  DialogTitle,
11
+ Switch,
11
12
  } from "@vetta-org/ui";
13
+ import spaceEditorIllustrationUrl from "./assets/space-editor-illustration.webp";
12
14
  import { InputField } from "./SettingsFormFields";
13
15
 
14
16
  export interface SpaceEditorIconOption {
@@ -23,6 +25,8 @@ export interface SpaceEditorDialogViewLabels {
23
25
  readonly name: string;
24
26
  readonly namePlaceholder: string;
25
27
  readonly icon: string;
28
+ readonly siblingProjects: string;
29
+ readonly siblingProjectsDescription: string;
26
30
  readonly cancel: string;
27
31
  readonly save: string;
28
32
  }
@@ -32,9 +36,12 @@ export interface SpaceEditorDialogViewProps {
32
36
  readonly name: string;
33
37
  readonly icons: readonly SpaceEditorIconOption[];
34
38
  readonly selectedIcon: string;
39
+ /** 空间内的会话能否看见同空间的兄弟项目(ADR-0159)。 */
40
+ readonly siblingProjects: boolean;
35
41
  readonly canSave: boolean;
36
42
  readonly onNameChange: (name: string) => void;
37
43
  readonly onSelectIcon: (value: string) => void;
44
+ readonly onSiblingProjectsChange: (enabled: boolean) => void;
38
45
  readonly onCancel: () => void;
39
46
  readonly onSave: () => void;
40
47
  }
@@ -44,9 +51,11 @@ export function SpaceEditorDialogView({
44
51
  name,
45
52
  icons,
46
53
  selectedIcon,
54
+ siblingProjects,
47
55
  canSave,
48
56
  onNameChange,
49
57
  onSelectIcon,
58
+ onSiblingProjectsChange,
50
59
  onCancel,
51
60
  onSave,
52
61
  }: SpaceEditorDialogViewProps): JSX.Element {
@@ -57,63 +66,92 @@ export function SpaceEditorDialogView({
57
66
  if (!open) onCancel();
58
67
  }}
59
68
  >
60
- <DialogContent className="sm:max-w-[460px]">
61
- <DialogHeader>
62
- <DialogTitle>{labels.title}</DialogTitle>
63
- <DialogDescription>{labels.description}</DialogDescription>
64
- </DialogHeader>
65
- <form
66
- className="grid gap-4"
67
- onSubmit={(event) => {
68
- event.preventDefault();
69
- if (canSave) onSave();
70
- }}
71
- >
72
- <div className="grid gap-1.5">
73
- <span className="text-[12px] font-medium text-muted-foreground">{labels.name}</span>
74
- <InputField
75
- value={name}
76
- onChange={onNameChange}
77
- placeholder={labels.namePlaceholder}
78
- autoFocus
79
- aria-label={labels.name}
80
- />
81
- </div>
82
- <div className="grid gap-1.5">
83
- <span className="text-[12px] font-medium text-muted-foreground">{labels.icon}</span>
84
- <div className="grid grid-cols-10 gap-1" role="group" aria-label={labels.icon}>
85
- {icons.map((option) => {
86
- const active = option.value === selectedIcon;
87
- return (
88
- <Button
89
- key={option.value}
90
- type="button"
91
- size="icon-sm"
92
- variant="ghost"
93
- aria-label={option.label}
94
- title={option.label}
95
- aria-pressed={active}
96
- className={cn(
97
- "text-muted-foreground",
98
- active && "border border-primary bg-primary/10 text-primary hover:bg-primary/15",
99
- )}
100
- onClick={() => onSelectIcon(option.value)}
101
- >
102
- <span className={cn(option.iconClassName, "size-4")} aria-hidden="true" />
103
- </Button>
104
- );
105
- })}
69
+ {/* 宽窗口左侧放插画;窗口窄于 sm 时只留表单,避免挤压输入区。 */}
70
+ <DialogContent className="max-w-[min(460px,calc(100%-2rem))] gap-0 overflow-hidden p-0 sm:max-w-[min(700px,calc(100%-2rem))] sm:grid-cols-[240px_minmax(0,1fr)]">
71
+ {/* 插画绝对定位铺满左列,高度只跟表单走,不让图片的原始比例撑高对话框。 */}
72
+ <div aria-hidden className="relative hidden sm:block">
73
+ <img
74
+ src={spaceEditorIllustrationUrl}
75
+ alt=""
76
+ draggable={false}
77
+ decoding="async"
78
+ className="absolute inset-0 size-full object-cover object-[50%_62%] select-none"
79
+ />
80
+ </div>
81
+ <div className="grid gap-5 p-6">
82
+ <DialogHeader>
83
+ <DialogTitle>{labels.title}</DialogTitle>
84
+ <DialogDescription>{labels.description}</DialogDescription>
85
+ </DialogHeader>
86
+ <form
87
+ className="grid gap-4"
88
+ onSubmit={(event) => {
89
+ event.preventDefault();
90
+ if (canSave) onSave();
91
+ }}
92
+ >
93
+ <div className="grid gap-1.5">
94
+ <span className="text-[12px] font-medium text-muted-foreground">{labels.name}</span>
95
+ <InputField
96
+ value={name}
97
+ onChange={onNameChange}
98
+ placeholder={labels.namePlaceholder}
99
+ autoFocus
100
+ aria-label={labels.name}
101
+ />
106
102
  </div>
107
- </div>
108
- <DialogFooter>
109
- <Button type="button" variant="ghost" onClick={onCancel}>
110
- {labels.cancel}
111
- </Button>
112
- <Button type="submit" disabled={!canSave}>
113
- {labels.save}
114
- </Button>
115
- </DialogFooter>
116
- </form>
103
+ <div className="grid gap-1.5">
104
+ <span className="text-[12px] font-medium text-muted-foreground">{labels.icon}</span>
105
+ <div className="grid grid-cols-10 gap-1" role="group" aria-label={labels.icon}>
106
+ {icons.map((option) => {
107
+ const active = option.value === selectedIcon;
108
+ return (
109
+ <Button
110
+ key={option.value}
111
+ type="button"
112
+ size="icon-sm"
113
+ variant="ghost"
114
+ aria-label={option.label}
115
+ title={option.label}
116
+ aria-pressed={active}
117
+ className={cn(
118
+ "text-muted-foreground",
119
+ active && "border border-primary bg-primary/10 text-primary hover:bg-primary/15",
120
+ )}
121
+ onClick={() => onSelectIcon(option.value)}
122
+ >
123
+ <span className={cn(option.iconClassName, "size-4")} aria-hidden="true" />
124
+ </Button>
125
+ );
126
+ })}
127
+ </div>
128
+ </div>
129
+ <div className="flex items-start justify-between gap-4 rounded-lg border border-border/60 px-3 py-2.5">
130
+ <div className="grid gap-0.5">
131
+ <span id="space-editor-sibling-projects" className="text-[13px] font-medium text-foreground">
132
+ {labels.siblingProjects}
133
+ </span>
134
+ <span className="text-[12px] leading-relaxed text-muted-foreground">
135
+ {labels.siblingProjectsDescription}
136
+ </span>
137
+ </div>
138
+ <Switch
139
+ className="mt-0.5 shrink-0"
140
+ checked={siblingProjects}
141
+ onCheckedChange={onSiblingProjectsChange}
142
+ aria-labelledby="space-editor-sibling-projects"
143
+ />
144
+ </div>
145
+ <DialogFooter>
146
+ <Button type="button" variant="ghost" onClick={onCancel}>
147
+ {labels.cancel}
148
+ </Button>
149
+ <Button type="submit" disabled={!canSave}>
150
+ {labels.save}
151
+ </Button>
152
+ </DialogFooter>
153
+ </form>
154
+ </div>
117
155
  </DialogContent>
118
156
  </Dialog>
119
157
  );
@@ -1,7 +1,13 @@
1
1
  import type { JSX, ReactNode } from "react";
2
- import { Button } from "@vetta-org/ui";
2
+ import { Button, cn } from "@vetta-org/ui";
3
3
  import { SettingSection, type SettingSectionMeta } from "./SettingChrome";
4
4
 
5
+ export interface SpacesFeatureView {
6
+ readonly icon: string;
7
+ readonly title: string;
8
+ readonly description: string;
9
+ }
10
+
5
11
  export interface SpacesSettingsViewItem {
6
12
  readonly id: string;
7
13
  readonly name: string;
@@ -10,6 +16,10 @@ export interface SpacesSettingsViewItem {
10
16
 
11
17
  export interface SpacesSettingsViewLabels {
12
18
  readonly title: string;
19
+ /** 标题下的一句话:工作空间是什么。 */
20
+ readonly subtitle: string;
21
+ readonly featuresTitle: string;
22
+ readonly listTitle: string;
13
23
  readonly newSpace: string;
14
24
  readonly edit: (name: string) => string;
15
25
  readonly remove: (name: string) => string;
@@ -20,6 +30,8 @@ export interface SpacesSettingsViewLabels {
20
30
  export interface SpacesSettingsViewProps {
21
31
  readonly labels: SpacesSettingsViewLabels;
22
32
  readonly section: SettingSectionMeta;
33
+ /** 顶部讲解:工作空间怎么用、会影响什么。 */
34
+ readonly features: readonly SpacesFeatureView[];
23
35
  readonly spaces: readonly SpacesSettingsViewItem[];
24
36
  readonly onCreate: () => void;
25
37
  readonly onEdit: (id: string) => void;
@@ -35,9 +47,16 @@ function SpaceIconBadge({ children }: { children: ReactNode }): JSX.Element {
35
47
  );
36
48
  }
37
49
 
50
+ /**
51
+ * 设置 → 工作空间。
52
+ *
53
+ * 只看列表的话,用户不知道工作空间是「侧栏分组」还是会挪动磁盘上的目录,也找不到切换入口;
54
+ * 所以和「启动器」页一样,先用一句话 + 分行讲解交代清楚,再给管理列表。
55
+ */
38
56
  export function SpacesSettingsView({
39
57
  labels,
40
58
  section,
59
+ features,
41
60
  spaces,
42
61
  onCreate,
43
62
  onEdit,
@@ -46,15 +65,41 @@ export function SpacesSettingsView({
46
65
  }: SpacesSettingsViewProps): JSX.Element {
47
66
  return (
48
67
  <div className="mx-auto w-full max-w-[680px] px-8 pt-2 pb-4">
49
- <div className="mb-6 flex items-center justify-between gap-3">
50
- <h1 className="text-[20px] font-bold text-foreground">{labels.title}</h1>
51
- <Button size="sm" onClick={onCreate}>
52
- <span className="icon-[solar--add-circle-linear] size-4" aria-hidden="true" />
53
- {labels.newSpace}
54
- </Button>
68
+ <h1 className="mb-1.5 text-[20px] font-bold text-foreground">{labels.title}</h1>
69
+ <p className="mb-6 text-[13px] leading-relaxed text-muted-foreground">{labels.subtitle}</p>
70
+
71
+ <div className="mb-8">
72
+ <h2 className="mb-3 text-[15px] font-semibold text-foreground">{labels.featuresTitle}</h2>
73
+ <ul className="overflow-hidden rounded-xl border border-border bg-card">
74
+ {features.map((feature) => (
75
+ <li
76
+ key={feature.title}
77
+ className="flex items-center gap-3 border-b border-border px-4 py-3 last:border-b-0"
78
+ >
79
+ <span className="flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary">
80
+ <span aria-hidden="true" className={cn(feature.icon, "h-4 w-4")} />
81
+ </span>
82
+ <div className="min-w-0 flex-1">
83
+ <div className="text-[13px] font-medium text-foreground">{feature.title}</div>
84
+ <p className="mt-0.5 text-[12px] text-muted-foreground">{feature.description}</p>
85
+ </div>
86
+ </li>
87
+ ))}
88
+ </ul>
55
89
  </div>
56
90
 
57
- <SettingSection section={section} title={null}>
91
+ <SettingSection
92
+ section={section}
93
+ title={
94
+ <div className="flex items-center justify-between gap-3">
95
+ <span>{labels.listTitle}</span>
96
+ <Button size="sm" onClick={onCreate}>
97
+ <span className="icon-[solar--add-circle-linear] size-4" aria-hidden="true" />
98
+ {labels.newSpace}
99
+ </Button>
100
+ </div>
101
+ }
102
+ >
58
103
  <div className="flex items-center gap-3 border-b border-border px-5 py-3.5">
59
104
  <SpaceIconBadge>{labels.main.icon}</SpaceIconBadge>
60
105
  <div className="min-w-0 flex-1 text-[13px] font-medium text-foreground">{labels.main.name}</div>
@@ -1,18 +1,3 @@
1
- export type {
2
- AchievementNavigationAssets,
3
- AchievementNavigationButtonViewProps,
4
- } from "./AchievementNavigationButtonView";
5
- export { AchievementNavigationButtonView } from "./AchievementNavigationButtonView";
6
- export type {
7
- AchievementPromotionDialogViewLabels,
8
- AchievementPromotionDialogViewProps,
9
- } from "./AchievementPromotionDialogView";
10
- export { AchievementPromotionDialogView } from "./AchievementPromotionDialogView";
11
- export type {
12
- AchievementSetOptionView,
13
- AchievementSettingsViewProps,
14
- } from "./AchievementSettingsView";
15
- export { AchievementSettingsView } from "./AchievementSettingsView";
16
1
  export type {
17
2
  AppshotPermissionStatusView,
18
3
  AppshotSettingsViewLabels,
@@ -25,22 +10,6 @@ export type {
25
10
  ArchivedProjectsSettingsViewProps,
26
11
  } from "./ArchivedProjectsSettingsView";
27
12
  export { ArchivedProjectsSettingsView } from "./ArchivedProjectsSettingsView";
28
- export type {
29
- AchievementCurtainSideLayout,
30
- AchievementCurtainsAssets,
31
- AchievementCurtainsLayout,
32
- AchievementCurtainsProps,
33
- AchievementPromotionBadge3DProps,
34
- AchievementPromotionConfettiProps,
35
- AchievementTitleLayout,
36
- AchievementTitleProps,
37
- } from "./achievements";
38
- export {
39
- AchievementCurtains,
40
- AchievementPromotionBadge3D,
41
- AchievementPromotionConfetti,
42
- AchievementTitle,
43
- } from "./achievements";
44
13
  export type {
45
14
  BuiltinMcpSecretFieldView,
46
15
  BuiltinMcpSecretsDialogViewLabels,
@@ -99,6 +68,15 @@ export type { ImStatusBadgeStatus, ImStatusBadgeViewProps } from "./ImStatusBadg
99
68
  export { ImStatusBadgeView } from "./ImStatusBadgeView";
100
69
  export type { JsonConfigInputViewProps } from "./JsonConfigInputView";
101
70
  export { JsonConfigInputView } from "./JsonConfigInputView";
71
+ export type {
72
+ LauncherFeatureView,
73
+ LauncherPreviewGroupView,
74
+ LauncherPreviewRowView,
75
+ LauncherPreviewStatusView,
76
+ LauncherSettingsViewLabels,
77
+ LauncherSettingsViewProps,
78
+ } from "./LauncherSettingsView";
79
+ export { LauncherSettingsView } from "./LauncherSettingsView";
102
80
  export { McpDefaultIcon } from "./McpDefaultIcon";
103
81
  export type { McpJsonEditorViewProps } from "./McpJsonEditorView";
104
82
  export { McpJsonEditorView } from "./McpJsonEditorView";
@@ -135,13 +113,18 @@ export type {
135
113
  PermissionsSettingsViewProps,
136
114
  } from "./PermissionsSettingsView";
137
115
  export { PermissionsSettingsView } from "./PermissionsSettingsView";
138
- export type { PetBubbleStylePreviewViewProps } from "./PetBubbleStylePreviewView";
139
- export { PetBubbleStylePreviewView } from "./PetBubbleStylePreviewView";
140
116
  export type {
141
- PetBubbleStyleOptionView,
117
+ PetActionGalleryViewLabels,
118
+ PetActionGalleryViewProps,
119
+ PetActionGroupView,
120
+ PetActionView,
121
+ } from "./PetActionGalleryView";
122
+ export { PetActionGalleryView } from "./PetActionGalleryView";
123
+ export type {
142
124
  PetDecorationView,
143
125
  PetSettingsViewLabels,
144
126
  PetSettingsViewProps,
127
+ PetSizeControlView,
145
128
  } from "./PetSettingsView";
146
129
  export { PetSettingsView } from "./PetSettingsView";
147
130
  export type {
@@ -175,11 +158,6 @@ export type {
175
158
  QrBindDialogViewProps,
176
159
  } from "./QrBindDialogView";
177
160
  export { QrBindDialogView } from "./QrBindDialogView";
178
- export type {
179
- QuickPanelOptionView,
180
- QuickPanelSettingsSectionViewProps,
181
- } from "./QuickPanelSettingsSectionView";
182
- export { QuickPanelSettingsSectionView } from "./QuickPanelSettingsSectionView";
183
161
  export type {
184
162
  RemoteMcpSectionViewLabels,
185
163
  RemoteMcpSectionViewModel,
@@ -219,6 +197,7 @@ export type {
219
197
  } from "./SpaceEditorDialogView";
220
198
  export { SpaceEditorDialogView } from "./SpaceEditorDialogView";
221
199
  export type {
200
+ SpacesFeatureView,
222
201
  SpacesSettingsViewItem,
223
202
  SpacesSettingsViewLabels,
224
203
  SpacesSettingsViewProps,