@vetta-org/theme-ui 0.1.1 → 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.
- package/package.json +733 -5
- package/src/action-approval/AppearanceActionPickerView.tsx +2 -78
- package/src/action-approval/AppearanceApprovalDrawerView.tsx +2 -9
- package/src/action-approval/BatchTasksApprovalFrameView.tsx +4 -1
- package/src/action-approval/GenericActionApprovalView.tsx +2 -9
- package/src/action-approval/ManageActionApprovalFrameView.tsx +4 -1
- package/src/action-approval/NavigationOpenApprovalView.tsx +2 -9
- package/src/action-approval/SchedulerActionApprovalDialogView.tsx +3 -1
- package/src/action-approval/SchedulerEditApprovalDrawerView.tsx +3 -10
- package/src/action-approval/index.ts +0 -1
- package/src/activity/ActivityPanel.tsx +13 -10
- package/src/activity/ActivityPanelFrame.test.tsx +32 -0
- package/src/activity/ActivityPanelFrame.tsx +3 -2
- package/src/activity/BackgroundTasksTabPanelView.tsx +1 -1
- package/src/activity/BrowserPanelView.tsx +48 -49
- package/src/activity/DebugTabPanelView.tsx +1 -1
- package/src/activity/MarkdownPreviewView.tsx +56 -59
- package/src/activity/PluginTabPickerView.tsx +5 -3
- package/src/activity/PortsTabPanelView.tsx +911 -0
- package/src/activity/ToolCallsSubTabView.tsx +1 -1
- package/src/activity/WorkflowTabPanelView.tsx +1 -1
- package/src/activity/index.ts +9 -0
- package/src/app/AppBackground.tsx +1 -1
- package/src/app/AppBootLoadingView.tsx +4 -2
- package/src/app-shell/DefaultWindowControls.tsx +1 -1
- package/src/app-shell/PageHeaderActionGroup.tsx +1 -1
- package/src/app-shell/PageHeaderContent.tsx +36 -7
- package/src/app-shell/PageHeaderFrame.tsx +15 -3
- package/src/app-shell/PageHeaderSidebarTrigger.tsx +1 -1
- package/src/app-shell/PageHeaderTitle.tsx +1 -1
- package/src/app-shell/WindowControlButton.tsx +1 -1
- package/src/app-shell/header-crowding.test.ts +62 -0
- package/src/app-shell/header-crowding.tsx +137 -0
- package/src/appearance/BackgroundImageFrame.tsx +1 -1
- package/src/appearance/CenterSliceImageFrame.tsx +1 -1
- package/src/appearance/CornerImageFrame.tsx +1 -1
- package/src/appearance/HorizontalSliceImageFrame.tsx +1 -1
- package/src/appearance/NineSliceImageFrame.tsx +1 -1
- package/src/appearance/ThemeSurface.tsx +1 -1
- package/src/batch-tasks/BatchProjectFoldersFieldView.tsx +2 -1
- package/src/batch-tasks/BatchTaskProjectActionsView.test.tsx +97 -0
- package/src/batch-tasks/BatchTaskProjectActionsView.tsx +45 -35
- package/src/batch-tasks/batchTaskUi.tsx +0 -29
- package/src/bottom-panel/BottomPanelView.test.tsx +43 -0
- package/src/bottom-panel/BottomPanelView.tsx +222 -0
- package/src/bottom-panel/index.ts +26 -0
- package/src/chat/AgentAvatarView.tsx +1 -1
- package/src/chat/AnnotationViews.tsx +107 -0
- package/src/chat/AskUserQuestionView.tsx +18 -11
- package/src/chat/AssistantMessageView.tsx +48 -13
- package/src/chat/AtPanelView.test.tsx +61 -0
- package/src/chat/AtPanelView.tsx +63 -38
- package/src/chat/BashTerminalCard.tsx +1 -2
- package/src/chat/ChatHeaderActionsView.tsx +74 -18
- package/src/chat/CompactionStepView.test.tsx +34 -0
- package/src/chat/CompactionStepView.tsx +85 -0
- package/src/chat/ExecutionModeSelectorView.tsx +20 -5
- package/src/chat/HeaderActionBarView.tsx +731 -0
- package/src/chat/HeaderActionOverflowMenu.tsx +137 -0
- package/src/chat/InlineModelPicker.test.tsx +81 -0
- package/src/chat/InlineModelPicker.tsx +201 -0
- package/src/chat/InlineTokenChip.tsx +2 -68
- package/src/chat/InputBarBackground.tsx +1 -1
- package/src/chat/InputBarPlaceholder.tsx +26 -3
- package/src/chat/LiveThinkingView.tsx +51 -37
- package/src/chat/MessageBoundaryViews.tsx +21 -0
- package/src/chat/MessageFeedContext.tsx +13 -5
- package/src/chat/MessageFeedLayoutView.tsx +28 -3
- package/src/chat/MessageFeedView.test.tsx +81 -0
- package/src/chat/MessageFeedView.tsx +72 -152
- package/src/chat/MessageInputView.tsx +1 -1
- package/src/chat/MessageLayoutView.tsx +1 -1
- package/src/chat/MessageSelectionContextMenuView.tsx +4 -1
- package/src/chat/MessageTimelineView.tsx +1 -1
- package/src/chat/MessageView.tsx +1 -1
- package/src/chat/MessageVisualView.tsx +1 -1
- package/src/chat/ModelConfiguration.tsx +283 -0
- package/src/chat/ModelSelectorTrigger.tsx +63 -0
- package/src/chat/ModelSelectorView.tsx +1037 -223
- package/src/chat/NewSession.ts +1 -37
- package/src/chat/NewSessionPicker.tsx +3 -2
- package/src/chat/ProjectSelectorView.tsx +3 -2
- package/src/chat/ReasoningStepSlider.tsx +61 -0
- package/src/chat/RemoteSessionBadgeView.tsx +24 -0
- package/src/chat/SkillPromptAreaView.tsx +5 -19
- package/src/chat/TeamMemberReplyCardView.test.tsx +33 -0
- package/src/chat/TeamMemberReplyCardView.tsx +133 -0
- package/src/chat/TextBlockView.tsx +7 -770
- package/src/chat/TodoProgress.tsx +25 -53
- package/src/chat/TodoStatusBarView.tsx +14 -5
- package/src/chat/UserMessageView.tsx +113 -33
- package/src/chat/header-action-narrow.test.ts +21 -0
- package/src/chat/header-action-narrow.ts +38 -0
- package/src/chat/index.ts +32 -27
- package/src/chat/markdown-link.ts +7 -279
- package/src/chat/send-button.css +4 -22
- package/src/chat/streaming-reveal.test.ts +218 -0
- package/src/chat/streaming-reveal.ts +13 -0
- package/src/file-explorer/ConfirmDeleteDialogView.tsx +2 -1
- package/src/file-explorer/FileContextMenuView.tsx +44 -11
- package/src/file-explorer/FileExplorerSettingsView.tsx +97 -0
- package/src/file-explorer/FileTreeCreateRow.tsx +1 -1
- package/src/file-explorer/FileTreeNodeView.tsx +59 -18
- package/src/file-explorer/FileTreeView.tsx +236 -129
- package/src/file-explorer/file-tree-dom.ts +23 -0
- package/src/file-explorer/file-tree-rows.test.ts +74 -0
- package/src/file-explorer/file-tree-rows.ts +168 -0
- package/src/file-explorer/index.ts +17 -0
- package/src/file-explorer/types.ts +3 -0
- package/src/file-explorer/useFileTreeMarqueeSelection.ts +24 -16
- package/src/file-preview/FilePreviewDialogView.tsx +2 -2
- package/src/file-preview/FilePreviewView.tsx +12 -2
- package/src/file-preview/TextFileEditorView.tsx +2 -1
- package/src/index.ts +1 -0
- package/src/knowledge/KnowledgeHowItWorksDialogView.tsx +1 -1
- package/src/layout/AppFrame.tsx +3 -2
- package/src/layout/MainContentFrame.tsx +7 -2
- package/src/layout/ResizeHandle.tsx +68 -17
- package/src/layout/SidebarDock.tsx +75 -19
- package/src/layout/SidebarOverlay.tsx +1 -1
- package/src/layout/index.ts +1 -1
- package/src/layout/resize-handle-axis.test.ts +51 -0
- package/src/live-indicators.test.ts +43 -0
- package/src/markdown/CodeBlock.tsx +123 -0
- package/src/markdown/InlineTokenChip.tsx +68 -0
- package/src/markdown/MarkdownContent.tsx +411 -0
- package/src/markdown/MarkdownImage.tsx +51 -0
- package/src/markdown/MathFormula.tsx +46 -0
- package/src/markdown/MermaidBlock.tsx +43 -0
- package/src/markdown/RichCodeBlock.tsx +127 -0
- package/src/markdown/SvgPreview.tsx +45 -0
- package/src/markdown/WebsiteIcon.tsx +94 -0
- package/src/markdown/builtin-renderers.tsx +43 -0
- package/src/markdown/definition.tsx +49 -0
- package/src/markdown/host.tsx +18 -0
- package/src/markdown/index.ts +11 -0
- package/src/markdown/inline-tokens.ts +187 -0
- package/src/markdown/markdown-link.ts +279 -0
- package/src/markdown/math-client.ts +116 -0
- package/src/markdown/math-render.ts +23 -0
- package/src/markdown/math-syntax.ts +80 -0
- package/src/markdown/math.worker.ts +16 -0
- package/src/markdown/nodes.ts +15 -0
- package/src/markdown/preview-policy.ts +43 -0
- package/src/markdown/rich-labels.ts +49 -0
- package/src/markdown/rich-syntax.ts +93 -0
- package/src/markdown/stable-blocks.test.ts +90 -0
- package/src/markdown/stable-blocks.ts +124 -0
- package/src/markdown/streaming-reveal.ts +297 -0
- package/src/markdown/streaming.test.ts +57 -0
- package/src/markdown/streaming.ts +211 -0
- package/src/markdown/use-render-snapshot.ts +24 -0
- package/src/markdown/use-rich-visibility.ts +24 -0
- package/src/overlays/CommandMenuRow.tsx +38 -9
- package/src/overlays/CommandMenuView.tsx +77 -117
- package/src/overlays/ConfirmDialogView.tsx +25 -20
- package/src/overlays/ReleaseNoteMarkdown.tsx +29 -0
- package/src/overlays/SplashOptionRow.tsx +46 -0
- package/src/overlays/SplashPanel.tsx +85 -0
- package/src/overlays/SplashParts.tsx +213 -0
- package/src/overlays/UpdateCheckerView.tsx +34 -18
- package/src/overlays/UpdateRestartDialogView.tsx +139 -54
- package/src/overlays/command-menu-types.ts +2 -0
- package/src/overlays/command-menu.css +1 -20
- package/src/overlays/index.ts +14 -1
- package/src/plugin-ui/index.ts +8 -0
- package/src/project/ConversationTagDotsView.tsx +1 -1
- package/src/project/ConversationTagEditorDialogView.tsx +4 -1
- package/src/project/DefaultConversationSectionView.tsx +4 -4
- package/src/project/DefaultSessionListView.tsx +5 -31
- package/src/project/DefaultSessionRowView.tsx +106 -55
- package/src/project/ManageSessionsSplashView.tsx +439 -0
- package/src/project/NewProjectDialogView.tsx +3 -10
- package/src/project/ProjectContextMenuView.tsx +30 -139
- package/src/project/ProjectDetailPageView.test.tsx +140 -0
- package/src/project/ProjectDetailPageView.tsx +372 -165
- package/src/project/ProjectGroupView.tsx +1 -1
- package/src/project/ProjectRowView.tsx +29 -12
- package/src/project/ProjectSessionsView.tsx +25 -47
- package/src/project/QuickScrollOverlay.tsx +1 -1
- package/src/project/SessionContextMenuView.tsx +15 -7
- package/src/project/SessionRowMoreButton.tsx +50 -0
- package/src/project/SessionRowView.tsx +106 -63
- package/src/project/SessionTitleMarquee.tsx +54 -0
- package/src/project/SidebarProjectDisclosure.tsx +60 -0
- package/src/project/SidebarProjectsSectionView.tsx +6 -1
- package/src/project/index.ts +12 -0
- package/src/project/session-row-transition.ts +9 -0
- package/src/project/types.ts +4 -2
- package/src/project/useActiveSessionAutoScroll.ts +10 -4
- package/src/registry.ts +0 -2
- package/src/scheduler/AutomationDetailPaneView.tsx +68 -0
- package/src/scheduler/AutomationPageView.tsx +118 -121
- package/src/scheduler/ExecutionHistoryView.tsx +7 -5
- package/src/scheduler/TaskListView.tsx +52 -201
- package/src/scheduler/index.ts +7 -12
- package/src/settings/AchievementSettingsView.tsx +0 -1
- package/src/settings/AppshotSettingsView.tsx +0 -1
- package/src/settings/BuiltinMcpSectionView.tsx +1 -1
- package/src/settings/EnvironmentGitRowView.tsx +156 -0
- package/src/settings/EnvironmentSettingsView.tsx +25 -3
- package/src/settings/GeneralSettingsView.tsx +17 -20
- package/src/settings/ImChannelGuideDialogView.tsx +2 -2
- package/src/settings/ImFeishuDialogView.tsx +1 -1
- package/src/settings/ImLegacyImportBannerView.tsx +1 -1
- package/src/settings/ImLogDrawerView.tsx +2 -1
- package/src/settings/JsonConfigInputView.tsx +171 -0
- package/src/settings/ModelsFetchedModelsDrawerView.tsx +292 -0
- package/src/settings/ModelsProvidersSectionView.tsx +26 -23
- package/src/settings/MotionSelect.tsx +9 -7
- package/src/settings/NotificationSettingsView.tsx +79 -0
- package/src/settings/PermissionsSettingsView.tsx +3 -7
- package/src/settings/PresetProviderModelsListView.tsx +141 -24
- package/src/settings/PresetProviderRowView.tsx +205 -182
- package/src/settings/ProxySettingsSectionView.tsx +182 -0
- package/src/settings/QrBindDialogView.tsx +1 -1
- package/src/settings/QuickPanelSettingsSectionView.tsx +0 -2
- package/src/settings/RemoteMcpSectionView.tsx +1 -1
- package/src/settings/SettingChrome.tsx +2 -2
- package/src/settings/SettingsAiAssistButtonView.tsx +9 -119
- package/src/settings/SettingsFormFields.tsx +4 -7
- package/src/settings/SettingsSidebarView.tsx +64 -3
- package/src/settings/ShortcutRecorderView.test.tsx +108 -0
- package/src/settings/ShortcutRecorderView.tsx +15 -9
- package/src/settings/ShortcutsSettingsView.tsx +1 -1
- package/src/settings/SpaceEditorDialogView.tsx +120 -0
- package/src/settings/SpacesSettingsView.tsx +105 -0
- package/src/settings/WebhookEndpointListView.tsx +4 -5
- package/src/settings/index.ts +41 -29
- package/src/shared/ActivityStatusDot.tsx +69 -0
- package/src/shared/AvatarStackView.tsx +13 -13
- package/src/shared/BotAvatar.tsx +11 -9
- package/src/shared/CodeBlockCopyButton.tsx +1 -1
- package/src/shared/ContextMenuView.tsx +4 -11
- package/src/shared/MarkdownTable.tsx +2 -2
- package/src/shared/SyntaxHighlightedCode.tsx +0 -0
- package/src/shared/TabBar.outline.test.tsx +59 -0
- package/src/shared/TabBar.tsx +22 -17
- package/src/shared/VettaKbd.test.tsx +52 -0
- package/src/shared/VettaKbd.tsx +81 -0
- package/src/shared/connected-tab-outline.test.ts +2 -2
- package/src/shared/connected-tab-outline.ts +2 -1
- package/src/shared/index.ts +6 -0
- package/src/shared/kbd-keys.test.ts +61 -0
- package/src/shared/kbd-keys.ts +253 -0
- package/src/shared/provider-icon/icons.ts +4 -2
- package/src/shared/provider-icon/index.tsx +1 -1
- package/src/shared/provider-icon/magpie.svg +1 -0
- package/src/sidebar/AddProjectMenuTriggerView.tsx +25 -15
- package/src/sidebar/DefaultSidebar.tsx +3 -1
- package/src/sidebar/MessageCenterDialogView.tsx +3 -2
- package/src/sidebar/MessageCenterEmptyState.tsx +1 -1
- package/src/sidebar/MessageCenterTabs.tsx +1 -1
- package/src/sidebar/MessageCenterToolbarButton.tsx +1 -1
- package/src/sidebar/MessageCenterTriggerView.tsx +2 -2
- package/src/sidebar/ProjectsPanelEmptyState.tsx +26 -7
- package/src/sidebar/SessionStatusIcon.tsx +16 -1
- package/src/sidebar/SettingsMenuThemeSection.tsx +1 -1
- package/src/sidebar/SettingsMenuTriggerView.test.tsx +42 -0
- package/src/sidebar/SettingsMenuTriggerView.tsx +28 -50
- package/src/sidebar/ShowMoreSessionsButton.tsx +1 -1
- package/src/sidebar/SidebarFilterSelectView.tsx +8 -16
- package/src/sidebar/SidebarNavBadgeView.tsx +1 -1
- package/src/sidebar/SidebarNavIcon.tsx +1 -1
- package/src/sidebar/SidebarNavItemButton.tsx +1 -1
- package/src/sidebar/SidebarNavMorePanel.tsx +19 -7
- package/src/sidebar/SidebarNavigation.tsx +24 -15
- package/src/sidebar/SidebarPanel.tsx +11 -2
- package/src/sidebar/SidebarSectionTriggerLabel.tsx +20 -0
- package/src/sidebar/SidebarTopBar.tsx +10 -7
- package/src/sidebar/WaitingPulseBadge.tsx +19 -0
- package/src/sidebar/index.ts +1 -16
- package/src/skills/index.ts +0 -19
- package/src/skills/skill-icon.tsx +4 -8
- package/src/styles.css +24 -6
- package/src/chat/DefaultSceneCarousel.tsx +0 -113
- package/src/chat/SceneCard.tsx +0 -138
- package/src/scheduler/HistoryDrawerView.tsx +0 -149
- package/src/scheduler/TaskFormDialogView.tsx +0 -60
- package/src/settings/SubscriptionActionsView.tsx +0 -63
- package/src/settings/SubscriptionCardsView.tsx +0 -212
- package/src/settings/TeamDetailView.tsx +0 -148
- package/src/settings/TeamDialogsView.tsx +0 -151
- package/src/settings/TeamListView.tsx +0 -57
- package/src/settings/TeamSettingsView.tsx +0 -51
- package/src/settings/TokenActivityChartView.tsx +0 -286
- package/src/settings/UsageStatsView.tsx +0 -101
- package/src/settings/shouldCloseEmptyApiKeyEditor.test.ts +0 -135
- package/src/settings/shouldCloseEmptyApiKeyEditor.ts +0 -40
- package/src/settings/token-activity.test.ts +0 -195
- package/src/settings/token-activity.ts +0 -320
- package/src/sidebar/AddProjectMenuItem.tsx +0 -21
- package/src/sidebar/AddProjectMenuPopoverView.tsx +0 -52
- package/src/sidebar/NotificationMessageListView.tsx +0 -136
- package/src/sidebar/SettingsMenuAccountSection.tsx +0 -32
- package/src/sidebar/SettingsMenuQuotaSection.tsx +0 -45
- package/src/skills/SceneCardView.tsx +0 -194
- package/src/skills/SkillCardView.tsx +0 -186
- package/src/skills/SkillDetailDialogView.tsx +0 -138
- package/src/skills/SkillTagGroupView.tsx +0 -56
- package/src/skills/SkillToggleSwitch.tsx +0 -31
|
@@ -1,38 +1,68 @@
|
|
|
1
1
|
import { AnimatePresence, motion } from "motion/react";
|
|
2
|
-
import type
|
|
3
|
-
import { cn } from "@vetta-org/ui";
|
|
2
|
+
import { type JSX, type RefObject, useEffect, useState } from "react";
|
|
3
|
+
import { cn, OVERLAY_BACKDROP_CLASS, PANEL_SHADOW_CLASS } from "@vetta-org/ui/utils";
|
|
4
|
+
import { ReleaseNoteMarkdown } from "./ReleaseNoteMarkdown";
|
|
4
5
|
import { ThemeSurface } from "../appearance/ThemeSurface";
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
/**
|
|
8
|
+
* 更新对话框的底部状态条:检查中 / 下载进度 / 出错。
|
|
9
|
+
* 其余阶段(有新版本、已就绪、已是最新、版本介绍)不需要状态条,直接展示正文。
|
|
10
|
+
*/
|
|
11
|
+
export type UpdateRestartDialogStatus =
|
|
12
|
+
| { readonly kind: "checking"; readonly text: string }
|
|
13
|
+
| { readonly kind: "progress"; readonly text: string; readonly progress: number }
|
|
14
|
+
| { readonly kind: "error"; readonly text: string };
|
|
15
|
+
|
|
16
|
+
export interface UpdateRestartDialogAction {
|
|
17
|
+
readonly disabled?: boolean;
|
|
18
|
+
readonly label: string;
|
|
19
|
+
readonly onClick: () => void;
|
|
11
20
|
}
|
|
12
21
|
|
|
13
22
|
export interface UpdateRestartDialogViewProps {
|
|
14
|
-
readonly
|
|
23
|
+
readonly bannerSrc: string;
|
|
24
|
+
/** 无正文时的占位文案(如「暂无版本介绍」);有 releaseNote 时不显示。 */
|
|
25
|
+
readonly emptyText?: string;
|
|
26
|
+
readonly closeLabel: string;
|
|
15
27
|
readonly onClose: () => void;
|
|
16
|
-
readonly onInstall: () => void;
|
|
17
28
|
readonly overlayRef: RefObject<HTMLDivElement | null>;
|
|
29
|
+
/** 底部唯一的悬浮按钮;省略时不显示底栏,只能用右上角的关闭按钮离开。 */
|
|
30
|
+
readonly primary?: UpdateRestartDialogAction;
|
|
18
31
|
readonly releaseNote?: string;
|
|
32
|
+
readonly status?: UpdateRestartDialogStatus;
|
|
33
|
+
readonly subtitle?: string;
|
|
34
|
+
readonly title: string;
|
|
19
35
|
readonly visible: boolean;
|
|
36
|
+
/** 正文正在加载(版本介绍从磁盘读取时)。 */
|
|
37
|
+
readonly loading?: boolean;
|
|
20
38
|
}
|
|
21
39
|
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
"
|
|
25
|
-
const buttonSm =
|
|
26
|
-
"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem]";
|
|
40
|
+
// 底部主按钮:通栏胶囊,悬浮在正文之上。
|
|
41
|
+
const pillClass =
|
|
42
|
+
"pointer-events-auto inline-flex h-11 w-full items-center justify-center rounded-full bg-primary px-5 text-[14px] font-medium whitespace-nowrap text-primary-foreground shadow-lg shadow-black/15 transition-all outline-none select-none hover:bg-primary/90 focus-visible:ring-2 focus-visible:ring-ring/50 active:translate-y-px disabled:pointer-events-none disabled:opacity-50";
|
|
27
43
|
|
|
28
44
|
export function UpdateRestartDialogView({
|
|
29
|
-
|
|
45
|
+
bannerSrc,
|
|
46
|
+
closeLabel,
|
|
47
|
+
emptyText,
|
|
48
|
+
loading = false,
|
|
30
49
|
onClose,
|
|
31
|
-
onInstall,
|
|
32
50
|
overlayRef,
|
|
51
|
+
primary,
|
|
33
52
|
releaseNote,
|
|
53
|
+
status,
|
|
54
|
+
subtitle,
|
|
55
|
+
title,
|
|
34
56
|
visible,
|
|
35
57
|
}: UpdateRestartDialogViewProps): JSX.Element {
|
|
58
|
+
// 滚动后才显示顶部渐隐,初始位置横幅完整露出。
|
|
59
|
+
const [scrolled, setScrolled] = useState(false);
|
|
60
|
+
// 关闭后再打开,滚动位置回到顶部,渐隐也要复位。
|
|
61
|
+
useEffect(() => {
|
|
62
|
+
if (!visible) setScrolled(false);
|
|
63
|
+
}, [visible]);
|
|
64
|
+
const showEmpty = !loading && !releaseNote && !!emptyText;
|
|
65
|
+
|
|
36
66
|
return (
|
|
37
67
|
<AnimatePresence>
|
|
38
68
|
{visible && (
|
|
@@ -42,61 +72,93 @@ export function UpdateRestartDialogView({
|
|
|
42
72
|
animate={{ opacity: 1 }}
|
|
43
73
|
exit={{ opacity: 0 }}
|
|
44
74
|
transition={{ duration: 0.15 }}
|
|
45
|
-
className="fixed inset-0 z-[100] flex items-center justify-center
|
|
75
|
+
className={cn("pointer-events-auto fixed inset-0 z-[100] flex items-center justify-center", OVERLAY_BACKDROP_CLASS)}
|
|
46
76
|
onClick={(e) => {
|
|
47
77
|
if (e.target === overlayRef.current) onClose();
|
|
48
78
|
}}
|
|
49
79
|
>
|
|
50
80
|
<motion.div
|
|
81
|
+
role="dialog"
|
|
82
|
+
aria-modal="true"
|
|
83
|
+
aria-label={title}
|
|
51
84
|
initial={{ opacity: 0, scale: 0.95 }}
|
|
52
85
|
animate={{ opacity: 1, scale: 1 }}
|
|
53
86
|
exit={{ opacity: 0, scale: 0.95 }}
|
|
54
87
|
transition={{ duration: 0.15, ease: [0.25, 0.1, 0.25, 1] }}
|
|
55
|
-
className=
|
|
88
|
+
className={cn(
|
|
89
|
+
"relative flex max-h-[min(720px,calc(100vh-48px))] w-[min(600px,calc(100vw-32px))] flex-col overflow-hidden rounded-3xl bg-popover",
|
|
90
|
+
PANEL_SHADOW_CLASS,
|
|
91
|
+
)}
|
|
56
92
|
>
|
|
57
93
|
<ThemeSurface slot="root.updateRestartDialog.panel" />
|
|
58
|
-
<div className="relative z-10
|
|
59
|
-
<
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
94
|
+
<div className="relative z-10 flex min-h-0 flex-1 flex-col">
|
|
95
|
+
<button
|
|
96
|
+
type="button"
|
|
97
|
+
onClick={onClose}
|
|
98
|
+
aria-label={closeLabel}
|
|
99
|
+
// 纯白圆形:深浅色下都不随主题变色,靠双层投影从横幅和正文上浮起来。
|
|
100
|
+
className="absolute top-4 right-4 z-20 inline-flex size-8 items-center justify-center rounded-full bg-white text-neutral-900 shadow-[0_6px_18px_rgba(0,0,0,0.28),0_1px_3px_rgba(0,0,0,0.22)] transition-transform outline-none hover:scale-105 focus-visible:ring-2 focus-visible:ring-white/70 active:scale-95"
|
|
101
|
+
>
|
|
102
|
+
<span className="icon-[mdi--close] h-4 w-4" />
|
|
103
|
+
</button>
|
|
104
|
+
<div className="relative flex min-h-0 flex-1 flex-col">
|
|
105
|
+
<div
|
|
106
|
+
// no-scrollbar:全局 overlay 滚动条规则无 layer,Tailwind 的隐藏写法压不过它。
|
|
107
|
+
className="no-scrollbar min-h-0 flex-1 overflow-y-auto"
|
|
108
|
+
onScroll={(e) => setScrolled(e.currentTarget.scrollTop > 4)}
|
|
109
|
+
>
|
|
110
|
+
<img
|
|
111
|
+
src={bannerSrc}
|
|
112
|
+
alt=""
|
|
113
|
+
draggable={false}
|
|
114
|
+
className="h-[176px] w-full object-cover select-none"
|
|
115
|
+
/>
|
|
116
|
+
<div className={cn("px-7 pt-6", primary ? "pb-32" : "pb-12")}>
|
|
117
|
+
<h3 className="text-[19px] leading-snug font-semibold tracking-tight text-foreground">{title}</h3>
|
|
118
|
+
{subtitle && <p className="mt-1.5 text-[13px] leading-relaxed text-muted-foreground">{subtitle}</p>}
|
|
119
|
+
{status && <StatusLine status={status} />}
|
|
120
|
+
{releaseNote && (
|
|
121
|
+
<div className="mt-5">
|
|
122
|
+
<div className="markdown-body text-[13px] leading-[1.6] break-words text-muted-foreground">
|
|
123
|
+
<ReleaseNoteMarkdown>{releaseNote}</ReleaseNoteMarkdown>
|
|
124
|
+
</div>
|
|
125
|
+
</div>
|
|
126
|
+
)}
|
|
127
|
+
{loading && (
|
|
128
|
+
<div className="mt-5 flex items-center gap-2 text-[13px] text-muted-foreground">
|
|
129
|
+
<span className="icon-[mdi--loading] h-4 w-4 animate-spin" />
|
|
130
|
+
</div>
|
|
131
|
+
)}
|
|
132
|
+
{showEmpty && <p className="mt-5 text-[13px] text-muted-foreground">{emptyText}</p>}
|
|
133
|
+
</div>
|
|
69
134
|
</div>
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
<button
|
|
73
|
-
type="button"
|
|
74
|
-
data-slot="button"
|
|
75
|
-
data-variant="ghost"
|
|
76
|
-
data-size="sm"
|
|
135
|
+
<div
|
|
136
|
+
aria-hidden
|
|
77
137
|
className={cn(
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
"text-muted-foreground hover:bg-accent/50 hover:text-foreground",
|
|
138
|
+
"pointer-events-none absolute inset-x-0 top-0 h-12 bg-gradient-to-b from-popover to-transparent transition-opacity duration-150",
|
|
139
|
+
scrolled ? "opacity-100" : "opacity-0",
|
|
81
140
|
)}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
</button>
|
|
86
|
-
<button
|
|
87
|
-
type="button"
|
|
88
|
-
data-slot="button"
|
|
89
|
-
data-variant="primary"
|
|
90
|
-
data-size="sm"
|
|
141
|
+
/>
|
|
142
|
+
{/* 底部渐隐常驻:有按钮时更厚(按钮下方一段是实色),没按钮时只是一道薄薄的收边。 */}
|
|
143
|
+
<div
|
|
91
144
|
className={cn(
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
145
|
+
"pointer-events-none absolute inset-x-0 bottom-0 bg-gradient-to-t from-popover",
|
|
146
|
+
primary
|
|
147
|
+
? "via-popover/90 from-[55%] to-transparent px-7 pt-20 pb-7"
|
|
148
|
+
: "h-10 to-transparent",
|
|
95
149
|
)}
|
|
96
|
-
onClick={onInstall}
|
|
97
150
|
>
|
|
98
|
-
{
|
|
99
|
-
|
|
151
|
+
{primary && (
|
|
152
|
+
<button
|
|
153
|
+
type="button"
|
|
154
|
+
onClick={primary.onClick}
|
|
155
|
+
disabled={primary.disabled}
|
|
156
|
+
className={pillClass}
|
|
157
|
+
>
|
|
158
|
+
{primary.label}
|
|
159
|
+
</button>
|
|
160
|
+
)}
|
|
161
|
+
</div>
|
|
100
162
|
</div>
|
|
101
163
|
</div>
|
|
102
164
|
</motion.div>
|
|
@@ -105,3 +167,26 @@ export function UpdateRestartDialogView({
|
|
|
105
167
|
</AnimatePresence>
|
|
106
168
|
);
|
|
107
169
|
}
|
|
170
|
+
|
|
171
|
+
function StatusLine({ status }: { readonly status: UpdateRestartDialogStatus }): JSX.Element {
|
|
172
|
+
if (status.kind === "progress") {
|
|
173
|
+
const percent = Math.max(0, Math.min(100, Math.round(status.progress * 100)));
|
|
174
|
+
return (
|
|
175
|
+
<div className="mt-4">
|
|
176
|
+
<div className="h-1.5 w-full overflow-hidden rounded-full bg-muted">
|
|
177
|
+
<div className="h-full rounded-full bg-primary transition-[width] duration-300" style={{ width: `${percent}%` }} />
|
|
178
|
+
</div>
|
|
179
|
+
<p className="mt-2 text-[12px] text-muted-foreground">{status.text}</p>
|
|
180
|
+
</div>
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
if (status.kind === "checking") {
|
|
184
|
+
return (
|
|
185
|
+
<p className="mt-4 flex items-center gap-2 text-[13px] text-muted-foreground">
|
|
186
|
+
<span className="icon-[mdi--loading] h-4 w-4 animate-spin" />
|
|
187
|
+
{status.text}
|
|
188
|
+
</p>
|
|
189
|
+
);
|
|
190
|
+
}
|
|
191
|
+
return <p className="mt-4 text-[13px] break-words text-destructive">{status.text}</p>;
|
|
192
|
+
}
|
|
@@ -20,6 +20,8 @@ export interface CommandMenuItemView {
|
|
|
20
20
|
/** iconify 类名,例如 `icon-[solar--folder-linear]`。 */
|
|
21
21
|
readonly icon: string;
|
|
22
22
|
readonly badge?: string;
|
|
23
|
+
/** 行尾的标签色点(管理会话用),按给定顺序排列。 */
|
|
24
|
+
readonly tagColors?: readonly string[];
|
|
23
25
|
/** 命中了但当前打不开(例如无权限的会话):显示但禁用,不静默过滤。 */
|
|
24
26
|
readonly disabled?: boolean;
|
|
25
27
|
readonly disabledReason?: string;
|
|
@@ -39,27 +39,8 @@
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
/* 输入框聚焦时下沿的一次性点亮,收束后保持静止。 */
|
|
43
|
-
.command-menu-input-underline {
|
|
44
|
-
transform-origin: center;
|
|
45
|
-
animation: command-menu-underline-in 240ms cubic-bezier(0.25, 0.1, 0.25, 1) 1 both;
|
|
46
|
-
will-change: transform, opacity;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
@keyframes command-menu-underline-in {
|
|
50
|
-
from {
|
|
51
|
-
opacity: 0;
|
|
52
|
-
transform: scaleX(0.6);
|
|
53
|
-
}
|
|
54
|
-
to {
|
|
55
|
-
opacity: 1;
|
|
56
|
-
transform: scaleX(1);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
42
|
@media (prefers-reduced-motion: reduce) {
|
|
61
|
-
.command-menu-sheen::after
|
|
62
|
-
.command-menu-input-underline {
|
|
43
|
+
.command-menu-sheen::after {
|
|
63
44
|
animation: none;
|
|
64
45
|
}
|
|
65
46
|
|
package/src/overlays/index.ts
CHANGED
|
@@ -25,6 +25,18 @@ export type {
|
|
|
25
25
|
RouteErrorPageViewProps,
|
|
26
26
|
} from "./RouteErrorPageView";
|
|
27
27
|
export { RouteErrorPageView } from "./RouteErrorPageView";
|
|
28
|
+
export type { SplashOptionRowProps } from "./SplashOptionRow";
|
|
29
|
+
export { SplashOptionRow } from "./SplashOptionRow";
|
|
30
|
+
export type { SplashPanelProps } from "./SplashPanel";
|
|
31
|
+
export { SplashPanel } from "./SplashPanel";
|
|
32
|
+
export type { SplashInputHeaderProps, SplashTitleHeaderProps } from "./SplashParts";
|
|
33
|
+
export {
|
|
34
|
+
SplashFooter,
|
|
35
|
+
SplashInputHeader,
|
|
36
|
+
SplashNotice,
|
|
37
|
+
SplashStep,
|
|
38
|
+
SplashTitleHeader,
|
|
39
|
+
} from "./SplashParts";
|
|
28
40
|
export type {
|
|
29
41
|
ToasterItemView,
|
|
30
42
|
ToasterVariant,
|
|
@@ -38,7 +50,8 @@ export type {
|
|
|
38
50
|
} from "./UpdateCheckerView";
|
|
39
51
|
export { UpdateCheckerAction, UpdateCheckerDetail, UpdateCheckerView } from "./UpdateCheckerView";
|
|
40
52
|
export type {
|
|
41
|
-
|
|
53
|
+
UpdateRestartDialogAction,
|
|
54
|
+
UpdateRestartDialogStatus,
|
|
42
55
|
UpdateRestartDialogViewProps,
|
|
43
56
|
} from "./UpdateRestartDialogView";
|
|
44
57
|
export { UpdateRestartDialogView } from "./UpdateRestartDialogView";
|
package/src/plugin-ui/index.ts
CHANGED
|
@@ -18,9 +18,17 @@ export type {
|
|
|
18
18
|
ModelSelectorLabels,
|
|
19
19
|
ModelSelectorOptionView,
|
|
20
20
|
ModelSelectorProviderGroup,
|
|
21
|
+
ModelSelectorTriggerVariant,
|
|
21
22
|
ModelSelectorViewProps,
|
|
22
23
|
} from "../chat/ModelSelectorView";
|
|
23
24
|
export { ModelSelectorView } from "../chat/ModelSelectorView";
|
|
25
|
+
export type { MotionSelectOption, MotionSelectProps } from "../settings/MotionSelect";
|
|
26
|
+
export { MotionSelect } from "../settings/MotionSelect";
|
|
27
|
+
export type { SettingSectionMeta } from "../settings/SettingChrome";
|
|
28
|
+
export { SettingHeading, SettingRow, SettingSection } from "../settings/SettingChrome";
|
|
29
|
+
export type { VettaKbdKey, VettaKbdPlatform } from "../shared/kbd-keys";
|
|
24
30
|
export type { MultiplierTagProps } from "../shared/MultiplierTag";
|
|
25
31
|
export { fmtMultiplier, MultiplierTag } from "../shared/MultiplierTag";
|
|
26
32
|
export { getProviderIcon, PROVIDER_ICONS, ProviderIcon } from "../shared/provider-icon";
|
|
33
|
+
export type { VettaKbdProps, VettaKbdSize } from "../shared/VettaKbd";
|
|
34
|
+
export { VettaKbd } from "../shared/VettaKbd";
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import { Button
|
|
1
|
+
import { Button } from "@vetta-org/ui/button";
|
|
2
|
+
import { cn } from "@vetta-org/ui/utils";
|
|
3
|
+
import { Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle } from "@vetta-org/ui/dialog";
|
|
4
|
+
import { Input } from "@vetta-org/ui/input";
|
|
2
5
|
import { useCallback, useEffect, useRef, useState, type JSX } from "react";
|
|
3
6
|
|
|
4
7
|
export interface ConversationTagEditorTagView {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { cn } from "@vetta-org/ui";
|
|
1
|
+
import { cn } from "@vetta-org/ui/utils";
|
|
2
2
|
import type { JSX, ReactNode } from "react";
|
|
3
3
|
|
|
4
4
|
export interface DefaultConversationSectionViewLabels {
|
|
@@ -43,7 +43,7 @@ export function DefaultConversationSectionView({
|
|
|
43
43
|
return (
|
|
44
44
|
<div className={cn("flex flex-col", className)}>
|
|
45
45
|
<div
|
|
46
|
-
className="group -mx-1.5 flex shrink-0 items-center justify-between pb-1 pl-
|
|
46
|
+
className="group -mx-1.5 flex shrink-0 items-center justify-between pb-1 pl-1.5 pr-2.5 pt-1"
|
|
47
47
|
onContextMenu={onOpenContextMenu}
|
|
48
48
|
>
|
|
49
49
|
<div className="flex min-w-0 items-center gap-0.5">{filterSelect}</div>
|
|
@@ -54,7 +54,7 @@ export function DefaultConversationSectionView({
|
|
|
54
54
|
onClick={onMoreClick}
|
|
55
55
|
className={actionButtonClass}
|
|
56
56
|
>
|
|
57
|
-
<span className="icon-[solar--menu-dots-
|
|
57
|
+
<span className="icon-[solar--menu-dots-bold] h-4 w-4" />
|
|
58
58
|
</button>
|
|
59
59
|
{showNewSession && onNewSession && (
|
|
60
60
|
<button
|
|
@@ -63,7 +63,7 @@ export function DefaultConversationSectionView({
|
|
|
63
63
|
onClick={onNewSession}
|
|
64
64
|
className={actionButtonClass}
|
|
65
65
|
>
|
|
66
|
-
<span className="icon-[solar--add-
|
|
66
|
+
<span className="icon-[solar--add-linear] h-4 w-4" />
|
|
67
67
|
</button>
|
|
68
68
|
)}
|
|
69
69
|
</div>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { cn } from "@vetta-org/ui";
|
|
1
|
+
import { cn } from "@vetta-org/ui/utils";
|
|
2
2
|
import { useRef, type JSX, type ReactNode } from "react";
|
|
3
3
|
import { Virtuoso, type VirtuosoHandle } from "react-virtuoso";
|
|
4
4
|
import {
|
|
@@ -16,6 +16,8 @@ export interface DefaultSessionListViewItem {
|
|
|
16
16
|
export interface DefaultSessionListViewLabels {
|
|
17
17
|
collapse: string;
|
|
18
18
|
expand: string;
|
|
19
|
+
/** Accessible name for each row's hover "more" trigger. */
|
|
20
|
+
more: string;
|
|
19
21
|
/** Primary empty-state line. */
|
|
20
22
|
emptyTitle: string;
|
|
21
23
|
/** Guidance under the title. */
|
|
@@ -45,7 +47,6 @@ export function DefaultSessionListView<T extends DefaultSessionListViewItem>({
|
|
|
45
47
|
hasMore,
|
|
46
48
|
labels,
|
|
47
49
|
loading = false,
|
|
48
|
-
onEmptyAction,
|
|
49
50
|
onToggleShowAll,
|
|
50
51
|
renderSession,
|
|
51
52
|
scrollParent,
|
|
@@ -60,35 +61,8 @@ export function DefaultSessionListView<T extends DefaultSessionListViewItem>({
|
|
|
60
61
|
useActiveSessionAutoScroll({ activeIndex, activeKey, scrollParent, virtuosoRef });
|
|
61
62
|
if (loading) return <ProjectSessionsLoadingView />;
|
|
62
63
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
return (
|
|
66
|
-
<div
|
|
67
|
-
className={cn(
|
|
68
|
-
"flex flex-col items-center gap-2.5 px-3 py-8 text-center",
|
|
69
|
-
className,
|
|
70
|
-
)}
|
|
71
|
-
>
|
|
72
|
-
<div className="flex h-10 w-10 items-center justify-center rounded-xl bg-muted/60">
|
|
73
|
-
<span className="icon-[solar--chat-round-line-linear] h-5 w-5 text-muted-foreground/70" />
|
|
74
|
-
</div>
|
|
75
|
-
<div className="flex flex-col gap-1">
|
|
76
|
-
<p className="text-[12px] font-medium text-foreground/80">{labels.emptyTitle}</p>
|
|
77
|
-
<p className="text-[11px] leading-relaxed text-muted-foreground">{labels.emptyDescription}</p>
|
|
78
|
-
</div>
|
|
79
|
-
{showAction && (
|
|
80
|
-
<button
|
|
81
|
-
type="button"
|
|
82
|
-
onClick={onEmptyAction}
|
|
83
|
-
className="mt-0.5 inline-flex items-center gap-1 rounded-md bg-primary/10 px-2.5 py-1.5 text-[11px] font-medium text-primary transition-colors hover:bg-primary/15"
|
|
84
|
-
>
|
|
85
|
-
<span className="icon-[solar--add-circle-linear] h-3.5 w-3.5 shrink-0" />
|
|
86
|
-
{labels.emptyAction}
|
|
87
|
-
</button>
|
|
88
|
-
)}
|
|
89
|
-
</div>
|
|
90
|
-
);
|
|
91
|
-
}
|
|
64
|
+
// 空状态的引导统一放在项目区的卡片里,对话区本身不放内容。
|
|
65
|
+
if (totalCount === 0) return <></>;
|
|
92
66
|
|
|
93
67
|
const useVirtual = showAll && scrollParent != null;
|
|
94
68
|
|
|
@@ -1,8 +1,15 @@
|
|
|
1
|
-
import { cn } from "@vetta-org/ui";
|
|
1
|
+
import { cn } from "@vetta-org/ui/utils";
|
|
2
2
|
import { memo, type JSX } from "react";
|
|
3
3
|
import { AvatarStackView } from "../shared/AvatarStackView";
|
|
4
|
+
import { SessionStatusIcon } from "../sidebar/SessionStatusIcon";
|
|
4
5
|
import { ConversationTagDotsView } from "./ConversationTagDotsView";
|
|
6
|
+
import { IMMEDIATE_SESSION_SELECTION_STYLE } from "./session-row-transition";
|
|
5
7
|
import { SessionRenameInputView } from "./SessionRenameInputView";
|
|
8
|
+
import {
|
|
9
|
+
SESSION_ROW_CONTENT_FADE_CLASS,
|
|
10
|
+
SessionRowMoreButton,
|
|
11
|
+
} from "./SessionRowMoreButton";
|
|
12
|
+
import { SessionTitleMarquee } from "./SessionTitleMarquee";
|
|
6
13
|
import { prepareSidebarSelection } from "./useActiveSessionAutoScroll";
|
|
7
14
|
|
|
8
15
|
export interface DefaultSessionRowViewProps {
|
|
@@ -22,6 +29,8 @@ export interface DefaultSessionRowViewProps {
|
|
|
22
29
|
forked?: boolean;
|
|
23
30
|
/** Tag colors carried by this conversation; replaces the leading icon when present. */
|
|
24
31
|
tagColors?: readonly string[];
|
|
32
|
+
/** Accessible name for the hover "more" trigger. */
|
|
33
|
+
moreLabel?: string;
|
|
25
34
|
onOpenContextMenu: (event: React.MouseEvent) => void;
|
|
26
35
|
onRename: (name: string) => void;
|
|
27
36
|
onRenameDone: () => void;
|
|
@@ -30,6 +39,13 @@ export interface DefaultSessionRowViewProps {
|
|
|
30
39
|
renaming: boolean;
|
|
31
40
|
running: boolean;
|
|
32
41
|
scheduled: boolean;
|
|
42
|
+
/** 会话正等着用户处理;优先于 running/scheduled,左侧换成停转的琥珀色问号。 */
|
|
43
|
+
waiting?: boolean;
|
|
44
|
+
/** 自动化会话组组头:本组运行次数。存在时整行点击即展开/收起,不提供更多菜单。 */
|
|
45
|
+
groupCount?: number;
|
|
46
|
+
groupExpanded?: boolean;
|
|
47
|
+
/** 会话组展开后的组员行,缩进一级。 */
|
|
48
|
+
nested?: boolean;
|
|
33
49
|
}
|
|
34
50
|
|
|
35
51
|
/** memo:理由同 SessionRowView——切换会话只改两行,其余行 props 未变。 */
|
|
@@ -42,6 +58,7 @@ export const DefaultSessionRowView = memo(function DefaultSessionRowView({
|
|
|
42
58
|
sessionPath,
|
|
43
59
|
titleExtra,
|
|
44
60
|
forked,
|
|
61
|
+
moreLabel,
|
|
45
62
|
onOpenContextMenu,
|
|
46
63
|
onRename,
|
|
47
64
|
onRenameDone,
|
|
@@ -50,12 +67,16 @@ export const DefaultSessionRowView = memo(function DefaultSessionRowView({
|
|
|
50
67
|
renaming,
|
|
51
68
|
running,
|
|
52
69
|
scheduled,
|
|
70
|
+
waiting = false,
|
|
71
|
+
groupCount,
|
|
72
|
+
groupExpanded,
|
|
73
|
+
nested = false,
|
|
53
74
|
tagColors,
|
|
54
75
|
}: DefaultSessionRowViewProps): JSX.Element {
|
|
55
76
|
const title = renaming ? undefined : titleExtra ? `${label}\n${titleExtra}` : label;
|
|
56
|
-
//
|
|
77
|
+
// 标签色点让位于「等你处理 / 正在运行 / 已排期」这类瞬时状态——它们是需要立刻读到的信号,
|
|
57
78
|
// 标签则是长期归属,挤掉钉住/分叉图标即可。
|
|
58
|
-
const showTagDots = !running && !scheduled && tagColors !== undefined && tagColors.length > 0;
|
|
79
|
+
const showTagDots = !waiting && !running && !scheduled && tagColors !== undefined && tagColors.length > 0;
|
|
59
80
|
const leadingIconClassName = running
|
|
60
81
|
? "project-running-icon icon-[solar--refresh-linear] animate-spin"
|
|
61
82
|
: scheduled
|
|
@@ -64,62 +85,92 @@ export const DefaultSessionRowView = memo(function DefaultSessionRowView({
|
|
|
64
85
|
? "icon-[mdi--source-fork]"
|
|
65
86
|
: pinned
|
|
66
87
|
? "icon-[solar--pin-linear] text-primary/80"
|
|
67
|
-
: iconClassName
|
|
88
|
+
: iconClassName;
|
|
68
89
|
return (
|
|
69
|
-
<
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
<span
|
|
101
|
-
data-session-leading-icon="true"
|
|
102
|
-
aria-hidden="true"
|
|
103
|
-
className={cn(
|
|
104
|
-
leadingIconClassName,
|
|
105
|
-
"h-3.5 w-3.5 shrink-0",
|
|
106
|
-
active ? "text-foreground/70" : "text-muted-foreground/50",
|
|
107
|
-
)}
|
|
108
|
-
/>
|
|
109
|
-
)}
|
|
110
|
-
<span
|
|
90
|
+
<div className="group/session-row relative">
|
|
91
|
+
<button
|
|
92
|
+
type="button"
|
|
93
|
+
data-session-active={active ? "true" : undefined}
|
|
94
|
+
aria-expanded={groupCount !== undefined ? groupExpanded === true : undefined}
|
|
95
|
+
data-session-path={sessionPath || undefined}
|
|
96
|
+
onClick={(event) => {
|
|
97
|
+
if (renaming) return;
|
|
98
|
+
prepareSidebarSelection(event.currentTarget);
|
|
99
|
+
onSelect();
|
|
100
|
+
}}
|
|
101
|
+
onContextMenu={(event) => {
|
|
102
|
+
event.preventDefault();
|
|
103
|
+
if (!contextMenuEnabled) return;
|
|
104
|
+
onOpenContextMenu(event);
|
|
105
|
+
}}
|
|
106
|
+
className={cn(
|
|
107
|
+
"flex w-full items-center gap-2 rounded-md py-[6px] pr-2.5 text-left",
|
|
108
|
+
nested ? "pl-7" : "pl-2.5",
|
|
109
|
+
active ? "bg-primary/15 text-foreground" : "hover:bg-accent/50",
|
|
110
|
+
)}
|
|
111
|
+
style={IMMEDIATE_SESSION_SELECTION_STYLE}
|
|
112
|
+
>
|
|
113
|
+
{renaming ? (
|
|
114
|
+
<SessionRenameInputView
|
|
115
|
+
initialValue={label}
|
|
116
|
+
onCancel={onRenameDone}
|
|
117
|
+
onCommit={onRename}
|
|
118
|
+
/>
|
|
119
|
+
) : (
|
|
120
|
+
<div
|
|
111
121
|
className={cn(
|
|
112
|
-
"min-w-0 flex-1
|
|
113
|
-
|
|
122
|
+
"flex min-w-0 flex-1 items-center gap-2",
|
|
123
|
+
SESSION_ROW_CONTENT_FADE_CLASS,
|
|
114
124
|
)}
|
|
115
125
|
>
|
|
116
|
-
{
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
126
|
+
{waiting ? (
|
|
127
|
+
<SessionStatusIcon active={active} running={running} scheduled={scheduled} waiting />
|
|
128
|
+
) : showTagDots ? (
|
|
129
|
+
<ConversationTagDotsView colors={tagColors} />
|
|
130
|
+
) : leadingIconClassName ? (
|
|
131
|
+
<span
|
|
132
|
+
data-session-leading-icon="true"
|
|
133
|
+
aria-hidden="true"
|
|
134
|
+
className={cn(
|
|
135
|
+
leadingIconClassName,
|
|
136
|
+
"h-3.5 w-3.5 shrink-0",
|
|
137
|
+
active ? "text-foreground/70" : "text-muted-foreground/50",
|
|
138
|
+
)}
|
|
139
|
+
/>
|
|
140
|
+
) : null}
|
|
141
|
+
<SessionTitleMarquee
|
|
142
|
+
className={cn(
|
|
143
|
+
"text-[13px]",
|
|
144
|
+
active ? "font-semibold text-foreground" : "text-foreground",
|
|
145
|
+
)}
|
|
146
|
+
label={label}
|
|
147
|
+
title={title}
|
|
148
|
+
/>
|
|
149
|
+
{trailingAvatarUrls && trailingAvatarUrls.length > 0 ? (
|
|
150
|
+
<AvatarStackView avatarUrls={trailingAvatarUrls} />
|
|
151
|
+
) : null}
|
|
152
|
+
{groupCount !== undefined ? (
|
|
153
|
+
<>
|
|
154
|
+
<span className="shrink-0 text-[11px] tabular-nums text-muted-foreground/60">{groupCount}</span>
|
|
155
|
+
<span
|
|
156
|
+
aria-hidden="true"
|
|
157
|
+
className={cn(
|
|
158
|
+
"icon-[mdi--chevron-right] h-3.5 w-3.5 shrink-0 text-muted-foreground/60 transition-transform",
|
|
159
|
+
groupExpanded && "rotate-90",
|
|
160
|
+
)}
|
|
161
|
+
/>
|
|
162
|
+
</>
|
|
163
|
+
) : null}
|
|
164
|
+
</div>
|
|
165
|
+
)}
|
|
166
|
+
</button>
|
|
167
|
+
{renaming || !contextMenuEnabled || groupCount !== undefined ? null : (
|
|
168
|
+
<SessionRowMoreButton
|
|
169
|
+
className="rounded-r-md"
|
|
170
|
+
label={moreLabel}
|
|
171
|
+
onOpen={onOpenContextMenu}
|
|
172
|
+
/>
|
|
122
173
|
)}
|
|
123
|
-
</
|
|
174
|
+
</div>
|
|
124
175
|
);
|
|
125
176
|
});
|