@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.
Files changed (301) hide show
  1. package/package.json +733 -5
  2. package/src/action-approval/AppearanceActionPickerView.tsx +2 -78
  3. package/src/action-approval/AppearanceApprovalDrawerView.tsx +2 -9
  4. package/src/action-approval/BatchTasksApprovalFrameView.tsx +4 -1
  5. package/src/action-approval/GenericActionApprovalView.tsx +2 -9
  6. package/src/action-approval/ManageActionApprovalFrameView.tsx +4 -1
  7. package/src/action-approval/NavigationOpenApprovalView.tsx +2 -9
  8. package/src/action-approval/SchedulerActionApprovalDialogView.tsx +3 -1
  9. package/src/action-approval/SchedulerEditApprovalDrawerView.tsx +3 -10
  10. package/src/action-approval/index.ts +0 -1
  11. package/src/activity/ActivityPanel.tsx +13 -10
  12. package/src/activity/ActivityPanelFrame.test.tsx +32 -0
  13. package/src/activity/ActivityPanelFrame.tsx +3 -2
  14. package/src/activity/BackgroundTasksTabPanelView.tsx +1 -1
  15. package/src/activity/BrowserPanelView.tsx +48 -49
  16. package/src/activity/DebugTabPanelView.tsx +1 -1
  17. package/src/activity/MarkdownPreviewView.tsx +56 -59
  18. package/src/activity/PluginTabPickerView.tsx +5 -3
  19. package/src/activity/PortsTabPanelView.tsx +911 -0
  20. package/src/activity/ToolCallsSubTabView.tsx +1 -1
  21. package/src/activity/WorkflowTabPanelView.tsx +1 -1
  22. package/src/activity/index.ts +9 -0
  23. package/src/app/AppBackground.tsx +1 -1
  24. package/src/app/AppBootLoadingView.tsx +4 -2
  25. package/src/app-shell/DefaultWindowControls.tsx +1 -1
  26. package/src/app-shell/PageHeaderActionGroup.tsx +1 -1
  27. package/src/app-shell/PageHeaderContent.tsx +36 -7
  28. package/src/app-shell/PageHeaderFrame.tsx +15 -3
  29. package/src/app-shell/PageHeaderSidebarTrigger.tsx +1 -1
  30. package/src/app-shell/PageHeaderTitle.tsx +1 -1
  31. package/src/app-shell/WindowControlButton.tsx +1 -1
  32. package/src/app-shell/header-crowding.test.ts +62 -0
  33. package/src/app-shell/header-crowding.tsx +137 -0
  34. package/src/appearance/BackgroundImageFrame.tsx +1 -1
  35. package/src/appearance/CenterSliceImageFrame.tsx +1 -1
  36. package/src/appearance/CornerImageFrame.tsx +1 -1
  37. package/src/appearance/HorizontalSliceImageFrame.tsx +1 -1
  38. package/src/appearance/NineSliceImageFrame.tsx +1 -1
  39. package/src/appearance/ThemeSurface.tsx +1 -1
  40. package/src/batch-tasks/BatchProjectFoldersFieldView.tsx +2 -1
  41. package/src/batch-tasks/BatchTaskProjectActionsView.test.tsx +97 -0
  42. package/src/batch-tasks/BatchTaskProjectActionsView.tsx +45 -35
  43. package/src/batch-tasks/batchTaskUi.tsx +0 -29
  44. package/src/bottom-panel/BottomPanelView.test.tsx +43 -0
  45. package/src/bottom-panel/BottomPanelView.tsx +222 -0
  46. package/src/bottom-panel/index.ts +26 -0
  47. package/src/chat/AgentAvatarView.tsx +1 -1
  48. package/src/chat/AnnotationViews.tsx +107 -0
  49. package/src/chat/AskUserQuestionView.tsx +18 -11
  50. package/src/chat/AssistantMessageView.tsx +48 -13
  51. package/src/chat/AtPanelView.test.tsx +61 -0
  52. package/src/chat/AtPanelView.tsx +63 -38
  53. package/src/chat/BashTerminalCard.tsx +1 -2
  54. package/src/chat/ChatHeaderActionsView.tsx +74 -18
  55. package/src/chat/CompactionStepView.test.tsx +34 -0
  56. package/src/chat/CompactionStepView.tsx +85 -0
  57. package/src/chat/ExecutionModeSelectorView.tsx +20 -5
  58. package/src/chat/HeaderActionBarView.tsx +731 -0
  59. package/src/chat/HeaderActionOverflowMenu.tsx +137 -0
  60. package/src/chat/InlineModelPicker.test.tsx +81 -0
  61. package/src/chat/InlineModelPicker.tsx +201 -0
  62. package/src/chat/InlineTokenChip.tsx +2 -68
  63. package/src/chat/InputBarBackground.tsx +1 -1
  64. package/src/chat/InputBarPlaceholder.tsx +26 -3
  65. package/src/chat/LiveThinkingView.tsx +51 -37
  66. package/src/chat/MessageBoundaryViews.tsx +21 -0
  67. package/src/chat/MessageFeedContext.tsx +13 -5
  68. package/src/chat/MessageFeedLayoutView.tsx +28 -3
  69. package/src/chat/MessageFeedView.test.tsx +81 -0
  70. package/src/chat/MessageFeedView.tsx +72 -152
  71. package/src/chat/MessageInputView.tsx +1 -1
  72. package/src/chat/MessageLayoutView.tsx +1 -1
  73. package/src/chat/MessageSelectionContextMenuView.tsx +4 -1
  74. package/src/chat/MessageTimelineView.tsx +1 -1
  75. package/src/chat/MessageView.tsx +1 -1
  76. package/src/chat/MessageVisualView.tsx +1 -1
  77. package/src/chat/ModelConfiguration.tsx +283 -0
  78. package/src/chat/ModelSelectorTrigger.tsx +63 -0
  79. package/src/chat/ModelSelectorView.tsx +1037 -223
  80. package/src/chat/NewSession.ts +1 -37
  81. package/src/chat/NewSessionPicker.tsx +3 -2
  82. package/src/chat/ProjectSelectorView.tsx +3 -2
  83. package/src/chat/ReasoningStepSlider.tsx +61 -0
  84. package/src/chat/RemoteSessionBadgeView.tsx +24 -0
  85. package/src/chat/SkillPromptAreaView.tsx +5 -19
  86. package/src/chat/TeamMemberReplyCardView.test.tsx +33 -0
  87. package/src/chat/TeamMemberReplyCardView.tsx +133 -0
  88. package/src/chat/TextBlockView.tsx +7 -770
  89. package/src/chat/TodoProgress.tsx +25 -53
  90. package/src/chat/TodoStatusBarView.tsx +14 -5
  91. package/src/chat/UserMessageView.tsx +113 -33
  92. package/src/chat/header-action-narrow.test.ts +21 -0
  93. package/src/chat/header-action-narrow.ts +38 -0
  94. package/src/chat/index.ts +32 -27
  95. package/src/chat/markdown-link.ts +7 -279
  96. package/src/chat/send-button.css +4 -22
  97. package/src/chat/streaming-reveal.test.ts +218 -0
  98. package/src/chat/streaming-reveal.ts +13 -0
  99. package/src/file-explorer/ConfirmDeleteDialogView.tsx +2 -1
  100. package/src/file-explorer/FileContextMenuView.tsx +44 -11
  101. package/src/file-explorer/FileExplorerSettingsView.tsx +97 -0
  102. package/src/file-explorer/FileTreeCreateRow.tsx +1 -1
  103. package/src/file-explorer/FileTreeNodeView.tsx +59 -18
  104. package/src/file-explorer/FileTreeView.tsx +236 -129
  105. package/src/file-explorer/file-tree-dom.ts +23 -0
  106. package/src/file-explorer/file-tree-rows.test.ts +74 -0
  107. package/src/file-explorer/file-tree-rows.ts +168 -0
  108. package/src/file-explorer/index.ts +17 -0
  109. package/src/file-explorer/types.ts +3 -0
  110. package/src/file-explorer/useFileTreeMarqueeSelection.ts +24 -16
  111. package/src/file-preview/FilePreviewDialogView.tsx +2 -2
  112. package/src/file-preview/FilePreviewView.tsx +12 -2
  113. package/src/file-preview/TextFileEditorView.tsx +2 -1
  114. package/src/index.ts +1 -0
  115. package/src/knowledge/KnowledgeHowItWorksDialogView.tsx +1 -1
  116. package/src/layout/AppFrame.tsx +3 -2
  117. package/src/layout/MainContentFrame.tsx +7 -2
  118. package/src/layout/ResizeHandle.tsx +68 -17
  119. package/src/layout/SidebarDock.tsx +75 -19
  120. package/src/layout/SidebarOverlay.tsx +1 -1
  121. package/src/layout/index.ts +1 -1
  122. package/src/layout/resize-handle-axis.test.ts +51 -0
  123. package/src/live-indicators.test.ts +43 -0
  124. package/src/markdown/CodeBlock.tsx +123 -0
  125. package/src/markdown/InlineTokenChip.tsx +68 -0
  126. package/src/markdown/MarkdownContent.tsx +411 -0
  127. package/src/markdown/MarkdownImage.tsx +51 -0
  128. package/src/markdown/MathFormula.tsx +46 -0
  129. package/src/markdown/MermaidBlock.tsx +43 -0
  130. package/src/markdown/RichCodeBlock.tsx +127 -0
  131. package/src/markdown/SvgPreview.tsx +45 -0
  132. package/src/markdown/WebsiteIcon.tsx +94 -0
  133. package/src/markdown/builtin-renderers.tsx +43 -0
  134. package/src/markdown/definition.tsx +49 -0
  135. package/src/markdown/host.tsx +18 -0
  136. package/src/markdown/index.ts +11 -0
  137. package/src/markdown/inline-tokens.ts +187 -0
  138. package/src/markdown/markdown-link.ts +279 -0
  139. package/src/markdown/math-client.ts +116 -0
  140. package/src/markdown/math-render.ts +23 -0
  141. package/src/markdown/math-syntax.ts +80 -0
  142. package/src/markdown/math.worker.ts +16 -0
  143. package/src/markdown/nodes.ts +15 -0
  144. package/src/markdown/preview-policy.ts +43 -0
  145. package/src/markdown/rich-labels.ts +49 -0
  146. package/src/markdown/rich-syntax.ts +93 -0
  147. package/src/markdown/stable-blocks.test.ts +90 -0
  148. package/src/markdown/stable-blocks.ts +124 -0
  149. package/src/markdown/streaming-reveal.ts +297 -0
  150. package/src/markdown/streaming.test.ts +57 -0
  151. package/src/markdown/streaming.ts +211 -0
  152. package/src/markdown/use-render-snapshot.ts +24 -0
  153. package/src/markdown/use-rich-visibility.ts +24 -0
  154. package/src/overlays/CommandMenuRow.tsx +38 -9
  155. package/src/overlays/CommandMenuView.tsx +77 -117
  156. package/src/overlays/ConfirmDialogView.tsx +25 -20
  157. package/src/overlays/ReleaseNoteMarkdown.tsx +29 -0
  158. package/src/overlays/SplashOptionRow.tsx +46 -0
  159. package/src/overlays/SplashPanel.tsx +85 -0
  160. package/src/overlays/SplashParts.tsx +213 -0
  161. package/src/overlays/UpdateCheckerView.tsx +34 -18
  162. package/src/overlays/UpdateRestartDialogView.tsx +139 -54
  163. package/src/overlays/command-menu-types.ts +2 -0
  164. package/src/overlays/command-menu.css +1 -20
  165. package/src/overlays/index.ts +14 -1
  166. package/src/plugin-ui/index.ts +8 -0
  167. package/src/project/ConversationTagDotsView.tsx +1 -1
  168. package/src/project/ConversationTagEditorDialogView.tsx +4 -1
  169. package/src/project/DefaultConversationSectionView.tsx +4 -4
  170. package/src/project/DefaultSessionListView.tsx +5 -31
  171. package/src/project/DefaultSessionRowView.tsx +106 -55
  172. package/src/project/ManageSessionsSplashView.tsx +439 -0
  173. package/src/project/NewProjectDialogView.tsx +3 -10
  174. package/src/project/ProjectContextMenuView.tsx +30 -139
  175. package/src/project/ProjectDetailPageView.test.tsx +140 -0
  176. package/src/project/ProjectDetailPageView.tsx +372 -165
  177. package/src/project/ProjectGroupView.tsx +1 -1
  178. package/src/project/ProjectRowView.tsx +29 -12
  179. package/src/project/ProjectSessionsView.tsx +25 -47
  180. package/src/project/QuickScrollOverlay.tsx +1 -1
  181. package/src/project/SessionContextMenuView.tsx +15 -7
  182. package/src/project/SessionRowMoreButton.tsx +50 -0
  183. package/src/project/SessionRowView.tsx +106 -63
  184. package/src/project/SessionTitleMarquee.tsx +54 -0
  185. package/src/project/SidebarProjectDisclosure.tsx +60 -0
  186. package/src/project/SidebarProjectsSectionView.tsx +6 -1
  187. package/src/project/index.ts +12 -0
  188. package/src/project/session-row-transition.ts +9 -0
  189. package/src/project/types.ts +4 -2
  190. package/src/project/useActiveSessionAutoScroll.ts +10 -4
  191. package/src/registry.ts +0 -2
  192. package/src/scheduler/AutomationDetailPaneView.tsx +68 -0
  193. package/src/scheduler/AutomationPageView.tsx +118 -121
  194. package/src/scheduler/ExecutionHistoryView.tsx +7 -5
  195. package/src/scheduler/TaskListView.tsx +52 -201
  196. package/src/scheduler/index.ts +7 -12
  197. package/src/settings/AchievementSettingsView.tsx +0 -1
  198. package/src/settings/AppshotSettingsView.tsx +0 -1
  199. package/src/settings/BuiltinMcpSectionView.tsx +1 -1
  200. package/src/settings/EnvironmentGitRowView.tsx +156 -0
  201. package/src/settings/EnvironmentSettingsView.tsx +25 -3
  202. package/src/settings/GeneralSettingsView.tsx +17 -20
  203. package/src/settings/ImChannelGuideDialogView.tsx +2 -2
  204. package/src/settings/ImFeishuDialogView.tsx +1 -1
  205. package/src/settings/ImLegacyImportBannerView.tsx +1 -1
  206. package/src/settings/ImLogDrawerView.tsx +2 -1
  207. package/src/settings/JsonConfigInputView.tsx +171 -0
  208. package/src/settings/ModelsFetchedModelsDrawerView.tsx +292 -0
  209. package/src/settings/ModelsProvidersSectionView.tsx +26 -23
  210. package/src/settings/MotionSelect.tsx +9 -7
  211. package/src/settings/NotificationSettingsView.tsx +79 -0
  212. package/src/settings/PermissionsSettingsView.tsx +3 -7
  213. package/src/settings/PresetProviderModelsListView.tsx +141 -24
  214. package/src/settings/PresetProviderRowView.tsx +205 -182
  215. package/src/settings/ProxySettingsSectionView.tsx +182 -0
  216. package/src/settings/QrBindDialogView.tsx +1 -1
  217. package/src/settings/QuickPanelSettingsSectionView.tsx +0 -2
  218. package/src/settings/RemoteMcpSectionView.tsx +1 -1
  219. package/src/settings/SettingChrome.tsx +2 -2
  220. package/src/settings/SettingsAiAssistButtonView.tsx +9 -119
  221. package/src/settings/SettingsFormFields.tsx +4 -7
  222. package/src/settings/SettingsSidebarView.tsx +64 -3
  223. package/src/settings/ShortcutRecorderView.test.tsx +108 -0
  224. package/src/settings/ShortcutRecorderView.tsx +15 -9
  225. package/src/settings/ShortcutsSettingsView.tsx +1 -1
  226. package/src/settings/SpaceEditorDialogView.tsx +120 -0
  227. package/src/settings/SpacesSettingsView.tsx +105 -0
  228. package/src/settings/WebhookEndpointListView.tsx +4 -5
  229. package/src/settings/index.ts +41 -29
  230. package/src/shared/ActivityStatusDot.tsx +69 -0
  231. package/src/shared/AvatarStackView.tsx +13 -13
  232. package/src/shared/BotAvatar.tsx +11 -9
  233. package/src/shared/CodeBlockCopyButton.tsx +1 -1
  234. package/src/shared/ContextMenuView.tsx +4 -11
  235. package/src/shared/MarkdownTable.tsx +2 -2
  236. package/src/shared/SyntaxHighlightedCode.tsx +0 -0
  237. package/src/shared/TabBar.outline.test.tsx +59 -0
  238. package/src/shared/TabBar.tsx +22 -17
  239. package/src/shared/VettaKbd.test.tsx +52 -0
  240. package/src/shared/VettaKbd.tsx +81 -0
  241. package/src/shared/connected-tab-outline.test.ts +2 -2
  242. package/src/shared/connected-tab-outline.ts +2 -1
  243. package/src/shared/index.ts +6 -0
  244. package/src/shared/kbd-keys.test.ts +61 -0
  245. package/src/shared/kbd-keys.ts +253 -0
  246. package/src/shared/provider-icon/icons.ts +4 -2
  247. package/src/shared/provider-icon/index.tsx +1 -1
  248. package/src/shared/provider-icon/magpie.svg +1 -0
  249. package/src/sidebar/AddProjectMenuTriggerView.tsx +25 -15
  250. package/src/sidebar/DefaultSidebar.tsx +3 -1
  251. package/src/sidebar/MessageCenterDialogView.tsx +3 -2
  252. package/src/sidebar/MessageCenterEmptyState.tsx +1 -1
  253. package/src/sidebar/MessageCenterTabs.tsx +1 -1
  254. package/src/sidebar/MessageCenterToolbarButton.tsx +1 -1
  255. package/src/sidebar/MessageCenterTriggerView.tsx +2 -2
  256. package/src/sidebar/ProjectsPanelEmptyState.tsx +26 -7
  257. package/src/sidebar/SessionStatusIcon.tsx +16 -1
  258. package/src/sidebar/SettingsMenuThemeSection.tsx +1 -1
  259. package/src/sidebar/SettingsMenuTriggerView.test.tsx +42 -0
  260. package/src/sidebar/SettingsMenuTriggerView.tsx +28 -50
  261. package/src/sidebar/ShowMoreSessionsButton.tsx +1 -1
  262. package/src/sidebar/SidebarFilterSelectView.tsx +8 -16
  263. package/src/sidebar/SidebarNavBadgeView.tsx +1 -1
  264. package/src/sidebar/SidebarNavIcon.tsx +1 -1
  265. package/src/sidebar/SidebarNavItemButton.tsx +1 -1
  266. package/src/sidebar/SidebarNavMorePanel.tsx +19 -7
  267. package/src/sidebar/SidebarNavigation.tsx +24 -15
  268. package/src/sidebar/SidebarPanel.tsx +11 -2
  269. package/src/sidebar/SidebarSectionTriggerLabel.tsx +20 -0
  270. package/src/sidebar/SidebarTopBar.tsx +10 -7
  271. package/src/sidebar/WaitingPulseBadge.tsx +19 -0
  272. package/src/sidebar/index.ts +1 -16
  273. package/src/skills/index.ts +0 -19
  274. package/src/skills/skill-icon.tsx +4 -8
  275. package/src/styles.css +24 -6
  276. package/src/chat/DefaultSceneCarousel.tsx +0 -113
  277. package/src/chat/SceneCard.tsx +0 -138
  278. package/src/scheduler/HistoryDrawerView.tsx +0 -149
  279. package/src/scheduler/TaskFormDialogView.tsx +0 -60
  280. package/src/settings/SubscriptionActionsView.tsx +0 -63
  281. package/src/settings/SubscriptionCardsView.tsx +0 -212
  282. package/src/settings/TeamDetailView.tsx +0 -148
  283. package/src/settings/TeamDialogsView.tsx +0 -151
  284. package/src/settings/TeamListView.tsx +0 -57
  285. package/src/settings/TeamSettingsView.tsx +0 -51
  286. package/src/settings/TokenActivityChartView.tsx +0 -286
  287. package/src/settings/UsageStatsView.tsx +0 -101
  288. package/src/settings/shouldCloseEmptyApiKeyEditor.test.ts +0 -135
  289. package/src/settings/shouldCloseEmptyApiKeyEditor.ts +0 -40
  290. package/src/settings/token-activity.test.ts +0 -195
  291. package/src/settings/token-activity.ts +0 -320
  292. package/src/sidebar/AddProjectMenuItem.tsx +0 -21
  293. package/src/sidebar/AddProjectMenuPopoverView.tsx +0 -52
  294. package/src/sidebar/NotificationMessageListView.tsx +0 -136
  295. package/src/sidebar/SettingsMenuAccountSection.tsx +0 -32
  296. package/src/sidebar/SettingsMenuQuotaSection.tsx +0 -45
  297. package/src/skills/SceneCardView.tsx +0 -194
  298. package/src/skills/SkillCardView.tsx +0 -186
  299. package/src/skills/SkillDetailDialogView.tsx +0 -138
  300. package/src/skills/SkillTagGroupView.tsx +0 -56
  301. package/src/skills/SkillToggleSwitch.tsx +0 -31
