bingocode 1.0.1 → 1.0.3
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/bin/bingo-win.cjs +34 -3
- package/desktop/README.md +30 -0
- package/desktop/bunfig.toml +1 -0
- package/desktop/index.html +17 -0
- package/desktop/package.json +55 -0
- package/desktop/pnpm-lock.yaml +3832 -0
- package/desktop/public/app-icon.jpg +0 -0
- package/desktop/public/fonts/inter-latin-ext.woff2 +0 -0
- package/desktop/public/fonts/inter-latin.woff2 +0 -0
- package/desktop/public/fonts/jetbrains-mono-latin-ext.woff2 +0 -0
- package/desktop/public/fonts/jetbrains-mono-latin.woff2 +0 -0
- package/desktop/public/fonts/manrope-latin-ext.woff2 +0 -0
- package/desktop/public/fonts/manrope-latin.woff2 +0 -0
- package/desktop/public/fonts/material-symbols-outlined.woff2 +0 -0
- package/desktop/public/icons/bilibili.svg +1 -0
- package/desktop/public/icons/douyin.svg +1 -0
- package/desktop/public/icons/github.svg +3 -0
- package/desktop/public/icons/xiaohongshu.svg +1 -0
- package/desktop/scripts/build-macos-arm64.sh +270 -0
- package/desktop/scripts/build-sidecars.ts +183 -0
- package/desktop/scripts/build-windows-x64.ps1 +295 -0
- package/desktop/scripts/scan-missing-imports.ts +235 -0
- package/desktop/sidecars/claude-sidecar.ts +156 -0
- package/desktop/src/App.tsx +5 -0
- package/desktop/src/__tests__/agentsSettings.test.tsx +349 -0
- package/desktop/src/__tests__/pages.test.tsx +290 -0
- package/desktop/src/__tests__/skillsSettings.test.tsx +205 -0
- package/desktop/src/api/adapters.ts +12 -0
- package/desktop/src/api/agents.ts +36 -0
- package/desktop/src/api/cliTasks.ts +28 -0
- package/desktop/src/api/client.ts +63 -0
- package/desktop/src/api/computerUse.ts +76 -0
- package/desktop/src/api/filesystem.ts +30 -0
- package/desktop/src/api/hahaOAuth.ts +38 -0
- package/desktop/src/api/models.ts +28 -0
- package/desktop/src/api/providers.ts +63 -0
- package/desktop/src/api/search.ts +29 -0
- package/desktop/src/api/sessions.ts +56 -0
- package/desktop/src/api/settings.ts +20 -0
- package/desktop/src/api/skills.ts +19 -0
- package/desktop/src/api/tasks.ts +36 -0
- package/desktop/src/api/teams.ts +44 -0
- package/desktop/src/api/websocket.ts +164 -0
- package/desktop/src/components/chat/AskUserQuestion.tsx +268 -0
- package/desktop/src/components/chat/AssistantMessage.tsx +29 -0
- package/desktop/src/components/chat/AttachmentGallery.tsx +113 -0
- package/desktop/src/components/chat/ChatInput.tsx +622 -0
- package/desktop/src/components/chat/CodeViewer.tsx +161 -0
- package/desktop/src/components/chat/ComputerUsePermissionModal.test.tsx +174 -0
- package/desktop/src/components/chat/ComputerUsePermissionModal.tsx +311 -0
- package/desktop/src/components/chat/DiffViewer.tsx +157 -0
- package/desktop/src/components/chat/FileSearchMenu.tsx +198 -0
- package/desktop/src/components/chat/ImageGalleryModal.tsx +91 -0
- package/desktop/src/components/chat/InlineImageGallery.tsx +106 -0
- package/desktop/src/components/chat/InlineTaskSummary.tsx +60 -0
- package/desktop/src/components/chat/MermaidRenderer.test.tsx +98 -0
- package/desktop/src/components/chat/MermaidRenderer.tsx +361 -0
- package/desktop/src/components/chat/MessageActionBar.tsx +27 -0
- package/desktop/src/components/chat/MessageList.test.tsx +313 -0
- package/desktop/src/components/chat/MessageList.tsx +249 -0
- package/desktop/src/components/chat/PermissionDialog.tsx +262 -0
- package/desktop/src/components/chat/SessionTaskBar.test.tsx +99 -0
- package/desktop/src/components/chat/SessionTaskBar.tsx +159 -0
- package/desktop/src/components/chat/StreamingIndicator.tsx +41 -0
- package/desktop/src/components/chat/TerminalChrome.tsx +35 -0
- package/desktop/src/components/chat/ThinkingBlock.tsx +87 -0
- package/desktop/src/components/chat/ToolCallBlock.tsx +247 -0
- package/desktop/src/components/chat/ToolCallGroup.tsx +617 -0
- package/desktop/src/components/chat/ToolResultBlock.tsx +107 -0
- package/desktop/src/components/chat/UserMessage.tsx +38 -0
- package/desktop/src/components/chat/chatBlocks.test.tsx +136 -0
- package/desktop/src/components/chat/clipboard.ts +25 -0
- package/desktop/src/components/chat/composerUtils.test.ts +55 -0
- package/desktop/src/components/chat/composerUtils.ts +149 -0
- package/desktop/src/components/controls/ModelSelector.tsx +156 -0
- package/desktop/src/components/controls/PermissionModeSelector.tsx +229 -0
- package/desktop/src/components/layout/AppShell.tsx +107 -0
- package/desktop/src/components/layout/ContentRouter.tsx +27 -0
- package/desktop/src/components/layout/ProjectFilter.tsx +126 -0
- package/desktop/src/components/layout/Sidebar.test.tsx +158 -0
- package/desktop/src/components/layout/Sidebar.tsx +384 -0
- package/desktop/src/components/layout/StatusBar.tsx +31 -0
- package/desktop/src/components/layout/TabBar.test.tsx +136 -0
- package/desktop/src/components/layout/TabBar.tsx +318 -0
- package/desktop/src/components/layout/TitleBar.tsx +96 -0
- package/desktop/src/components/layout/WindowControls.test.tsx +69 -0
- package/desktop/src/components/layout/WindowControls.tsx +89 -0
- package/desktop/src/components/markdown/MarkdownRenderer.test.tsx +100 -0
- package/desktop/src/components/markdown/MarkdownRenderer.tsx +229 -0
- package/desktop/src/components/settings/ClaudeOfficialLogin.tsx +107 -0
- package/desktop/src/components/shared/Button.tsx +63 -0
- package/desktop/src/components/shared/CopyButton.tsx +58 -0
- package/desktop/src/components/shared/DirectoryPicker.tsx +316 -0
- package/desktop/src/components/shared/Dropdown.tsx +91 -0
- package/desktop/src/components/shared/Input.tsx +38 -0
- package/desktop/src/components/shared/Modal.tsx +65 -0
- package/desktop/src/components/shared/ProjectContextChip.tsx +30 -0
- package/desktop/src/components/shared/Spinner.tsx +30 -0
- package/desktop/src/components/shared/Textarea.tsx +38 -0
- package/desktop/src/components/shared/Toast.tsx +47 -0
- package/desktop/src/components/shared/UpdateChecker.tsx +90 -0
- package/desktop/src/components/skills/SkillDetail.test.tsx +89 -0
- package/desktop/src/components/skills/SkillDetail.tsx +403 -0
- package/desktop/src/components/skills/SkillList.tsx +254 -0
- package/desktop/src/components/tasks/DayOfWeekPicker.tsx +57 -0
- package/desktop/src/components/tasks/NewTaskModal.tsx +407 -0
- package/desktop/src/components/tasks/PromptEditor.tsx +74 -0
- package/desktop/src/components/tasks/TaskEmptyState.tsx +30 -0
- package/desktop/src/components/tasks/TaskList.tsx +46 -0
- package/desktop/src/components/tasks/TaskRow.tsx +253 -0
- package/desktop/src/components/tasks/TaskRunsPanel.tsx +195 -0
- package/desktop/src/components/teams/TeamStatusBar.tsx +147 -0
- package/desktop/src/config/providerPresets.ts +78 -0
- package/desktop/src/config/spinnerVerbs.ts +193 -0
- package/desktop/src/hooks/useKeyboardShortcuts.ts +60 -0
- package/desktop/src/i18n/index.ts +54 -0
- package/desktop/src/i18n/locales/en.ts +670 -0
- package/desktop/src/i18n/locales/zh.ts +670 -0
- package/desktop/src/lib/__tests__/cronDescribe.test.ts +93 -0
- package/desktop/src/lib/cronDescribe.ts +188 -0
- package/desktop/src/lib/desktopRuntime.ts +54 -0
- package/desktop/src/lib/parseRunOutput.ts +79 -0
- package/desktop/src/main.tsx +13 -0
- package/desktop/src/mocks/data.ts +202 -0
- package/desktop/src/pages/ActiveSession.test.tsx +181 -0
- package/desktop/src/pages/ActiveSession.tsx +219 -0
- package/desktop/src/pages/AdapterSettings.tsx +375 -0
- package/desktop/src/pages/AgentTeams.tsx +200 -0
- package/desktop/src/pages/ComputerUseSettings.tsx +420 -0
- package/desktop/src/pages/EmptySession.tsx +518 -0
- package/desktop/src/pages/NewTaskModal.tsx +346 -0
- package/desktop/src/pages/ScheduledTasks.tsx +66 -0
- package/desktop/src/pages/ScheduledTasksEmpty.tsx +152 -0
- package/desktop/src/pages/ScheduledTasksList.tsx +416 -0
- package/desktop/src/pages/SessionControls.tsx +460 -0
- package/desktop/src/pages/Settings.tsx +1448 -0
- package/desktop/src/pages/ToolInspection.tsx +235 -0
- package/desktop/src/stores/adapterStore.ts +106 -0
- package/desktop/src/stores/agentStore.ts +34 -0
- package/desktop/src/stores/chatStore.test.ts +505 -0
- package/desktop/src/stores/chatStore.ts +850 -0
- package/desktop/src/stores/cliTaskStore.ts +152 -0
- package/desktop/src/stores/hahaOAuthStore.test.ts +77 -0
- package/desktop/src/stores/hahaOAuthStore.ts +97 -0
- package/desktop/src/stores/providerStore.ts +101 -0
- package/desktop/src/stores/sessionStore.test.ts +63 -0
- package/desktop/src/stores/sessionStore.ts +102 -0
- package/desktop/src/stores/settingsStore.ts +120 -0
- package/desktop/src/stores/skillStore.ts +51 -0
- package/desktop/src/stores/tabStore.ts +169 -0
- package/desktop/src/stores/taskStore.ts +68 -0
- package/desktop/src/stores/teamStore.ts +344 -0
- package/desktop/src/stores/uiStore.ts +100 -0
- package/desktop/src/stores/updateStore.test.ts +71 -0
- package/desktop/src/stores/updateStore.ts +221 -0
- package/desktop/src/theme/globals.css +465 -0
- package/desktop/src/types/adapter.ts +33 -0
- package/desktop/src/types/chat.ts +152 -0
- package/desktop/src/types/cliTask.ts +24 -0
- package/desktop/src/types/provider.ts +62 -0
- package/desktop/src/types/session.ts +27 -0
- package/desktop/src/types/settings.ts +22 -0
- package/desktop/src/types/skill.ts +38 -0
- package/desktop/src/types/task.ts +56 -0
- package/desktop/src/types/team.ts +38 -0
- package/desktop/src-tauri/Cargo.lock +5549 -0
- package/desktop/src-tauri/Cargo.toml +20 -0
- package/desktop/src-tauri/app-icon.svg +13 -0
- package/desktop/src-tauri/build.rs +3 -0
- package/desktop/src-tauri/capabilities/default.json +106 -0
- package/desktop/src-tauri/icons/android/mipmap-anydpi-v26/ic_launcher.xml +5 -0
- package/desktop/src-tauri/icons/android/values/ic_launcher_background.xml +4 -0
- package/desktop/src-tauri/icons/icon.icns +0 -0
- package/desktop/src-tauri/icons/icon.ico +0 -0
- package/desktop/src-tauri/src/lib.rs +408 -0
- package/desktop/src-tauri/src/main.rs +6 -0
- package/desktop/src-tauri/tauri.conf.json +78 -0
- package/desktop/src-tauri/tauri.macos.conf.json +18 -0
- package/desktop/src-tauri/tauri.release-ci.json +5 -0
- package/desktop/src-tauri/tauri.windows.conf.json +16 -0
- package/desktop/src-tauri/windows-installer-hooks.nsh +17 -0
- package/desktop/tsconfig.json +25 -0
- package/desktop/vite.config.ts +26 -0
- package/desktop/vitest.config.ts +18 -0
- package/package.json +1 -1
- package/src/commands/desktop/desktop.tsx +9 -0
- package/src/commands/desktop/index.ts +26 -0
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import ReactDiffViewer, { DiffMethod } from 'react-diff-viewer-continued'
|
|
2
|
+
import { Highlight, type PrismTheme } from 'prism-react-renderer'
|
|
3
|
+
import { CopyButton } from '../shared/CopyButton'
|
|
4
|
+
|
|
5
|
+
type Props = {
|
|
6
|
+
filePath: string
|
|
7
|
+
oldString: string
|
|
8
|
+
newString: string
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function inferLanguage(filePath: string): string {
|
|
12
|
+
const ext = filePath.split('.').pop()?.toLowerCase()
|
|
13
|
+
const langMap: Record<string, string> = {
|
|
14
|
+
ts: 'typescript', tsx: 'tsx', js: 'javascript', jsx: 'jsx',
|
|
15
|
+
py: 'python', rs: 'rust', go: 'go', rb: 'ruby',
|
|
16
|
+
json: 'json', yaml: 'yaml', yml: 'yaml', toml: 'toml',
|
|
17
|
+
md: 'markdown', css: 'css', html: 'markup', xml: 'markup',
|
|
18
|
+
sql: 'sql', sh: 'bash', bash: 'bash', zsh: 'bash',
|
|
19
|
+
}
|
|
20
|
+
return langMap[ext ?? ''] || 'text'
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** Shared warm syntax theme — must stay in sync with CodeViewer */
|
|
24
|
+
const warmSyntaxTheme: PrismTheme = {
|
|
25
|
+
plain: {
|
|
26
|
+
color: 'var(--color-code-fg)',
|
|
27
|
+
backgroundColor: 'transparent',
|
|
28
|
+
},
|
|
29
|
+
styles: [
|
|
30
|
+
{ types: ['comment', 'prolog', 'doctype', 'cdata'], style: { color: 'var(--color-code-comment)', fontStyle: 'italic' as const } },
|
|
31
|
+
{ types: ['string', 'attr-value', 'template-string'], style: { color: 'var(--color-code-string)' } },
|
|
32
|
+
{ types: ['keyword', 'selector', 'important', 'atrule'], style: { color: 'var(--color-code-keyword)' } },
|
|
33
|
+
{ types: ['function'], style: { color: 'var(--color-code-function)' } },
|
|
34
|
+
{ types: ['tag'], style: { color: 'var(--color-code-keyword)' } },
|
|
35
|
+
{ types: ['number', 'boolean'], style: { color: 'var(--color-code-number)' } },
|
|
36
|
+
{ types: ['operator'], style: { color: 'var(--color-code-fg)' } },
|
|
37
|
+
{ types: ['punctuation'], style: { color: 'var(--color-code-punctuation)' } },
|
|
38
|
+
{ types: ['variable', 'parameter'], style: { color: 'var(--color-code-fg)' } },
|
|
39
|
+
{ types: ['property', 'attr-name'], style: { color: 'var(--color-code-property)' } },
|
|
40
|
+
{ types: ['builtin', 'class-name', 'constant', 'symbol'], style: { color: 'var(--color-code-type)' } },
|
|
41
|
+
{ types: ['regex'], style: { color: 'var(--color-primary-container)' } },
|
|
42
|
+
{ types: ['inserted'], style: { color: 'var(--color-code-inserted)' } },
|
|
43
|
+
{ types: ['deleted'], style: { color: 'var(--color-code-deleted)' } },
|
|
44
|
+
],
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function highlightSyntax(str: string, language: string) {
|
|
48
|
+
return (
|
|
49
|
+
<Highlight theme={warmSyntaxTheme} code={str} language={language}>
|
|
50
|
+
{({ tokens, getTokenProps }) => (
|
|
51
|
+
<>
|
|
52
|
+
{tokens.map((line, i) => (
|
|
53
|
+
<span key={i}>
|
|
54
|
+
{line.map((token, key) => (
|
|
55
|
+
<span key={key} {...getTokenProps({ token })} />
|
|
56
|
+
))}
|
|
57
|
+
</span>
|
|
58
|
+
))}
|
|
59
|
+
</>
|
|
60
|
+
)}
|
|
61
|
+
</Highlight>
|
|
62
|
+
)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const diffStyles = {
|
|
66
|
+
variables: {
|
|
67
|
+
light: {
|
|
68
|
+
diffViewerBackground: 'var(--color-code-bg)',
|
|
69
|
+
diffViewerColor: 'var(--color-code-fg)',
|
|
70
|
+
addedBackground: 'var(--color-diff-added-bg)',
|
|
71
|
+
addedColor: 'var(--color-code-fg)',
|
|
72
|
+
removedBackground: 'var(--color-diff-removed-bg)',
|
|
73
|
+
removedColor: 'var(--color-code-fg)',
|
|
74
|
+
wordAddedBackground: 'var(--color-diff-added-word)',
|
|
75
|
+
wordRemovedBackground: 'var(--color-diff-removed-word)',
|
|
76
|
+
addedGutterBackground: 'var(--color-diff-added-gutter)',
|
|
77
|
+
removedGutterBackground: 'var(--color-diff-removed-gutter)',
|
|
78
|
+
gutterBackground: 'var(--color-surface-container-low)',
|
|
79
|
+
gutterBackgroundDark: 'var(--color-surface-container)',
|
|
80
|
+
highlightBackground: 'var(--color-diff-highlight-bg)',
|
|
81
|
+
highlightGutterBackground: 'var(--color-diff-highlight-gutter)',
|
|
82
|
+
codeFoldGutterBackground: 'var(--color-surface-container-high)',
|
|
83
|
+
codeFoldBackground: 'var(--color-surface-container-highest)',
|
|
84
|
+
emptyLineBackground: 'var(--color-surface-container-low)',
|
|
85
|
+
gutterColor: 'var(--color-text-tertiary)',
|
|
86
|
+
addedGutterColor: 'var(--color-diff-added-text)',
|
|
87
|
+
removedGutterColor: 'var(--color-diff-removed-text)',
|
|
88
|
+
codeFoldContentColor: 'var(--color-text-tertiary)',
|
|
89
|
+
diffViewerTitleBackground: 'var(--color-diff-title-bg)',
|
|
90
|
+
diffViewerTitleColor: 'var(--color-diff-title-color)',
|
|
91
|
+
diffViewerTitleBorderColor: 'var(--color-diff-title-border)',
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
diffContainer: {
|
|
95
|
+
borderRadius: '0',
|
|
96
|
+
fontSize: '12px',
|
|
97
|
+
lineHeight: '1.45',
|
|
98
|
+
fontFamily: 'var(--font-mono)',
|
|
99
|
+
},
|
|
100
|
+
line: {
|
|
101
|
+
padding: '1px 0',
|
|
102
|
+
},
|
|
103
|
+
gutter: {
|
|
104
|
+
padding: '1px 8px',
|
|
105
|
+
minWidth: '40px',
|
|
106
|
+
fontSize: '11px',
|
|
107
|
+
},
|
|
108
|
+
wordDiff: {
|
|
109
|
+
padding: '1px 2px',
|
|
110
|
+
borderRadius: '2px',
|
|
111
|
+
},
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export function DiffViewer({ filePath, oldString, newString }: Props) {
|
|
115
|
+
const language = inferLanguage(filePath)
|
|
116
|
+
|
|
117
|
+
const oldLines = oldString.split('\n')
|
|
118
|
+
const newLines = newString.split('\n')
|
|
119
|
+
const additions = newLines.filter((l, i) => l !== (oldLines[i] ?? null)).length
|
|
120
|
+
const deletions = oldLines.filter((l, i) => l !== (newLines[i] ?? null)).length
|
|
121
|
+
|
|
122
|
+
return (
|
|
123
|
+
<div className="overflow-hidden rounded-[var(--radius-lg)] border border-[var(--color-outline-variant)]/50 bg-[var(--color-surface-container-low)]">
|
|
124
|
+
{/* Header */}
|
|
125
|
+
<div className="flex items-center justify-between border-b border-[var(--color-outline-variant)]/40 bg-[var(--color-surface-container)] px-3 py-1.5">
|
|
126
|
+
<div className="min-w-0">
|
|
127
|
+
<div className="truncate font-[var(--font-mono)] text-[11px] text-[var(--color-text-tertiary)]">
|
|
128
|
+
{filePath}
|
|
129
|
+
</div>
|
|
130
|
+
<div className="mt-1 flex items-center gap-2 text-[10px] uppercase tracking-[0.14em]">
|
|
131
|
+
<span className="rounded-full bg-[var(--color-diff-added-bg)] px-2 py-0.5 text-[var(--color-diff-added-text)]">+{additions}</span>
|
|
132
|
+
<span className="rounded-full bg-[var(--color-diff-removed-bg)] px-2 py-0.5 text-[var(--color-diff-removed-text)]">-{deletions}</span>
|
|
133
|
+
</div>
|
|
134
|
+
</div>
|
|
135
|
+
<CopyButton
|
|
136
|
+
text={`--- ${filePath}\n+++ ${filePath}`}
|
|
137
|
+
label="Copy path"
|
|
138
|
+
className="rounded-md border border-[var(--color-outline-variant)]/40 bg-[var(--color-surface-container-lowest)] px-2 py-1 text-[11px] text-[var(--color-text-tertiary)] transition-colors hover:bg-[var(--color-surface-container-high)] hover:text-[var(--color-text-primary)]"
|
|
139
|
+
/>
|
|
140
|
+
</div>
|
|
141
|
+
|
|
142
|
+
{/* Diff area */}
|
|
143
|
+
<div className="max-h-[400px] overflow-auto">
|
|
144
|
+
<ReactDiffViewer
|
|
145
|
+
oldValue={oldString}
|
|
146
|
+
newValue={newString}
|
|
147
|
+
splitView={false}
|
|
148
|
+
compareMethod={DiffMethod.WORDS}
|
|
149
|
+
renderContent={(str) => highlightSyntax(str, language)}
|
|
150
|
+
hideLineNumbers={false}
|
|
151
|
+
styles={diffStyles}
|
|
152
|
+
useDarkTheme={document.documentElement.getAttribute('data-theme') === 'dark'}
|
|
153
|
+
/>
|
|
154
|
+
</div>
|
|
155
|
+
</div>
|
|
156
|
+
)
|
|
157
|
+
}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import { forwardRef, useState, useEffect, useRef, useCallback, useImperativeHandle } from 'react'
|
|
2
|
+
import { filesystemApi } from '../../api/filesystem'
|
|
3
|
+
import { useTranslation } from '../../i18n'
|
|
4
|
+
|
|
5
|
+
type DirEntry = {
|
|
6
|
+
name: string
|
|
7
|
+
path: string
|
|
8
|
+
isDirectory: boolean
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export type FileSearchMenuHandle = {
|
|
12
|
+
handleKeyDown: (e: KeyboardEvent) => void
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
type Props = {
|
|
16
|
+
cwd: string
|
|
17
|
+
filter?: string
|
|
18
|
+
onSelect: (path: string, relativePath: string) => void
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const FileSearchMenu = forwardRef<FileSearchMenuHandle, Props>(({ cwd, filter = '', onSelect }, ref) => {
|
|
22
|
+
const t = useTranslation()
|
|
23
|
+
const [entries, setEntries] = useState<DirEntry[]>([])
|
|
24
|
+
const [currentPath, setCurrentPath] = useState(cwd)
|
|
25
|
+
const [loading, setLoading] = useState(false)
|
|
26
|
+
const [selectedIndex, setSelectedIndex] = useState(0)
|
|
27
|
+
const listRef = useRef<HTMLDivElement>(null)
|
|
28
|
+
const currentPathRef = useRef(cwd)
|
|
29
|
+
|
|
30
|
+
// Parse filter: if it contains '/', navigate to that subdir and search the rest
|
|
31
|
+
// Uses currentPathRef as base so nested paths navigate from current depth
|
|
32
|
+
const parseFilter = (rawFilter: string): { navigateTo: string; searchQuery: string } => {
|
|
33
|
+
const base = currentPathRef.current
|
|
34
|
+
if (!rawFilter || !rawFilter.includes('/')) {
|
|
35
|
+
return { navigateTo: base, searchQuery: rawFilter }
|
|
36
|
+
}
|
|
37
|
+
const lastSlash = rawFilter.lastIndexOf('/')
|
|
38
|
+
const dirPart = rawFilter.slice(0, lastSlash + 1)
|
|
39
|
+
const searchPart = rawFilter.slice(lastSlash + 1)
|
|
40
|
+
const navigateTo = dirPart === '' ? base : `${base}/${dirPart}`
|
|
41
|
+
return { navigateTo, searchQuery: searchPart }
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Load directory entries
|
|
45
|
+
const loadDir = useCallback(async (dirPath: string, searchQuery: string) => {
|
|
46
|
+
setLoading(true)
|
|
47
|
+
// Only update currentPath if actually navigating to a different directory
|
|
48
|
+
if (dirPath !== currentPathRef.current) {
|
|
49
|
+
setCurrentPath(dirPath)
|
|
50
|
+
currentPathRef.current = dirPath
|
|
51
|
+
}
|
|
52
|
+
try {
|
|
53
|
+
if (searchQuery) {
|
|
54
|
+
const result = await filesystemApi.search(searchQuery, dirPath)
|
|
55
|
+
setEntries(result.entries)
|
|
56
|
+
} else {
|
|
57
|
+
const result = await filesystemApi.browse(dirPath, { includeFiles: true })
|
|
58
|
+
setEntries(result.entries)
|
|
59
|
+
}
|
|
60
|
+
setSelectedIndex(0)
|
|
61
|
+
} catch {
|
|
62
|
+
setEntries([])
|
|
63
|
+
}
|
|
64
|
+
setLoading(false)
|
|
65
|
+
}, [])
|
|
66
|
+
|
|
67
|
+
// Initial load: parse filter path and navigate accordingly
|
|
68
|
+
useEffect(() => {
|
|
69
|
+
currentPathRef.current = cwd
|
|
70
|
+
const { navigateTo, searchQuery } = parseFilter(filter)
|
|
71
|
+
void loadDir(navigateTo, searchQuery)
|
|
72
|
+
}, [cwd, filter, loadDir])
|
|
73
|
+
|
|
74
|
+
// Keyboard navigation handler exposed via ref
|
|
75
|
+
const handleKeyDown = useCallback((e: KeyboardEvent) => {
|
|
76
|
+
if (e.key === 'ArrowDown') {
|
|
77
|
+
e.preventDefault()
|
|
78
|
+
setSelectedIndex((prev) => Math.min(prev + 1, entries.length - 1))
|
|
79
|
+
return
|
|
80
|
+
}
|
|
81
|
+
if (e.key === 'ArrowUp') {
|
|
82
|
+
e.preventDefault()
|
|
83
|
+
setSelectedIndex((prev) => Math.max(prev - 1, 0))
|
|
84
|
+
return
|
|
85
|
+
}
|
|
86
|
+
if (e.key === 'Enter' || e.key === 'Tab') {
|
|
87
|
+
e.preventDefault()
|
|
88
|
+
if (entries[selectedIndex]) {
|
|
89
|
+
onSelect(entries[selectedIndex]!.path, entries[selectedIndex]!.name)
|
|
90
|
+
}
|
|
91
|
+
return
|
|
92
|
+
}
|
|
93
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
94
|
+
}, [entries, selectedIndex])
|
|
95
|
+
|
|
96
|
+
useImperativeHandle(ref, () => ({ handleKeyDown }), [handleKeyDown])
|
|
97
|
+
|
|
98
|
+
// Scroll selected into view
|
|
99
|
+
useEffect(() => {
|
|
100
|
+
const el = listRef.current?.querySelector(`[data-index="${selectedIndex}"]`) as HTMLButtonElement | null
|
|
101
|
+
el?.scrollIntoView({ block: 'nearest' })
|
|
102
|
+
}, [selectedIndex])
|
|
103
|
+
|
|
104
|
+
// Build breadcrumb segments from current path relative to cwd
|
|
105
|
+
const breadcrumbs: string[] = []
|
|
106
|
+
if (currentPath !== cwd && currentPath.startsWith(cwd)) {
|
|
107
|
+
const rel = currentPath.slice(cwd.length).replace(/^\//, '')
|
|
108
|
+
if (rel) breadcrumbs.push(...rel.split('/'))
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
const dirs = entries.filter((e) => e.isDirectory)
|
|
112
|
+
const files = entries.filter((e) => !e.isDirectory)
|
|
113
|
+
|
|
114
|
+
return (
|
|
115
|
+
<div
|
|
116
|
+
id="file-search-menu"
|
|
117
|
+
className="absolute left-0 bottom-full mb-2 z-50 w-full min-w-[480px] overflow-hidden rounded-xl border border-[var(--color-border)] bg-[var(--color-surface-container-lowest)] shadow-[var(--shadow-dropdown)]"
|
|
118
|
+
onMouseDown={(e) => e.stopPropagation()}
|
|
119
|
+
>
|
|
120
|
+
{/* Header with path */}
|
|
121
|
+
<div className="flex items-center gap-1.5 border-b border-[var(--color-border)] px-3 py-2 text-[11px]">
|
|
122
|
+
<span className="material-symbols-outlined text-[14px] text-[var(--color-text-tertiary)]">folder_open</span>
|
|
123
|
+
<span className="text-[var(--color-text-tertiary)] font-mono">{cwd.split('/').pop() || cwd}</span>
|
|
124
|
+
{breadcrumbs.map((seg, i) => (
|
|
125
|
+
<span key={i} className="flex items-center gap-1">
|
|
126
|
+
<span className="text-[var(--color-text-tertiary)]">/</span>
|
|
127
|
+
<span className="text-[var(--color-text-primary)] font-mono">{seg}</span>
|
|
128
|
+
</span>
|
|
129
|
+
))}
|
|
130
|
+
{loading && (
|
|
131
|
+
<span className="material-symbols-outlined text-[12px] text-[var(--color-text-tertiary)] animate-spin ml-1">progress_activity</span>
|
|
132
|
+
)}
|
|
133
|
+
</div>
|
|
134
|
+
|
|
135
|
+
{/* File list */}
|
|
136
|
+
<div ref={listRef} className="max-h-[300px] overflow-y-auto py-1">
|
|
137
|
+
{loading && entries.length === 0 ? (
|
|
138
|
+
<div className="px-4 py-6 text-center text-xs text-[var(--color-text-tertiary)]">{t('fileSearch.searching')}</div>
|
|
139
|
+
) : entries.length === 0 ? (
|
|
140
|
+
<div className="px-4 py-6 text-center text-xs text-[var(--color-text-tertiary)]">
|
|
141
|
+
{filter ? t('fileSearch.noMatch') : t('fileSearch.noFiles')}
|
|
142
|
+
</div>
|
|
143
|
+
) : (
|
|
144
|
+
<>
|
|
145
|
+
{/* Directories */}
|
|
146
|
+
{dirs.map((entry, i) => (
|
|
147
|
+
<button
|
|
148
|
+
key={entry.path}
|
|
149
|
+
data-index={i}
|
|
150
|
+
onClick={() => {
|
|
151
|
+
void loadDir(entry.path, filter)
|
|
152
|
+
}}
|
|
153
|
+
onMouseEnter={() => setSelectedIndex(i)}
|
|
154
|
+
className={`w-full flex items-center gap-3 px-3 py-2 text-left transition-colors ${
|
|
155
|
+
selectedIndex === i ? 'bg-[var(--color-surface-hover)]' : 'hover:bg-[var(--color-surface-hover)]'
|
|
156
|
+
}`}
|
|
157
|
+
>
|
|
158
|
+
<span className="material-symbols-outlined text-[16px] text-[var(--color-brand)]">folder</span>
|
|
159
|
+
<span className="text-sm text-[var(--color-text-primary)] truncate">{entry.name}</span>
|
|
160
|
+
</button>
|
|
161
|
+
))}
|
|
162
|
+
|
|
163
|
+
{/* Files */}
|
|
164
|
+
{files.map((entry, i) => {
|
|
165
|
+
const idx = dirs.length + i
|
|
166
|
+
return (
|
|
167
|
+
<button
|
|
168
|
+
key={entry.path}
|
|
169
|
+
data-index={idx}
|
|
170
|
+
onClick={() => onSelect(entry.path, entry.name)}
|
|
171
|
+
onMouseEnter={() => setSelectedIndex(idx)}
|
|
172
|
+
className={`w-full flex items-center gap-3 px-3 py-2 text-left transition-colors ${
|
|
173
|
+
selectedIndex === idx ? 'bg-[var(--color-surface-hover)]' : 'hover:bg-[var(--color-surface-hover)]'
|
|
174
|
+
}`}
|
|
175
|
+
>
|
|
176
|
+
<span className="material-symbols-outlined text-[16px] text-[var(--color-text-secondary)]">description</span>
|
|
177
|
+
<span className="text-sm text-[var(--color-text-primary)] truncate">{entry.name}</span>
|
|
178
|
+
</button>
|
|
179
|
+
)
|
|
180
|
+
})}
|
|
181
|
+
</>
|
|
182
|
+
)}
|
|
183
|
+
</div>
|
|
184
|
+
|
|
185
|
+
{/* Footer hint */}
|
|
186
|
+
<div className="flex items-center gap-1.5 border-t border-[var(--color-border)] px-3 py-1.5 text-[10px] text-[var(--color-text-tertiary)]">
|
|
187
|
+
<kbd className="rounded border border-[var(--color-border)] bg-[var(--color-surface-container-low)] px-1 py-0.5 font-mono">↑↓</kbd>
|
|
188
|
+
<span>{t('fileSearch.navigate')}</span>
|
|
189
|
+
<kbd className="ml-2 rounded border border-[var(--color-border)] bg-[var(--color-surface-container-low)] px-1 py-0.5 font-mono">Enter</kbd>
|
|
190
|
+
<span>{t('fileSearch.attach')}</span>
|
|
191
|
+
<kbd className="ml-2 rounded border border-[var(--color-border)] bg-[var(--color-surface-container-low)] px-1 py-0.5 font-mono">Esc</kbd>
|
|
192
|
+
<span>{t('fileSearch.close')}</span>
|
|
193
|
+
</div>
|
|
194
|
+
</div>
|
|
195
|
+
)
|
|
196
|
+
})
|
|
197
|
+
|
|
198
|
+
FileSearchMenu.displayName = 'FileSearchMenu'
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { useEffect } from 'react'
|
|
2
|
+
import { Modal } from '../shared/Modal'
|
|
3
|
+
|
|
4
|
+
type GalleryImage = {
|
|
5
|
+
src: string
|
|
6
|
+
name: string
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
type Props = {
|
|
10
|
+
open: boolean
|
|
11
|
+
images: GalleryImage[]
|
|
12
|
+
activeIndex: number
|
|
13
|
+
onClose: () => void
|
|
14
|
+
onSelect: (index: number) => void
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function ImageGalleryModal({ open, images, activeIndex, onClose, onSelect }: Props) {
|
|
18
|
+
const activeImage = images[activeIndex]
|
|
19
|
+
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
if (!open || images.length <= 1) return
|
|
22
|
+
const handleKeyDown = (event: KeyboardEvent) => {
|
|
23
|
+
if (event.key === 'ArrowLeft') {
|
|
24
|
+
event.preventDefault()
|
|
25
|
+
onSelect((activeIndex - 1 + images.length) % images.length)
|
|
26
|
+
} else if (event.key === 'ArrowRight') {
|
|
27
|
+
event.preventDefault()
|
|
28
|
+
onSelect((activeIndex + 1) % images.length)
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
document.addEventListener('keydown', handleKeyDown)
|
|
32
|
+
return () => document.removeEventListener('keydown', handleKeyDown)
|
|
33
|
+
}, [activeIndex, images.length, onSelect, open])
|
|
34
|
+
|
|
35
|
+
if (!activeImage) return null
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<Modal open={open} onClose={onClose} width={960}>
|
|
39
|
+
<div className="space-y-4">
|
|
40
|
+
<div className="flex items-center justify-between gap-4">
|
|
41
|
+
<div className="min-w-0">
|
|
42
|
+
<div className="text-sm font-semibold text-[var(--color-text-primary)]">{activeImage.name}</div>
|
|
43
|
+
<div className="text-xs text-[var(--color-text-tertiary)]">
|
|
44
|
+
{activeIndex + 1} / {images.length}
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
{images.length > 1 && (
|
|
48
|
+
<div className="flex items-center gap-2">
|
|
49
|
+
<button
|
|
50
|
+
onClick={() => onSelect((activeIndex - 1 + images.length) % images.length)}
|
|
51
|
+
className="flex h-9 w-9 items-center justify-center rounded-full border border-[var(--color-border)] text-[var(--color-text-secondary)] transition-colors hover:bg-[var(--color-surface-hover)]"
|
|
52
|
+
aria-label="Previous image"
|
|
53
|
+
>
|
|
54
|
+
<span className="material-symbols-outlined text-[18px]">chevron_left</span>
|
|
55
|
+
</button>
|
|
56
|
+
<button
|
|
57
|
+
onClick={() => onSelect((activeIndex + 1) % images.length)}
|
|
58
|
+
className="flex h-9 w-9 items-center justify-center rounded-full border border-[var(--color-border)] text-[var(--color-text-secondary)] transition-colors hover:bg-[var(--color-surface-hover)]"
|
|
59
|
+
aria-label="Next image"
|
|
60
|
+
>
|
|
61
|
+
<span className="material-symbols-outlined text-[18px]">chevron_right</span>
|
|
62
|
+
</button>
|
|
63
|
+
</div>
|
|
64
|
+
)}
|
|
65
|
+
</div>
|
|
66
|
+
|
|
67
|
+
<div className="flex max-h-[70vh] items-center justify-center overflow-hidden rounded-2xl bg-[#111]">
|
|
68
|
+
<img src={activeImage.src} alt={activeImage.name} className="max-h-[70vh] w-full object-contain" />
|
|
69
|
+
</div>
|
|
70
|
+
|
|
71
|
+
{images.length > 1 && (
|
|
72
|
+
<div className="flex gap-2 overflow-x-auto pb-1">
|
|
73
|
+
{images.map((image, index) => (
|
|
74
|
+
<button
|
|
75
|
+
key={`${image.name}-${index}`}
|
|
76
|
+
onClick={() => onSelect(index)}
|
|
77
|
+
className={`overflow-hidden rounded-xl border transition-all ${
|
|
78
|
+
index === activeIndex
|
|
79
|
+
? 'border-[var(--color-brand)] shadow-[0_0_0_1px_var(--color-brand)]'
|
|
80
|
+
: 'border-[var(--color-border)]'
|
|
81
|
+
}`}
|
|
82
|
+
>
|
|
83
|
+
<img src={image.src} alt={image.name} className="h-16 w-16 object-cover" />
|
|
84
|
+
</button>
|
|
85
|
+
))}
|
|
86
|
+
</div>
|
|
87
|
+
)}
|
|
88
|
+
</div>
|
|
89
|
+
</Modal>
|
|
90
|
+
)
|
|
91
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { useMemo, useState } from 'react'
|
|
2
|
+
import { ImageGalleryModal } from './ImageGalleryModal'
|
|
3
|
+
import { getBaseUrl } from '../../api/client'
|
|
4
|
+
|
|
5
|
+
const IMAGE_EXTENSIONS = /\.(png|jpe?g|gif|webp|svg|bmp|avif|ico)$/i
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Extracts absolute image file paths from text content.
|
|
9
|
+
* Matches paths like /Users/.../image.png, /tmp/output.jpg, etc.
|
|
10
|
+
*/
|
|
11
|
+
export function extractImagePaths(text: string): string[] {
|
|
12
|
+
// Match absolute paths ending with image extensions
|
|
13
|
+
// Handles paths that may be wrapped in backticks, quotes, or standalone
|
|
14
|
+
const regex = /(?:^|[\s`"'(])(\/?(?:[A-Za-z]:[\\/]|\/)[^\s`"')<>]+\.(?:png|jpe?g|gif|webp|svg|bmp|avif|ico))/gim
|
|
15
|
+
const paths: string[] = []
|
|
16
|
+
const seen = new Set<string>()
|
|
17
|
+
|
|
18
|
+
let match: RegExpExecArray | null
|
|
19
|
+
while ((match = regex.exec(text)) !== null) {
|
|
20
|
+
const p = match[1]!.trim()
|
|
21
|
+
if (!seen.has(p) && IMAGE_EXTENSIONS.test(p)) {
|
|
22
|
+
seen.add(p)
|
|
23
|
+
paths.push(p)
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return paths
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function fileUrl(filePath: string): string {
|
|
31
|
+
return `${getBaseUrl()}/api/filesystem/file?path=${encodeURIComponent(filePath)}`
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function fileName(filePath: string): string {
|
|
35
|
+
return filePath.split('/').pop() || filePath
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
type Props = {
|
|
39
|
+
text: string
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function InlineImageGallery({ text }: Props) {
|
|
43
|
+
const [activeIndex, setActiveIndex] = useState<number | null>(null)
|
|
44
|
+
|
|
45
|
+
const imagePaths = useMemo(() => extractImagePaths(text), [text])
|
|
46
|
+
|
|
47
|
+
const images = useMemo(
|
|
48
|
+
() => imagePaths.map((p) => ({ src: fileUrl(p), name: fileName(p) })),
|
|
49
|
+
[imagePaths],
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
if (images.length === 0) return null
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<>
|
|
56
|
+
<div className="mt-3 space-y-2">
|
|
57
|
+
<div className="flex items-center gap-1.5 text-[10px] font-semibold uppercase tracking-wider text-[var(--color-outline)]">
|
|
58
|
+
<span className="material-symbols-outlined text-[12px]">image</span>
|
|
59
|
+
{images.length === 1 ? '1 image' : `${images.length} images`}
|
|
60
|
+
</div>
|
|
61
|
+
<div className={`grid gap-2 ${images.length === 1 ? 'grid-cols-1' : 'grid-cols-2'}`}>
|
|
62
|
+
{images.map((img, i) => (
|
|
63
|
+
<button
|
|
64
|
+
key={img.src}
|
|
65
|
+
type="button"
|
|
66
|
+
onClick={() => setActiveIndex(i)}
|
|
67
|
+
className="group relative overflow-hidden rounded-xl border border-[var(--color-border)] bg-[var(--color-surface-container-low)] text-left shadow-sm transition-all hover:shadow-md hover:border-[var(--color-brand)]/40"
|
|
68
|
+
>
|
|
69
|
+
<img
|
|
70
|
+
src={img.src}
|
|
71
|
+
alt={img.name}
|
|
72
|
+
loading="lazy"
|
|
73
|
+
className="w-full object-cover"
|
|
74
|
+
style={{ maxHeight: images.length === 1 ? 400 : 240 }}
|
|
75
|
+
onError={(e) => {
|
|
76
|
+
// Hide broken images
|
|
77
|
+
(e.target as HTMLImageElement).closest('button')!.style.display = 'none'
|
|
78
|
+
}}
|
|
79
|
+
/>
|
|
80
|
+
<div className="absolute inset-0 flex items-center justify-center bg-black/0 opacity-0 transition-all group-hover:bg-black/20 group-hover:opacity-100">
|
|
81
|
+
<span className="material-symbols-outlined rounded-full bg-white/90 p-2 text-[20px] text-[var(--color-text-primary)] shadow-lg">
|
|
82
|
+
fullscreen
|
|
83
|
+
</span>
|
|
84
|
+
</div>
|
|
85
|
+
<div className="absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/60 to-transparent px-2.5 pb-2 pt-6">
|
|
86
|
+
<span className="text-[10px] font-medium text-white/90 drop-shadow-sm">
|
|
87
|
+
{img.name}
|
|
88
|
+
</span>
|
|
89
|
+
</div>
|
|
90
|
+
</button>
|
|
91
|
+
))}
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
|
|
95
|
+
{activeIndex !== null && activeIndex >= 0 && (
|
|
96
|
+
<ImageGalleryModal
|
|
97
|
+
open={activeIndex !== null}
|
|
98
|
+
images={images}
|
|
99
|
+
activeIndex={activeIndex}
|
|
100
|
+
onClose={() => setActiveIndex(null)}
|
|
101
|
+
onSelect={setActiveIndex}
|
|
102
|
+
/>
|
|
103
|
+
)}
|
|
104
|
+
</>
|
|
105
|
+
)
|
|
106
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { TaskSummaryItem } from '../../types/chat'
|
|
2
|
+
import { useTranslation } from '../../i18n'
|
|
3
|
+
|
|
4
|
+
const statusIcon: Record<TaskSummaryItem['status'], string> = {
|
|
5
|
+
pending: 'radio_button_unchecked',
|
|
6
|
+
in_progress: 'pending',
|
|
7
|
+
completed: 'check_circle',
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const statusColor: Record<TaskSummaryItem['status'], string> = {
|
|
11
|
+
pending: 'var(--color-text-tertiary)',
|
|
12
|
+
in_progress: 'var(--color-warning)',
|
|
13
|
+
completed: 'var(--color-success)',
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function InlineTaskSummary({ tasks }: { tasks: TaskSummaryItem[] }) {
|
|
17
|
+
const t = useTranslation()
|
|
18
|
+
const completed = tasks.filter((tk) => tk.status === 'completed').length
|
|
19
|
+
const total = tasks.length
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<div className="mb-3 rounded-[var(--radius-lg)] border border-[var(--color-outline-variant)]/40 bg-[var(--color-surface-container-lowest)] overflow-hidden">
|
|
23
|
+
<div className="flex items-center gap-3 px-4 py-2 bg-[var(--color-surface-container)]">
|
|
24
|
+
<div className="flex items-center justify-center w-5 h-5 rounded-[var(--radius-md)] bg-[var(--color-success)]/10">
|
|
25
|
+
<span className="material-symbols-outlined text-[13px] text-[var(--color-success)]" style={{ fontVariationSettings: "'FILL' 1" }}>
|
|
26
|
+
task_alt
|
|
27
|
+
</span>
|
|
28
|
+
</div>
|
|
29
|
+
<span className="text-xs font-semibold text-[var(--color-text-primary)]">
|
|
30
|
+
{t('tasks.completed')}
|
|
31
|
+
</span>
|
|
32
|
+
<span className="text-[10px] text-[var(--color-text-tertiary)] tabular-nums">
|
|
33
|
+
{completed}/{total}
|
|
34
|
+
</span>
|
|
35
|
+
</div>
|
|
36
|
+
<div className="px-4 py-2 flex flex-col gap-0.5">
|
|
37
|
+
{tasks.map((task) => (
|
|
38
|
+
<div key={task.id} className="flex items-center gap-2 py-1 px-1">
|
|
39
|
+
<span
|
|
40
|
+
className="material-symbols-outlined text-[14px] shrink-0"
|
|
41
|
+
style={{ color: statusColor[task.status], fontVariationSettings: "'FILL' 1" }}
|
|
42
|
+
>
|
|
43
|
+
{statusIcon[task.status]}
|
|
44
|
+
</span>
|
|
45
|
+
<span className="text-[10px] font-mono text-[var(--color-text-tertiary)]">
|
|
46
|
+
#{task.id}
|
|
47
|
+
</span>
|
|
48
|
+
<span className={`text-xs ${
|
|
49
|
+
task.status === 'completed'
|
|
50
|
+
? 'text-[var(--color-text-tertiary)] line-through'
|
|
51
|
+
: 'text-[var(--color-text-primary)]'
|
|
52
|
+
}`}>
|
|
53
|
+
{task.subject}
|
|
54
|
+
</span>
|
|
55
|
+
</div>
|
|
56
|
+
))}
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
)
|
|
60
|
+
}
|