@vetta-org/theme-ui 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +740 -20
- package/src/action-approval/AppearanceActionPickerView.tsx +2 -78
- package/src/action-approval/AppearanceApprovalDrawerView.tsx +2 -9
- package/src/action-approval/BatchTasksApprovalFrameView.tsx +4 -1
- package/src/action-approval/GenericActionApprovalView.tsx +2 -9
- package/src/action-approval/ManageActionApprovalFrameView.tsx +4 -1
- package/src/action-approval/NavigationOpenApprovalView.tsx +2 -9
- package/src/action-approval/SchedulerActionApprovalDialogView.tsx +3 -1
- package/src/action-approval/SchedulerEditApprovalDrawerView.tsx +3 -10
- package/src/action-approval/index.ts +0 -1
- package/src/activity/ActivityPanel.tsx +13 -10
- package/src/activity/ActivityPanelFrame.test.tsx +32 -0
- package/src/activity/ActivityPanelFrame.tsx +3 -2
- package/src/activity/BackgroundTasksTabPanelView.tsx +1 -1
- package/src/activity/BrowserPanelView.tsx +48 -49
- package/src/activity/CodePreview.tsx +15 -1
- package/src/activity/DebugTabPanelView.tsx +1 -1
- package/src/activity/MarkdownPreviewView.test.tsx +53 -0
- package/src/activity/MarkdownPreviewView.tsx +135 -62
- package/src/activity/PluginTabPickerView.tsx +5 -3
- package/src/activity/PortsTabPanelView.tsx +911 -0
- package/src/activity/ToolCallsSubTabView.tsx +1 -1
- package/src/activity/WorkflowTabPanelView.tsx +1 -1
- package/src/activity/index.ts +9 -0
- package/src/app/AppBackground.tsx +1 -1
- package/src/app/AppBootLoadingView.tsx +4 -2
- package/src/app-shell/DefaultWindowControls.tsx +1 -1
- package/src/app-shell/PageHeaderActionGroup.tsx +1 -1
- package/src/app-shell/PageHeaderContent.tsx +36 -7
- package/src/app-shell/PageHeaderFrame.tsx +15 -3
- package/src/app-shell/PageHeaderSidebarTrigger.tsx +1 -1
- package/src/app-shell/PageHeaderTitle.tsx +1 -1
- package/src/app-shell/WindowControlButton.tsx +1 -1
- package/src/app-shell/header-crowding.test.ts +62 -0
- package/src/app-shell/header-crowding.tsx +137 -0
- package/src/appearance/BackgroundImageFrame.tsx +1 -1
- package/src/appearance/CenterSliceImageFrame.tsx +1 -1
- package/src/appearance/CornerImageFrame.tsx +1 -1
- package/src/appearance/HorizontalSliceImageFrame.tsx +1 -1
- package/src/appearance/NineSliceImageFrame.tsx +1 -1
- package/src/appearance/ThemeSurface.tsx +1 -1
- package/src/batch-tasks/BatchProjectFoldersFieldView.tsx +2 -1
- package/src/batch-tasks/BatchTaskProjectActionsView.test.tsx +97 -0
- package/src/batch-tasks/BatchTaskProjectActionsView.tsx +45 -35
- package/src/batch-tasks/batchTaskUi.tsx +0 -29
- package/src/bottom-panel/BottomPanelView.test.tsx +43 -0
- package/src/bottom-panel/BottomPanelView.tsx +222 -0
- package/src/bottom-panel/index.ts +26 -0
- package/src/chat/AgentAvatarView.tsx +1 -1
- package/src/chat/AnnotationViews.tsx +107 -0
- package/src/chat/AskUserQuestionView.tsx +18 -11
- package/src/chat/AssistantMessageView.tsx +48 -13
- package/src/chat/AtPanelView.test.tsx +61 -0
- package/src/chat/AtPanelView.tsx +63 -38
- package/src/chat/BashTerminalCard.tsx +1 -2
- package/src/chat/ChatHeaderActionsView.tsx +74 -18
- package/src/chat/CompactionStepView.test.tsx +34 -0
- package/src/chat/CompactionStepView.tsx +85 -0
- package/src/chat/ContextRingView.test.tsx +81 -0
- package/src/chat/ContextRingView.tsx +78 -62
- package/src/chat/ExecutionModeSelectorView.tsx +20 -5
- package/src/chat/HeaderActionBarView.tsx +806 -0
- package/src/chat/HeaderActionOverflowMenu.tsx +128 -0
- package/src/chat/InlineModelPicker.test.tsx +81 -0
- package/src/chat/InlineModelPicker.tsx +201 -0
- package/src/chat/InlineTokenChip.tsx +2 -68
- package/src/chat/InputBarBackground.tsx +1 -1
- package/src/chat/InputBarPlaceholder.tsx +26 -3
- package/src/chat/LiveThinkingView.tsx +51 -37
- package/src/chat/MessageBoundaryViews.tsx +21 -0
- package/src/chat/MessageFeedContext.tsx +13 -5
- package/src/chat/MessageFeedLayoutView.tsx +29 -3
- package/src/chat/MessageFeedView.test.tsx +81 -0
- package/src/chat/MessageFeedView.tsx +72 -152
- package/src/chat/MessageInputView.tsx +6 -2
- package/src/chat/MessageLayoutView.tsx +1 -1
- package/src/chat/MessageSelectionContextMenuView.tsx +4 -1
- package/src/chat/MessageTimelineView.tsx +1 -1
- package/src/chat/MessageView.tsx +1 -1
- package/src/chat/MessageVisualView.tsx +1 -1
- package/src/chat/ModelConfiguration.tsx +283 -0
- package/src/chat/ModelSelectorTrigger.tsx +63 -0
- package/src/chat/ModelSelectorView.tsx +1037 -223
- package/src/chat/NewSession.ts +1 -37
- package/src/chat/NewSessionPicker.tsx +3 -2
- package/src/chat/ProjectSelectorView.tsx +3 -2
- package/src/chat/ReasoningStepSlider.tsx +61 -0
- package/src/chat/RemoteSessionBadgeView.tsx +24 -0
- package/src/chat/SkillPromptAreaView.tsx +5 -19
- package/src/chat/TeamMemberReplyCardView.test.tsx +33 -0
- package/src/chat/TeamMemberReplyCardView.tsx +133 -0
- package/src/chat/TextBlockView.tsx +7 -770
- package/src/chat/TodoProgress.tsx +25 -53
- package/src/chat/TodoStatusBarView.tsx +14 -5
- package/src/chat/UserMessageView.tsx +113 -33
- package/src/chat/header-action-narrow.test.ts +21 -0
- package/src/chat/header-action-narrow.ts +38 -0
- package/src/chat/index.ts +33 -27
- package/src/chat/markdown-link.ts +7 -279
- package/src/chat/message-feed-fade.css +80 -0
- package/src/chat/message-feed-fade.test.tsx +75 -0
- package/src/chat/send-button.css +4 -22
- package/src/chat/streaming-reveal.test.ts +218 -0
- package/src/chat/streaming-reveal.ts +13 -0
- package/src/file-explorer/ConfirmDeleteDialogView.tsx +2 -1
- package/src/file-explorer/FileContextMenuView.tsx +44 -11
- package/src/file-explorer/FileExplorerSettingsView.tsx +97 -0
- package/src/file-explorer/FileTreeCreateRow.tsx +1 -1
- package/src/file-explorer/FileTreeNodeView.tsx +59 -18
- package/src/file-explorer/FileTreeView.tsx +236 -129
- package/src/file-explorer/file-tree-dom.ts +23 -0
- package/src/file-explorer/file-tree-rows.test.ts +74 -0
- package/src/file-explorer/file-tree-rows.ts +168 -0
- package/src/file-explorer/index.ts +17 -0
- package/src/file-explorer/types.ts +3 -0
- package/src/file-explorer/useFileTreeMarqueeSelection.ts +24 -16
- package/src/file-preview/FilePreviewDialogView.tsx +2 -2
- package/src/file-preview/FilePreviewView.tsx +12 -2
- package/src/file-preview/ReadonlyCodeView.tsx +46 -0
- package/src/file-preview/TextFileEditorView.tsx +2 -1
- package/src/file-preview/syntax-tokens.css +1 -1
- package/src/image-assets.d.ts +4 -0
- package/src/index.ts +1 -0
- package/src/knowledge/KnowledgeHowItWorksDialogView.tsx +1 -1
- package/src/layout/AppFrame.tsx +3 -2
- package/src/layout/MainContentFrame.tsx +7 -2
- package/src/layout/ResizeHandle.tsx +68 -17
- package/src/layout/SidebarDock.tsx +75 -19
- package/src/layout/SidebarOverlay.tsx +1 -1
- package/src/layout/index.ts +1 -1
- package/src/layout/resize-handle-axis.test.ts +51 -0
- package/src/live-indicators.test.ts +43 -0
- package/src/markdown/CodeBlock.tsx +123 -0
- package/src/markdown/FileLinkBadge.tsx +77 -0
- package/src/markdown/InlineTokenChip.tsx +68 -0
- package/src/markdown/MarkdownContent.tsx +418 -0
- package/src/markdown/MarkdownImage.tsx +41 -0
- package/src/markdown/MathFormula.tsx +46 -0
- package/src/markdown/MermaidBlock.tsx +82 -0
- package/src/markdown/RichCodeBlock.tsx +127 -0
- package/src/markdown/SvgPreview.tsx +45 -0
- package/src/markdown/WebsiteIcon.tsx +94 -0
- package/src/markdown/builtin-renderers.tsx +43 -0
- package/src/markdown/definition.tsx +49 -0
- package/src/markdown/host.tsx +18 -0
- package/src/markdown/image-actions.ts +29 -0
- package/src/markdown/index.ts +12 -0
- package/src/markdown/inline-tokens.ts +187 -0
- package/src/markdown/markdown-link.ts +279 -0
- package/src/markdown/math-client.ts +116 -0
- package/src/markdown/math-render.ts +23 -0
- package/src/markdown/math-syntax.ts +80 -0
- package/src/markdown/math.worker.ts +16 -0
- package/src/markdown/nodes.ts +15 -0
- package/src/markdown/preview-policy.test.ts +31 -0
- package/src/markdown/preview-policy.ts +76 -0
- package/src/markdown/progressive-chunks.test.ts +43 -0
- package/src/markdown/progressive-chunks.ts +58 -0
- package/src/markdown/rich-labels.ts +55 -0
- package/src/markdown/rich-syntax.ts +93 -0
- package/src/markdown/stable-blocks.test.ts +90 -0
- package/src/markdown/stable-blocks.ts +124 -0
- package/src/markdown/streaming-reveal.ts +297 -0
- package/src/markdown/streaming.test.ts +57 -0
- package/src/markdown/streaming.ts +211 -0
- package/src/markdown/use-render-snapshot.ts +24 -0
- package/src/markdown/use-rich-visibility.ts +24 -0
- package/src/overlays/CommandMenuRow.tsx +77 -17
- package/src/overlays/CommandMenuView.tsx +163 -118
- package/src/overlays/ConfirmDialogView.tsx +25 -20
- package/src/overlays/DiagnosticsExportDialogView.tsx +236 -0
- package/src/overlays/MagpieHandoverDialogView.tsx +217 -0
- package/src/overlays/ReleaseNoteMarkdown.test.tsx +24 -0
- package/src/overlays/ReleaseNoteMarkdown.tsx +55 -0
- package/src/overlays/SplashOptionRow.tsx +46 -0
- package/src/overlays/SplashPanel.tsx +85 -0
- package/src/overlays/SplashParts.tsx +217 -0
- package/src/overlays/UpdateCheckerView.tsx +34 -18
- package/src/overlays/UpdateRestartDialogView.tsx +203 -53
- package/src/overlays/assets/diagnostics-banner.webp +0 -0
- package/src/overlays/command-menu-types.ts +15 -1
- package/src/overlays/command-menu.css +1 -20
- package/src/overlays/index.ts +26 -1
- package/src/plugin-ui/index.ts +10 -0
- package/src/project/ConversationTagDotsView.tsx +1 -1
- package/src/project/ConversationTagEditorDialogView.tsx +4 -1
- package/src/project/DefaultConversationSectionView.tsx +15 -24
- package/src/project/DefaultSessionListView.tsx +5 -31
- package/src/project/DefaultSessionRowView.tsx +114 -55
- package/src/project/ManageSessionsSplashView.tsx +439 -0
- package/src/project/NewProjectDialogView.tsx +3 -10
- package/src/project/ProjectContextMenuView.tsx +30 -139
- package/src/project/ProjectDetailPageView.test.tsx +140 -0
- package/src/project/ProjectDetailPageView.tsx +372 -165
- package/src/project/ProjectGroupView.tsx +1 -1
- package/src/project/ProjectRowView.tsx +29 -12
- package/src/project/ProjectSessionsView.tsx +25 -47
- package/src/project/QuickScrollOverlay.tsx +1 -1
- package/src/project/SessionContextMenuView.tsx +15 -7
- package/src/project/SessionRowMoreButton.tsx +50 -0
- package/src/project/SessionRowView.tsx +106 -63
- package/src/project/SessionTitleMarquee.tsx +54 -0
- package/src/project/SidebarProjectDisclosure.tsx +60 -0
- package/src/project/SidebarProjectsSectionView.tsx +6 -1
- package/src/project/index.ts +12 -0
- package/src/project/session-row-transition.ts +9 -0
- package/src/project/types.ts +4 -2
- package/src/project/useActiveSessionAutoScroll.ts +10 -4
- package/src/registry.ts +0 -2
- package/src/scheduler/AutomationDetailPaneView.tsx +68 -0
- package/src/scheduler/AutomationPageView.tsx +118 -121
- package/src/scheduler/ExecutionHistoryView.tsx +7 -5
- package/src/scheduler/TaskListView.tsx +52 -201
- package/src/scheduler/index.ts +7 -12
- package/src/settings/AppshotSettingsView.tsx +0 -1
- package/src/settings/ArchivedProjectsSettingsView.tsx +122 -1
- package/src/settings/BuiltinMcpSectionView.tsx +1 -1
- package/src/settings/EnvironmentGitRowView.tsx +156 -0
- package/src/settings/EnvironmentSettingsView.tsx +25 -3
- package/src/settings/GeneralSettingsView.tsx +18 -24
- package/src/settings/ImChannelGuideDialogView.tsx +2 -2
- package/src/settings/ImFeishuDialogView.tsx +1 -1
- package/src/settings/ImLegacyImportBannerView.tsx +1 -1
- package/src/settings/ImLogDrawerView.tsx +2 -1
- package/src/settings/JsonConfigInputView.tsx +171 -0
- package/src/settings/LauncherSettingsView.test.tsx +95 -0
- package/src/settings/LauncherSettingsView.tsx +273 -0
- package/src/settings/ModelsFetchedModelsDrawerView.tsx +292 -0
- package/src/settings/ModelsProvidersSectionView.tsx +26 -23
- package/src/settings/MotionSelect.tsx +9 -7
- package/src/settings/NotificationSettingsView.tsx +79 -0
- package/src/settings/PermissionsSettingsView.tsx +3 -7
- package/src/settings/PetActionGalleryView.test.tsx +163 -0
- package/src/settings/PetActionGalleryView.tsx +216 -0
- package/src/settings/PetSettingsView.test.tsx +117 -0
- package/src/settings/PetSettingsView.tsx +86 -22
- package/src/settings/PresetProviderModelsListView.tsx +141 -24
- package/src/settings/PresetProviderRowView.tsx +147 -185
- package/src/settings/ProxySettingsSectionView.tsx +182 -0
- package/src/settings/QrBindDialogView.tsx +1 -1
- package/src/settings/RemoteMcpSectionView.tsx +1 -1
- package/src/settings/SettingChrome.tsx +2 -2
- package/src/settings/SettingsAiAssistButtonView.tsx +9 -119
- package/src/settings/SettingsFormFields.tsx +4 -7
- package/src/settings/SettingsSidebarView.tsx +64 -3
- package/src/settings/ShortcutRecorderView.test.tsx +108 -0
- package/src/settings/ShortcutRecorderView.tsx +15 -9
- package/src/settings/ShortcutsSettingsView.tsx +1 -5
- package/src/settings/SpaceEditorDialogView.tsx +158 -0
- package/src/settings/SpacesSettingsView.tsx +150 -0
- package/src/settings/WebhookEndpointListView.tsx +4 -5
- package/src/settings/assets/space-editor-illustration.webp +0 -0
- package/src/settings/index.ts +59 -68
- package/src/shared/ActivityStatusDot.tsx +69 -0
- package/src/shared/AvatarStackView.tsx +13 -13
- package/src/shared/BotAvatar.tsx +11 -9
- package/src/shared/CodeBlockCopyButton.tsx +1 -1
- package/src/shared/ContextMenuView.tsx +4 -11
- package/src/shared/MarkdownTable.tsx +2 -2
- package/src/shared/SegmentedControl.test.tsx +68 -0
- package/src/shared/SegmentedControl.tsx +10 -2
- package/src/shared/SyntaxHighlightedCode.tsx +0 -0
- package/src/shared/TabBar.outline.test.tsx +59 -0
- package/src/shared/TabBar.tsx +23 -18
- package/src/shared/VettaKbd.test.tsx +52 -0
- package/src/shared/VettaKbd.tsx +100 -0
- package/src/shared/connected-tab-outline.test.ts +2 -2
- package/src/shared/connected-tab-outline.ts +2 -1
- package/src/shared/index.ts +7 -0
- package/src/shared/kbd-keys.test.ts +61 -0
- package/src/shared/kbd-keys.ts +253 -0
- package/src/shared/platform.ts +9 -0
- package/src/shared/provider-icon/icons.ts +4 -2
- package/src/shared/provider-icon/index.tsx +1 -1
- package/src/shared/provider-icon/magpie.svg +1 -0
- package/src/sidebar/AddProjectMenuTriggerView.tsx +33 -24
- package/src/sidebar/DefaultSidebar.tsx +3 -1
- package/src/sidebar/MessageCenterDialogView.tsx +3 -2
- package/src/sidebar/MessageCenterEmptyState.tsx +1 -1
- package/src/sidebar/MessageCenterTabs.tsx +1 -1
- package/src/sidebar/MessageCenterToolbarButton.tsx +1 -1
- package/src/sidebar/MessageCenterTriggerView.tsx +2 -2
- package/src/sidebar/ProjectsPanelEmptyState.tsx +26 -7
- package/src/sidebar/SessionStatusIcon.tsx +16 -1
- package/src/sidebar/SettingsMenuThemeSection.tsx +1 -1
- package/src/sidebar/SettingsMenuTriggerView.test.tsx +42 -0
- package/src/sidebar/SettingsMenuTriggerView.tsx +29 -50
- package/src/sidebar/ShowMoreSessionsButton.tsx +1 -1
- package/src/sidebar/SidebarFilterSelectView.tsx +8 -16
- package/src/sidebar/SidebarNavBadgeView.tsx +1 -1
- package/src/sidebar/SidebarNavIcon.tsx +1 -1
- package/src/sidebar/SidebarNavItemButton.tsx +1 -1
- package/src/sidebar/SidebarNavMorePanel.tsx +19 -7
- package/src/sidebar/SidebarNavigation.tsx +24 -15
- package/src/sidebar/SidebarPanel.tsx +11 -2
- package/src/sidebar/SidebarSectionActionButton.test.tsx +91 -0
- package/src/sidebar/SidebarSectionActionButton.tsx +52 -0
- package/src/sidebar/SidebarSectionTriggerLabel.tsx +20 -0
- package/src/sidebar/SidebarTopBar.tsx +10 -7
- package/src/sidebar/WaitingPulseBadge.tsx +19 -0
- package/src/sidebar/index.ts +1 -16
- package/src/skills/index.ts +0 -19
- package/src/skills/skill-icon.tsx +4 -8
- package/src/styles.css +26 -6
- package/src/chat/DefaultSceneCarousel.tsx +0 -113
- package/src/chat/SceneCard.tsx +0 -138
- package/src/scheduler/HistoryDrawerView.tsx +0 -149
- package/src/scheduler/TaskFormDialogView.tsx +0 -60
- package/src/settings/AchievementNavigationButtonView.tsx +0 -90
- package/src/settings/AchievementPromotionDialogView.tsx +0 -91
- package/src/settings/AchievementSettingsView.tsx +0 -44
- package/src/settings/PetBubbleStylePreviewView.tsx +0 -44
- package/src/settings/QuickPanelSettingsSectionView.tsx +0 -66
- package/src/settings/SubscriptionActionsView.tsx +0 -63
- package/src/settings/SubscriptionCardsView.tsx +0 -212
- package/src/settings/TeamDetailView.tsx +0 -148
- package/src/settings/TeamDialogsView.tsx +0 -151
- package/src/settings/TeamListView.tsx +0 -57
- package/src/settings/TeamSettingsView.tsx +0 -51
- package/src/settings/TokenActivityChartView.tsx +0 -286
- package/src/settings/UsageStatsView.tsx +0 -101
- package/src/settings/achievements/AchievementCurtains.tsx +0 -50
- package/src/settings/achievements/AchievementPromotionBadge3D.tsx +0 -350
- package/src/settings/achievements/AchievementPromotionConfetti.tsx +0 -71
- package/src/settings/achievements/AchievementTitle.tsx +0 -52
- package/src/settings/achievements/index.ts +0 -13
- package/src/settings/shouldCloseEmptyApiKeyEditor.test.ts +0 -135
- package/src/settings/shouldCloseEmptyApiKeyEditor.ts +0 -40
- package/src/settings/token-activity.test.ts +0 -195
- package/src/settings/token-activity.ts +0 -320
- package/src/sidebar/AddProjectMenuItem.tsx +0 -21
- package/src/sidebar/AddProjectMenuPopoverView.tsx +0 -52
- package/src/sidebar/NotificationMessageListView.tsx +0 -136
- package/src/sidebar/SettingsMenuAccountSection.tsx +0 -32
- package/src/sidebar/SettingsMenuQuotaSection.tsx +0 -45
- package/src/skills/SceneCardView.tsx +0 -194
- package/src/skills/SkillCardView.tsx +0 -186
- package/src/skills/SkillDetailDialogView.tsx +0 -138
- package/src/skills/SkillTagGroupView.tsx +0 -56
- package/src/skills/SkillToggleSwitch.tsx +0 -31
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Button, cn } from "@vetta-org/ui";
|
|
1
|
+
import { Button, ButtonGroup, ButtonGroupItem, cn } from "@vetta-org/ui";
|
|
2
2
|
import { AnimatePresence, motion } from "motion/react";
|
|
3
|
-
import type
|
|
3
|
+
import { useState, type JSX, type ReactNode, type RefObject } from "react";
|
|
4
|
+
import { MarkdownPreviewView } from "../activity/MarkdownPreviewView";
|
|
4
5
|
|
|
5
|
-
const easeOut = [0.22, 1, 0.36, 1] as const;
|
|
6
6
|
|
|
7
7
|
export type ProjectDetailSaveStatus = "idle" | "saving" | "saved" | "error";
|
|
8
8
|
|
|
@@ -23,6 +23,38 @@ export interface ProjectDetailPageViewLabels {
|
|
|
23
23
|
agentsMdHint: string;
|
|
24
24
|
quickSave: string;
|
|
25
25
|
saveShortcut: string;
|
|
26
|
+
recentSessionsTitle: string;
|
|
27
|
+
recentSessionsEmpty: string;
|
|
28
|
+
startFirst: string;
|
|
29
|
+
running: string;
|
|
30
|
+
runningTasks: string;
|
|
31
|
+
automationsTitle: string;
|
|
32
|
+
automationsViewAll: string;
|
|
33
|
+
automationsDisabled: string;
|
|
34
|
+
automationsNeverRun: string;
|
|
35
|
+
contextTitle: string;
|
|
36
|
+
claudeHint: string;
|
|
37
|
+
previewMode: string;
|
|
38
|
+
editMode: string;
|
|
39
|
+
emptyFileTitle: string;
|
|
40
|
+
emptyFileHint: string;
|
|
41
|
+
startEditing: string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface ProjectDetailRecentSession {
|
|
45
|
+
path: string;
|
|
46
|
+
label: string;
|
|
47
|
+
date: string;
|
|
48
|
+
pinned?: boolean;
|
|
49
|
+
running: boolean;
|
|
50
|
+
}
|
|
51
|
+
export interface ProjectDetailAutomation {
|
|
52
|
+
id: string;
|
|
53
|
+
name: string;
|
|
54
|
+
/** 最近一次运行时间(已格式化);从未运行为 null。 */
|
|
55
|
+
date: string | null;
|
|
56
|
+
disabled: boolean;
|
|
57
|
+
running: boolean;
|
|
26
58
|
}
|
|
27
59
|
|
|
28
60
|
export interface ProjectDetailPageViewProps {
|
|
@@ -32,6 +64,14 @@ export interface ProjectDetailPageViewProps {
|
|
|
32
64
|
/** Host BatchQueueStatus section body (already wrapped or raw). */
|
|
33
65
|
batchSection: ReactNode | null;
|
|
34
66
|
content: string;
|
|
67
|
+
activeDocument: "AGENTS.md" | "CLAUDE.md";
|
|
68
|
+
mode?: "edit" | "preview";
|
|
69
|
+
onModeChange?: (mode: "edit" | "preview") => void;
|
|
70
|
+
theme?: "light" | "dark";
|
|
71
|
+
recentSessions: readonly ProjectDetailRecentSession[];
|
|
72
|
+
automations: readonly ProjectDetailAutomation[];
|
|
73
|
+
runningSessionCount: number;
|
|
74
|
+
runningTaskCount: number;
|
|
35
75
|
createdAtLabel: string | null;
|
|
36
76
|
cwd: string;
|
|
37
77
|
displayName: string;
|
|
@@ -48,6 +88,10 @@ export interface ProjectDetailPageViewProps {
|
|
|
48
88
|
onSave: () => void;
|
|
49
89
|
onShowInFolder: () => void;
|
|
50
90
|
onToggleActivity: () => void;
|
|
91
|
+
onDocumentChange: (file: "AGENTS.md" | "CLAUDE.md") => void;
|
|
92
|
+
onOpenRecentSession: (path: string) => void;
|
|
93
|
+
onOpenAutomation: (taskId: string) => void;
|
|
94
|
+
onOpenAllAutomations: () => void;
|
|
51
95
|
projectTypeLabel: string | null;
|
|
52
96
|
saveStatus: ProjectDetailSaveStatus;
|
|
53
97
|
sessionCountLabel: string;
|
|
@@ -57,8 +101,16 @@ export interface ProjectDetailPageViewProps {
|
|
|
57
101
|
|
|
58
102
|
export function ProjectDetailPageView({
|
|
59
103
|
activityOpen,
|
|
104
|
+
mode: controlledMode,
|
|
105
|
+
onModeChange: controlledOnModeChange,
|
|
106
|
+
theme = "dark",
|
|
60
107
|
activityPanel,
|
|
61
108
|
batchSection,
|
|
109
|
+
activeDocument,
|
|
110
|
+
recentSessions,
|
|
111
|
+
automations,
|
|
112
|
+
runningSessionCount,
|
|
113
|
+
runningTaskCount,
|
|
62
114
|
content,
|
|
63
115
|
createdAtLabel,
|
|
64
116
|
cwd,
|
|
@@ -75,6 +127,10 @@ export function ProjectDetailPageView({
|
|
|
75
127
|
onNewSession,
|
|
76
128
|
onSave,
|
|
77
129
|
onShowInFolder,
|
|
130
|
+
onDocumentChange,
|
|
131
|
+
onOpenRecentSession,
|
|
132
|
+
onOpenAutomation,
|
|
133
|
+
onOpenAllAutomations,
|
|
78
134
|
onToggleActivity,
|
|
79
135
|
projectTypeLabel,
|
|
80
136
|
saveStatus,
|
|
@@ -82,10 +138,18 @@ export function ProjectDetailPageView({
|
|
|
82
138
|
taskCountLabel,
|
|
83
139
|
textareaRef,
|
|
84
140
|
}: ProjectDetailPageViewProps): JSX.Element {
|
|
141
|
+
const [internalMode, setInternalMode] = useState<"edit" | "preview">("preview");
|
|
142
|
+
const [listTab, setListTab] = useState<"sessions" | "automations">("sessions");
|
|
143
|
+
const hasSessions = recentSessions.length > 0;
|
|
144
|
+
const hasAutomations = automations.length > 0;
|
|
145
|
+
// 两栏都有才出 tab;只有其一时直接显示它,tab 记忆值失效也不会落到空栏。
|
|
146
|
+
const showAutomations = hasAutomations && (!hasSessions || listTab === "automations");
|
|
147
|
+
const currentMode = controlledMode ?? internalMode;
|
|
148
|
+
const setMode = controlledOnModeChange ?? setInternalMode;
|
|
85
149
|
const metrics = [
|
|
86
|
-
{ icon: "icon-[
|
|
87
|
-
createdAtLabel ? { icon: "icon-[
|
|
88
|
-
taskCountLabel ? { icon: "icon-[
|
|
150
|
+
{ icon: "icon-[solar--chat-round-line-linear]", value: sessionCountLabel },
|
|
151
|
+
createdAtLabel ? { icon: "icon-[solar--calendar-linear]", value: createdAtLabel } : null,
|
|
152
|
+
taskCountLabel ? { icon: "icon-[solar--layers-linear]", value: taskCountLabel } : null,
|
|
89
153
|
].filter((item): item is { icon: string; value: string } => item != null);
|
|
90
154
|
|
|
91
155
|
return (
|
|
@@ -93,13 +157,7 @@ export function ProjectDetailPageView({
|
|
|
93
157
|
<div className="flex min-h-0 flex-1">
|
|
94
158
|
{/* @container:按主栏宽度(非视口)响应,Activity 挤窄时也能正确折叠 */}
|
|
95
159
|
<div className="@container flex min-w-0 flex-1 flex-col">
|
|
96
|
-
|
|
97
|
-
<motion.header
|
|
98
|
-
className="shrink-0 px-4 pb-4 pt-1 @md:px-8 @md:pb-5"
|
|
99
|
-
initial={{ opacity: 0, y: -10 }}
|
|
100
|
-
animate={{ opacity: 1, y: 0 }}
|
|
101
|
-
transition={{ duration: 0.45, ease: easeOut }}
|
|
102
|
-
>
|
|
160
|
+
<header className="shrink-0 px-4 pb-8 pt-1 @md:px-8">
|
|
103
161
|
<div className="flex min-w-0 flex-col gap-3">
|
|
104
162
|
{/* 标题行:窄宽时允许操作条整行换行,避免挤爆标题 */}
|
|
105
163
|
<div className="flex min-w-0 flex-wrap items-start justify-between gap-x-2 gap-y-2">
|
|
@@ -139,53 +197,36 @@ export function ProjectDetailPageView({
|
|
|
139
197
|
</button>
|
|
140
198
|
</div>
|
|
141
199
|
|
|
142
|
-
<
|
|
143
|
-
<
|
|
144
|
-
type="button"
|
|
145
|
-
variant="ghost"
|
|
146
|
-
size="icon-sm"
|
|
200
|
+
<ButtonGroup className="shrink-0">
|
|
201
|
+
<ButtonGroupItem
|
|
147
202
|
onClick={onShowInFolder}
|
|
148
203
|
title={labels.showInFolderTitle}
|
|
149
204
|
aria-label={labels.showInFolder}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
</Button>
|
|
205
|
+
icon={<span className="icon-[solar--folder-open-linear] h-4 w-4" />}
|
|
206
|
+
/>
|
|
153
207
|
{exportable && (
|
|
154
|
-
<
|
|
155
|
-
type="button"
|
|
156
|
-
variant="outline"
|
|
157
|
-
size="icon-sm"
|
|
208
|
+
<ButtonGroupItem
|
|
158
209
|
onClick={onExport}
|
|
159
210
|
title={labels.exportTitle}
|
|
160
211
|
aria-label={labels.export}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
</Button>
|
|
212
|
+
icon={<span className="icon-[solar--export-linear] h-4 w-4" />}
|
|
213
|
+
/>
|
|
164
214
|
)}
|
|
165
|
-
<
|
|
166
|
-
type="button"
|
|
167
|
-
variant="primary"
|
|
168
|
-
size="sm"
|
|
215
|
+
<ButtonGroupItem
|
|
169
216
|
onClick={onNewSession}
|
|
170
217
|
title={labels.newSession}
|
|
171
218
|
aria-label={labels.newSession}
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
</Button>
|
|
178
|
-
<Button
|
|
179
|
-
type="button"
|
|
180
|
-
variant={activityOpen ? "secondary" : "ghost"}
|
|
181
|
-
size="icon-sm"
|
|
182
|
-
title={activityOpen ? labels.closeActivityPanel : labels.openActivityPanel}
|
|
219
|
+
icon={<span className="icon-[solar--add-circle-linear] h-4 w-4" />}
|
|
220
|
+
label={labels.newSession}
|
|
221
|
+
/>
|
|
222
|
+
<ButtonGroupItem
|
|
223
|
+
active={activityOpen}
|
|
183
224
|
onClick={onToggleActivity}
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
<span className="icon-[solar--sidebar-minimalistic-linear] -scale-x-100
|
|
187
|
-
|
|
188
|
-
</
|
|
225
|
+
title={activityOpen ? labels.closeActivityPanel : labels.openActivityPanel}
|
|
226
|
+
aria-label={activityOpen ? labels.closeActivityPanel : labels.openActivityPanel}
|
|
227
|
+
icon={<span className="icon-[solar--sidebar-minimalistic-linear] -scale-x-100 h-4 w-4" />}
|
|
228
|
+
/>
|
|
229
|
+
</ButtonGroup>
|
|
189
230
|
</div>
|
|
190
231
|
|
|
191
232
|
{metrics.length > 0 && (
|
|
@@ -207,141 +248,307 @@ export function ProjectDetailPageView({
|
|
|
207
248
|
</div>
|
|
208
249
|
)}
|
|
209
250
|
</div>
|
|
210
|
-
</
|
|
251
|
+
</header>
|
|
211
252
|
|
|
212
|
-
{/* ── Body ────────────────────────────────────────────── */}
|
|
213
253
|
<div className="flex min-h-0 flex-1 flex-col overflow-y-auto">
|
|
214
254
|
{batchSection}
|
|
215
255
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
256
|
+
{/* ── Recent Sessions / Automations(有自动化时用 tab 切换)──────── */}
|
|
257
|
+
{(hasSessions || hasAutomations) && (
|
|
258
|
+
<div className="w-full px-4 pb-8 @md:px-8">
|
|
259
|
+
<section aria-label={showAutomations ? labels.automationsTitle : labels.recentSessionsTitle}>
|
|
260
|
+
<div className="mb-2 flex items-center justify-between">
|
|
261
|
+
{hasSessions && hasAutomations ? (
|
|
262
|
+
<div role="tablist" aria-label={labels.recentSessionsTitle} className="flex gap-1.5">
|
|
263
|
+
{(["sessions", "automations"] as const).map((key) => (
|
|
264
|
+
<button
|
|
265
|
+
key={key}
|
|
266
|
+
type="button"
|
|
267
|
+
role="tab"
|
|
268
|
+
aria-selected={(key === "automations") === showAutomations}
|
|
269
|
+
onClick={() => setListTab(key)}
|
|
270
|
+
className={cn(
|
|
271
|
+
"rounded-full px-3 py-1 text-[12px] transition-colors focus-visible:outline-1 focus-visible:outline-ring",
|
|
272
|
+
(key === "automations") === showAutomations
|
|
273
|
+
? "bg-accent font-semibold text-foreground"
|
|
274
|
+
: "text-muted-foreground/60 hover:text-foreground"
|
|
275
|
+
)}
|
|
276
|
+
>
|
|
277
|
+
{key === "sessions" ? labels.recentSessionsTitle : labels.automationsTitle}
|
|
278
|
+
</button>
|
|
279
|
+
))}
|
|
280
|
+
</div>
|
|
281
|
+
) : (
|
|
282
|
+
<h2 className="text-[13px] font-medium tracking-wide text-muted-foreground/80">
|
|
283
|
+
{showAutomations ? labels.automationsTitle : labels.recentSessionsTitle}
|
|
284
|
+
</h2>
|
|
285
|
+
)}
|
|
286
|
+
{showAutomations ? (
|
|
287
|
+
<div className="flex items-center gap-3">
|
|
288
|
+
{runningTaskCount > 0 && (
|
|
289
|
+
<span className="flex items-center gap-1.5 text-[11px] text-muted-foreground/60">
|
|
290
|
+
<span className="h-1.5 w-1.5 rounded-full bg-emerald-500/80 animate-pulse" />
|
|
291
|
+
{labels.runningTasks}
|
|
292
|
+
</span>
|
|
293
|
+
)}
|
|
294
|
+
<button
|
|
295
|
+
type="button"
|
|
296
|
+
onClick={onOpenAllAutomations}
|
|
297
|
+
className="text-[11px] text-muted-foreground/60 transition-colors hover:text-foreground focus-visible:outline-1 focus-visible:outline-ring"
|
|
249
298
|
>
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
299
|
+
{labels.automationsViewAll}
|
|
300
|
+
</button>
|
|
301
|
+
</div>
|
|
302
|
+
) : (
|
|
303
|
+
runningSessionCount > 0 && (
|
|
304
|
+
<span className="flex items-center gap-1.5 text-[11px] text-muted-foreground/60">
|
|
305
|
+
<span className="h-1.5 w-1.5 rounded-full bg-emerald-500/80 animate-pulse" />
|
|
306
|
+
{labels.running}
|
|
307
|
+
</span>
|
|
308
|
+
)
|
|
309
|
+
)}
|
|
310
|
+
</div>
|
|
311
|
+
|
|
312
|
+
{showAutomations ? (
|
|
313
|
+
<>
|
|
314
|
+
<div className="flex flex-col divide-y divide-border/40 overflow-hidden rounded-xl bg-accent/30">
|
|
315
|
+
{automations.map((task) => (
|
|
316
|
+
<button
|
|
317
|
+
key={task.id}
|
|
318
|
+
type="button"
|
|
319
|
+
onClick={() => onOpenAutomation(task.id)}
|
|
320
|
+
className="group relative flex w-full items-center justify-between gap-4 px-3.5 py-2.5 text-left transition-colors hover:bg-accent/50 hover:text-foreground focus-visible:outline-1 focus-visible:outline-ring"
|
|
321
|
+
>
|
|
322
|
+
<div className="flex min-w-0 flex-1 items-center gap-2.5">
|
|
323
|
+
{task.running ? (
|
|
324
|
+
<span className="relative flex h-2 w-2 shrink-0">
|
|
325
|
+
<span className="absolute inline-flex h-full w-full animate-ping rounded-full bg-emerald-400 opacity-75" />
|
|
326
|
+
<span className="relative inline-flex h-2 w-2 rounded-full bg-emerald-500" />
|
|
327
|
+
</span>
|
|
328
|
+
) : (
|
|
329
|
+
<span className="icon-[solar--clock-circle-linear] h-3.5 w-3.5 shrink-0 text-muted-foreground/50 transition-colors group-hover:text-foreground/70" aria-hidden />
|
|
330
|
+
)}
|
|
331
|
+
<span className={cn("min-w-0 truncate text-[13px] transition-colors group-hover:text-foreground", task.disabled ? "text-foreground/50" : "text-foreground/90")}>
|
|
332
|
+
{task.name}
|
|
253
333
|
</span>
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
334
|
+
{task.disabled && (
|
|
335
|
+
<span className="shrink-0 rounded bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground/70">
|
|
336
|
+
{labels.automationsDisabled}
|
|
337
|
+
</span>
|
|
338
|
+
)}
|
|
339
|
+
</div>
|
|
340
|
+
<div className="flex shrink-0 items-center gap-2">
|
|
341
|
+
<time className="font-mono text-[11px] text-muted-foreground/50 transition-colors group-hover:text-muted-foreground/75">
|
|
342
|
+
{task.date ?? labels.automationsNeverRun}
|
|
343
|
+
</time>
|
|
344
|
+
<span className="icon-[solar--alt-arrow-right-linear] h-3.5 w-3.5 text-muted-foreground/30 opacity-0 transition-all -translate-x-1 group-hover:opacity-100 group-hover:translate-x-0" aria-hidden />
|
|
345
|
+
</div>
|
|
346
|
+
</button>
|
|
347
|
+
))}
|
|
348
|
+
</div>
|
|
349
|
+
</>
|
|
350
|
+
) : (
|
|
351
|
+
<>
|
|
352
|
+
<div className="flex flex-col divide-y divide-border/40 overflow-hidden rounded-xl bg-accent/30">
|
|
353
|
+
{recentSessions.map((session) => (
|
|
354
|
+
<button
|
|
355
|
+
key={session.path}
|
|
356
|
+
type="button"
|
|
357
|
+
onClick={() => onOpenRecentSession(session.path)}
|
|
358
|
+
className="group relative flex w-full items-center justify-between gap-4 px-3.5 py-2.5 text-left transition-colors hover:bg-accent/50 hover:text-foreground focus-visible:outline-1 focus-visible:outline-ring"
|
|
359
|
+
>
|
|
360
|
+
<div className="flex min-w-0 flex-1 items-center gap-2.5">
|
|
361
|
+
{session.running ? (
|
|
362
|
+
<span className="relative flex h-2 w-2 shrink-0">
|
|
363
|
+
<span className="absolute inline-flex h-full w-full animate-ping rounded-full bg-emerald-400 opacity-75" />
|
|
364
|
+
<span className="relative inline-flex h-2 w-2 rounded-full bg-emerald-500" />
|
|
365
|
+
</span>
|
|
366
|
+
) : session.pinned ? (
|
|
367
|
+
<span className="icon-[solar--pin-linear] h-3.5 w-3.5 shrink-0 text-primary/70" />
|
|
368
|
+
) : (
|
|
369
|
+
<span className="icon-[solar--chat-round-line-linear] h-3.5 w-3.5 shrink-0 text-muted-foreground/50 transition-colors group-hover:text-foreground/70" aria-hidden />
|
|
370
|
+
)}
|
|
371
|
+
<span className="min-w-0 truncate text-[13px] text-foreground/90 transition-colors group-hover:text-foreground">
|
|
372
|
+
{session.label}
|
|
373
|
+
</span>
|
|
374
|
+
</div>
|
|
375
|
+
<div className="flex shrink-0 items-center gap-2">
|
|
376
|
+
<time className="font-mono text-[11px] text-muted-foreground/50 transition-colors group-hover:text-muted-foreground/75">
|
|
377
|
+
{session.date}
|
|
378
|
+
</time>
|
|
379
|
+
<span className="icon-[solar--alt-arrow-right-linear] h-3.5 w-3.5 text-muted-foreground/30 opacity-0 transition-all -translate-x-1 group-hover:opacity-100 group-hover:translate-x-0" aria-hidden />
|
|
380
|
+
</div>
|
|
381
|
+
</button>
|
|
382
|
+
))}
|
|
383
|
+
</div>
|
|
384
|
+
</>
|
|
385
|
+
)}
|
|
386
|
+
</section>
|
|
387
|
+
</div>
|
|
388
|
+
)}
|
|
389
|
+
|
|
390
|
+
{/* ── Project Instructions ─────────────────────────────── */}
|
|
391
|
+
<section className="flex w-full flex-col px-4 pb-12 @md:px-8">
|
|
392
|
+
{/* Header controls: Document switch & Mode switch */}
|
|
393
|
+
<div className="flex flex-wrap items-end justify-between gap-x-4 gap-y-3 pb-4">
|
|
394
|
+
<div className="flex flex-col gap-2">
|
|
395
|
+
<h2 className="text-[13px] font-medium tracking-wide text-muted-foreground/80">
|
|
396
|
+
{labels.contextTitle}
|
|
397
|
+
</h2>
|
|
398
|
+
<div role="tablist" aria-label={labels.contextTitle} className="flex gap-1.5">
|
|
399
|
+
{(["AGENTS.md", "CLAUDE.md"] as const).map((file) => (
|
|
400
|
+
<button
|
|
401
|
+
key={file}
|
|
402
|
+
type="button"
|
|
403
|
+
role="tab"
|
|
404
|
+
id={`project-context-${file}`}
|
|
405
|
+
aria-controls="project-context-panel"
|
|
406
|
+
aria-selected={activeDocument === file}
|
|
407
|
+
onClick={() => onDocumentChange(file)}
|
|
408
|
+
className={cn(
|
|
409
|
+
"rounded-full px-3 py-1 font-mono text-[12px] transition-colors focus-visible:outline-1 focus-visible:outline-ring",
|
|
410
|
+
activeDocument === file
|
|
411
|
+
? "bg-accent font-semibold text-foreground"
|
|
412
|
+
: "text-muted-foreground/60 hover:text-foreground"
|
|
413
|
+
)}
|
|
414
|
+
>
|
|
415
|
+
{file}
|
|
416
|
+
</button>
|
|
417
|
+
))}
|
|
258
418
|
</div>
|
|
419
|
+
</div>
|
|
259
420
|
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
key="saved"
|
|
265
|
-
initial={{ opacity: 0, x: 6 }}
|
|
266
|
-
animate={{ opacity: 1, x: 0 }}
|
|
267
|
-
exit={{ opacity: 0, x: 6 }}
|
|
268
|
-
className="hidden items-center gap-1 text-[11px] font-medium text-emerald-500 @min-[22rem]:flex"
|
|
269
|
-
>
|
|
270
|
-
<span className="icon-[mdi--check-circle] h-3.5 w-3.5" />
|
|
271
|
-
{labels.saved}
|
|
272
|
-
</motion.span>
|
|
273
|
-
)}
|
|
274
|
-
{saveStatus === "error" && (
|
|
275
|
-
<motion.span
|
|
276
|
-
key="error"
|
|
277
|
-
initial={{ opacity: 0, x: 6 }}
|
|
278
|
-
animate={{ opacity: 1, x: 0 }}
|
|
279
|
-
exit={{ opacity: 0, x: 6 }}
|
|
280
|
-
className="flex items-center gap-1 text-[11px] font-medium text-destructive"
|
|
281
|
-
title={labels.saveFailed}
|
|
282
|
-
>
|
|
283
|
-
<span className="icon-[mdi--alert-circle-outline] h-3.5 w-3.5" />
|
|
284
|
-
<span className="hidden @min-[22rem]:inline">{labels.saveFailed}</span>
|
|
285
|
-
</motion.span>
|
|
286
|
-
)}
|
|
287
|
-
</AnimatePresence>
|
|
288
|
-
<Button
|
|
421
|
+
{/* Right toolbar: Preview/Edit toggle + Save button */}
|
|
422
|
+
<div className="flex items-center gap-2">
|
|
423
|
+
<div className="flex items-center gap-1 rounded-md bg-accent/30 p-0.5 text-[11px]">
|
|
424
|
+
<button
|
|
289
425
|
type="button"
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
426
|
+
onClick={() => setMode("preview")}
|
|
427
|
+
className={cn(
|
|
428
|
+
"rounded px-2 py-0.5 font-medium transition-colors",
|
|
429
|
+
currentMode === "preview"
|
|
430
|
+
? "bg-background text-foreground shadow-xs"
|
|
431
|
+
: "text-muted-foreground/60 hover:text-foreground"
|
|
432
|
+
)}
|
|
296
433
|
>
|
|
297
|
-
{
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
434
|
+
{labels.previewMode}
|
|
435
|
+
</button>
|
|
436
|
+
<button
|
|
437
|
+
type="button"
|
|
438
|
+
onClick={() => setMode("edit")}
|
|
439
|
+
className={cn(
|
|
440
|
+
"rounded px-2 py-0.5 font-medium transition-colors",
|
|
441
|
+
currentMode === "edit"
|
|
442
|
+
? "bg-background text-foreground shadow-xs"
|
|
443
|
+
: "text-muted-foreground/60 hover:text-foreground"
|
|
301
444
|
)}
|
|
302
|
-
|
|
303
|
-
|
|
445
|
+
>
|
|
446
|
+
{labels.editMode}
|
|
447
|
+
</button>
|
|
304
448
|
</div>
|
|
449
|
+
|
|
450
|
+
{currentMode === "edit" && (
|
|
451
|
+
<div className="flex items-center gap-1.5 ml-1">
|
|
452
|
+
<AnimatePresence mode="popLayout">
|
|
453
|
+
{saveStatus === "saved" && (
|
|
454
|
+
<motion.span
|
|
455
|
+
key="saved"
|
|
456
|
+
initial={{ opacity: 0, x: 4 }}
|
|
457
|
+
animate={{ opacity: 1, x: 0 }}
|
|
458
|
+
exit={{ opacity: 0, x: 4 }}
|
|
459
|
+
className="flex items-center gap-1 text-[11px] font-medium text-emerald-500"
|
|
460
|
+
>
|
|
461
|
+
<span className="icon-[mdi--check-circle] h-3.5 w-3.5" />
|
|
462
|
+
<span className="hidden @min-[22rem]:inline">{labels.saved}</span>
|
|
463
|
+
</motion.span>
|
|
464
|
+
)}
|
|
465
|
+
{saveStatus === "error" && (
|
|
466
|
+
<motion.span
|
|
467
|
+
key="error"
|
|
468
|
+
initial={{ opacity: 0, x: 4 }}
|
|
469
|
+
animate={{ opacity: 1, x: 0 }}
|
|
470
|
+
exit={{ opacity: 0, x: 4 }}
|
|
471
|
+
className="flex items-center gap-1 text-[11px] font-medium text-destructive"
|
|
472
|
+
title={labels.saveFailed}
|
|
473
|
+
>
|
|
474
|
+
<span className="icon-[mdi--alert-circle-outline] h-3.5 w-3.5" />
|
|
475
|
+
<span className="hidden @min-[22rem]:inline">{labels.saveFailed}</span>
|
|
476
|
+
</motion.span>
|
|
477
|
+
)}
|
|
478
|
+
</AnimatePresence>
|
|
479
|
+
<Button
|
|
480
|
+
type="button"
|
|
481
|
+
variant={isDirty ? "primary" : "ghost"}
|
|
482
|
+
size="sm"
|
|
483
|
+
onClick={onSave}
|
|
484
|
+
disabled={loading || !isDirty || saveStatus === "saving"}
|
|
485
|
+
aria-label={labels.save}
|
|
486
|
+
className="h-7 px-2.5 text-[11px]"
|
|
487
|
+
>
|
|
488
|
+
{saveStatus === "saving" ? (
|
|
489
|
+
<span className="icon-[mdi--loading] h-3.5 w-3.5 animate-spin" />
|
|
490
|
+
) : (
|
|
491
|
+
<span className="icon-[mdi--content-save-outline] h-3.5 w-3.5" />
|
|
492
|
+
)}
|
|
493
|
+
<span>{labels.save}</span>
|
|
494
|
+
</Button>
|
|
495
|
+
</div>
|
|
496
|
+
)}
|
|
305
497
|
</div>
|
|
498
|
+
</div>
|
|
306
499
|
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
"
|
|
318
|
-
|
|
500
|
+
{/* Document Content View */}
|
|
501
|
+
<div role="tabpanel" id="project-context-panel" aria-labelledby={`project-context-${activeDocument}`}>
|
|
502
|
+
<div className="flex min-h-0 min-w-0 flex-1 flex-col">
|
|
503
|
+
{loading ? (
|
|
504
|
+
<div className="flex flex-1 items-center justify-center py-20">
|
|
505
|
+
<span className="icon-[mdi--loading] h-5 w-5 animate-spin text-primary/50" />
|
|
506
|
+
</div>
|
|
507
|
+
) : currentMode === "preview" ? (
|
|
508
|
+
<div className="min-h-[22rem] py-1">
|
|
509
|
+
{content.trim() ? (
|
|
510
|
+
<div className="prose prose-sm dark:prose-invert max-w-none text-foreground/90 font-sans leading-relaxed">
|
|
511
|
+
<MarkdownPreviewView
|
|
512
|
+
content={content}
|
|
513
|
+
theme={theme}
|
|
514
|
+
className="!px-0 !pt-1 !pb-4"
|
|
515
|
+
onOpenExternal={(href) => window.vetta?.shell?.openExternal?.(href)}
|
|
516
|
+
/>
|
|
517
|
+
</div>
|
|
518
|
+
) : (
|
|
519
|
+
<div className="flex flex-col items-center gap-2 rounded-xl border border-dashed border-border/70 bg-accent/20 px-6 py-12 text-center">
|
|
520
|
+
<span className="icon-[solar--document-add-linear] h-8 w-8 text-muted-foreground/60" aria-hidden />
|
|
521
|
+
<p className="mt-1 text-[14px] font-medium text-foreground/90">{labels.emptyFileTitle}</p>
|
|
522
|
+
<p className="text-[12px] text-muted-foreground">{labels.emptyFileHint}</p>
|
|
523
|
+
<Button size="sm" onClick={() => setMode("edit")} className="mt-3">
|
|
524
|
+
{labels.startEditing}
|
|
525
|
+
</Button>
|
|
526
|
+
</div>
|
|
319
527
|
)}
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
528
|
+
</div>
|
|
529
|
+
) : (
|
|
530
|
+
<div className="relative flex min-h-0 min-w-0 flex-1 flex-col">
|
|
531
|
+
<textarea
|
|
532
|
+
aria-label={activeDocument}
|
|
533
|
+
ref={textareaRef}
|
|
534
|
+
value={content}
|
|
535
|
+
onChange={(e) => onContentChange(e.target.value)}
|
|
536
|
+
onFocus={onEditorFocus}
|
|
537
|
+
onBlur={onEditorBlur}
|
|
538
|
+
placeholder={labels.editorPlaceholder}
|
|
539
|
+
spellCheck={false}
|
|
540
|
+
className="min-h-[24rem] h-[32rem] min-w-0 flex-1 resize-y bg-accent/15 rounded-lg p-4 font-mono text-[12.5px] leading-relaxed text-foreground placeholder:text-muted-foreground/40 focus-visible:outline-1 focus-visible:outline-ring"
|
|
541
|
+
/>
|
|
542
|
+
</div>
|
|
543
|
+
)}
|
|
333
544
|
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
<kbd className="shrink-0 rounded-md border border-border/40 bg-background/70 px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground/70">
|
|
339
|
-
{labels.saveShortcut}
|
|
340
|
-
</kbd>
|
|
341
|
-
<span className="hidden shrink-0 @min-[22rem]:inline">{labels.quickSave}</span>
|
|
545
|
+
<p className="py-2.5 text-[11px] text-muted-foreground/60">
|
|
546
|
+
{activeDocument === "AGENTS.md" ? labels.agentsMdHint : labels.claudeHint}{" "}
|
|
547
|
+
<span className="whitespace-nowrap font-mono">{labels.saveShortcut}</span>
|
|
548
|
+
</p>
|
|
342
549
|
</div>
|
|
343
550
|
</div>
|
|
344
|
-
</
|
|
551
|
+
</section>
|
|
345
552
|
</div>
|
|
346
553
|
</div>
|
|
347
554
|
{activityPanel}
|
|
@@ -30,7 +30,7 @@ export function ProjectGroupView<T extends { key: string }>({
|
|
|
30
30
|
|
|
31
31
|
return (
|
|
32
32
|
<div className="project-group-contain mb-1">
|
|
33
|
-
<ProjectRowView {...projectRow} onInteract={handleProjectInteract} rowRef={projectRowRef} />
|
|
33
|
+
<ProjectRowView {...projectRow} loading={sessions.loading} onInteract={handleProjectInteract} rowRef={projectRowRef} />
|
|
34
34
|
<ProjectSessionsView {...sessions} empty={emptySessions} />
|
|
35
35
|
</div>
|
|
36
36
|
);
|