@@ -1,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 { JSX, ReactNode, RefObject } from "react";
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-[mdi--chat-outline]", value: sessionCountLabel },
87
- createdAtLabel ? { icon: "icon-[mdi--calendar-outline]", value: createdAtLabel } : null,
88
- taskCountLabel ? { icon: "icon-[mdi--layers-outline]", value: taskCountLabel } : null,
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
- {/* ── Identity header ─────────────────────────────────── */}
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
- <div className="flex shrink-0 flex-wrap items-center justify-end gap-1">
143
- <Button
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
- <span className="icon-[solar--folder-open-linear] h-3.5 w-3.5" />
152
- </Button>
205
+ icon={<span className="icon-[solar--folder-open-linear] h-4 w-4" />}
206
+ />
153
207
  {exportable && (
154
- <Button
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
- <span className="icon-[solar--export-linear] h-3.5 w-3.5" />
163
- </Button>
212
+ icon={<span className="icon-[solar--export-linear] h-4 w-4" />}
213
+ />
164
214
  )}
165
- <Button
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
- <span className="icon-[solar--add-circle-linear] h-4 w-4" />
174
- <span className="hidden text-[12px] font-medium @min-[22rem]:inline">
175
- {labels.newSession}
176
- </span>
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
- aria-pressed={activityOpen}
185
- >
186
- <span className="icon-[solar--sidebar-minimalistic-linear] -scale-x-100 text-[14px]" />
187
- </Button>
188
- </div>
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
- </motion.header>
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
- <motion.section
217
- className="flex min-h-[280px] flex-1 flex-col px-4 pb-5 @md:min-h-[360px] @md:px-8 @md:pb-6"
218
- initial={{ opacity: 0, y: 14 }}
219
- animate={{ opacity: 1, y: 0 }}
220
- transition={{ duration: 0.5, delay: 0.08, ease: easeOut }}
221
- >
222
- {/* Document shell */}
223
- <div
224
- className={cn(
225
- "flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden rounded-2xl border bg-card/50 shadow-[0_1px_2px_rgba(15,23,42,0.04)] backdrop-blur-sm transition-[border-color,box-shadow] duration-300",
226
- editorFocused
227
- ? "border-primary/40 shadow-[0_0_0_1px_color-mix(in_oklab,var(--primary)_18%,transparent),0_8px_24px_-12px_color-mix(in_oklab,var(--primary)_25%,transparent)]"
228
- : "border-border/50",
229
- )}
230
- >
231
- {/* Editor chrome */}
232
- <div className="flex shrink-0 flex-wrap items-center justify-between gap-x-2 gap-y-2 border-b border-border/40 px-3 py-2 @md:px-4 @md:py-2.5">
233
- <div className="flex min-w-0 flex-1 items-center gap-2">
234
- <h2 className="min-w-0 truncate text-[13px] font-semibold tracking-tight text-foreground">
235
- {labels.persona}
236
- </h2>
237
- <span className="hidden shrink-0 rounded-md border border-border/40 bg-background/60 px-1.5 py-px font-mono text-[10px] text-muted-foreground/55 @min-[22rem]:inline">
238
- AGENTS.md
239
- </span>
240
- <AnimatePresence>
241
- {isDirty && (
242
- <motion.span
243
- key="dirty"
244
- initial={{ opacity: 0, scale: 0.6 }}
245
- animate={{ opacity: 1, scale: 1 }}
246
- exit={{ opacity: 0, scale: 0.6 }}
247
- className="inline-flex shrink-0 items-center gap-1 rounded-full bg-amber-500/10 px-1.5 py-0.5 text-[10px] font-medium text-amber-500"
248
- title={labels.unsavedChanges}
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
- <span className="relative flex h-1.5 w-1.5">
251
- <span className="absolute inline-flex h-full w-full animate-ping rounded-full bg-amber-500 opacity-60" />
252
- <span className="relative inline-flex h-1.5 w-1.5 rounded-full bg-amber-500" />
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
- <span className="hidden @min-[28rem]:inline">{labels.unsavedChanges}</span>
255
- </motion.span>
256
- )}
257
- </AnimatePresence>
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
- <div className="flex shrink-0 items-center gap-1.5">
261
- <AnimatePresence mode="popLayout">
262
- {saveStatus === "saved" && (
263
- <motion.span
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
- variant={isDirty ? "primary" : "outline"}
291
- size="sm"
292
- onClick={onSave}
293
- disabled={!isDirty || saveStatus === "saving"}
294
- title={labels.save}
295
- aria-label={labels.save}
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
- {saveStatus === "saving" ? (
298
- <span className="icon-[mdi--loading] h-3.5 w-3.5 animate-spin" />
299
- ) : (
300
- <span className="icon-[mdi--content-save-outline] h-3.5 w-3.5" />
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
- <span className="hidden @min-[18rem]:inline">{labels.save}</span>
303
- </Button>
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
- {/* Editor body */}
308
- {loading ? (
309
- <div className="flex flex-1 items-center justify-center py-16">
310
- <span className="icon-[mdi--loading] h-5 w-5 animate-spin text-primary/50" />
311
- </div>
312
- ) : (
313
- <div className="relative flex min-h-0 min-w-0 flex-1 flex-col">
314
- <div
315
- aria-hidden
316
- className={cn(
317
- "pointer-events-none absolute inset-x-0 top-0 h-px bg-gradient-to-r from-transparent via-primary/50 to-transparent transition-opacity duration-300",
318
- editorFocused ? "opacity-100" : "opacity-0",
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
- <textarea
322
- ref={textareaRef}
323
- value={content}
324
- onChange={(e) => onContentChange(e.target.value)}
325
- onFocus={onEditorFocus}
326
- onBlur={onEditorBlur}
327
- placeholder={labels.editorPlaceholder}
328
- spellCheck={false}
329
- className="min-h-0 min-w-0 flex-1 resize-none bg-transparent px-3 py-3 font-mono text-[13px] leading-[1.7] text-foreground placeholder:text-muted-foreground/30 focus:outline-none @md:px-5 @md:py-4"
330
- />
331
- </div>
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
- {/* Footer hint */}
335
- <div className="flex shrink-0 items-center gap-1.5 overflow-hidden border-t border-border/30 bg-accent/10 px-3 py-2 text-[11px] text-muted-foreground/50 @md:px-4">
336
- <span className="icon-[mdi--information-outline] h-3 w-3 shrink-0 opacity-60" />
337
- <span className="min-w-0 flex-1 truncate">{labels.agentsMdHint}</span>
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
- </motion.section>
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
  );