29 Commits

Author SHA1 Message Date
程序员阿江(Relakkes)
a2bf92079b feat: add i18n support with English and Chinese locales
Add a lightweight custom i18n system supporting English (default)
and Chinese, with a language switcher in Settings > General.
All 35+ UI components internationalized with ~270 translation keys,
including 189 Chinese spinner verbs and server error code mapping.
2026-04-07 22:18:16 +08:00
程序员阿江(Relakkes)
602c61ad4c feat: redesign scheduled task dialog to match Claude Code original
Refactor PermissionModeSelector and ModelSelector to support controlled
(prop-driven) mode alongside the existing store-driven mode, enabling
reuse in the new task creation dialog. Rewrite NewTaskModal with embedded
prompt editor that combines textarea + permission/model/folder controls,
matching Claude's original design. Add desktop-online warning banner on
the scheduled tasks list page and default folder to current session workDir.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 21:56:23 +08:00
程序员阿江(Relakkes)
f81fe41797 feat: migrate code blocks to shiki for VS Code-quality syntax highlighting
Replace prism-react-renderer with shiki/react-shiki in CodeViewer for
dramatically better tokenization (50+ TextMate scopes vs ~15 Prism tokens).
Custom warm-code theme with improved comment contrast (#5C6B7A, ~5:1 ratio)
and warm off-white background (#FDFCF9). Update DiffViewer to use matching
warm color palette with CSS variables instead of hardcoded GitHub colors.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 21:24:14 +08:00
程序员阿江(Relakkes)
ad4ba88a62 feat: add @-triggered file search popup with directory navigation
- Input @ in composer to open file search popup showing project root
- Filter files/directories by typing, navigate with keyboard or mouse
- Click directory to enter subdirectory, type / to navigate deeper
- Enter selects item and inserts path text at cursor, popup closes
- Parse filter path (e.g. @src/components/) to auto-navigate and search
- Desktop: filesystem browse/search API supports includeFiles and search
- Web: directory tree browser with real-time search filtering
2026-04-07 19:05:01 +08:00
程序员阿江(Relakkes)
da3d51b006 fix: suppress sticky TaskBar on page refresh when tasks already dismissed
When all tasks were completed and the user continued chatting, the inline
task summary was shown correctly. But on page refresh, loadHistory and
fetchSessionTasks would re-populate the task store, making the sticky bar
reappear.

- Add completedAndDismissed flag to cliTaskStore
- Detect user messages after last task tool call in history (V1 + V2)
- SessionTaskBar skips render when allCompleted && completedAndDismissed
- refreshTasks/setTasksFromTodos reset the flag for new task activity
- Fix InlineTaskSummary width to match parent container

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-07 17:27:50 +08:00
程序员阿江(Relakkes)
7183cc85fe fix: enable task/plan display for WebApp sessions using TodoWrite
The CLI subprocess runs in --print (non-interactive) mode, which disabled
V2 task tools (TaskCreate/TaskUpdate). Only TodoWrite was available, but
the frontend only tracked V2 tool names for task refresh — so the Tasks
bar never appeared for new WebApp sessions.

Changes:
- Set CLAUDE_CODE_ENABLE_TASKS=1 in CLI subprocess env to enable V2 tasks
- Add TodoWrite to TASK_TOOL_NAMES for backward compat with V1 sessions
- Parse TodoWrite input.todos directly into TaskBar state (no disk read)
- Extract last TodoWrite from history on session load for V1 sessions
- Inline completed task summary into message flow when user continues chat
  (sticky TaskBar converts to scrollable inline summary)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-07 17:12:05 +08:00
程序员阿江(Relakkes)
a3e58064cc feat: add confirmation dialog when enabling bypass permissions
Shows a warning dialog with the current working directory and a list
of granted capabilities before enabling bypass mode. Dialog is
centered in the content area with a full-screen backdrop.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 16:37:24 +08:00
程序员阿江(Relakkes)
0d71d8acb6 feat: use native folder dialog in Tauri, keep directory tree for web
DirectoryPicker now detects runtime environment:
- Tauri desktop: opens native OS folder picker via @tauri-apps/plugin-dialog
- Web browser: falls back to backend API directory tree browser

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 16:28:08 +08:00
程序员阿江(Relakkes)
f9c42c3b40 feat: Tauri desktop app with sidecar, brand identity, and CORS fix
- Add Tauri sidecar architecture: Rust shell spawns claude-server binary,
  dynamic port allocation, health-check wait loop, graceful shutdown
- Fix CORS middleware to accept `tauri://localhost` and `https://tauri.localhost`
  origins from Tauri WebView, and add CORS headers to /health endpoint
- Enable native macOS window decorations (traffic lights) with Overlay title bar,
  add data-tauri-drag-region on sidebar for window dragging
- Conditionally apply desktop-only padding (44px for traffic lights) vs web (12px)
- Generate brand identity: light-background app icon, horizontal logo, full icon
  set (icns/ico/png) for Tauri bundle
- Add brand mark + GitHub link in sidebar, replace mascot SVG with app icon
  in EmptySession page
- Update README (zh/en) and docs hero image with new branding
- Add sidecar build scripts and launcher entry points
- Gitignore Rust target/, Tauri gen/, and brand-assets candidates

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-07 16:07:38 +08:00
程序员阿江(Relakkes)
9b74e064c7 refactor: move task tracking from standalone page into session bottom bar
Remove the separate Tasks sidebar page (wrong concept — was showing
scheduled tasks). Instead, display CLI task progress as a sticky bar
at the bottom of the active session, matching the official desktop app
behavior. Tasks are refreshed in real-time by detecting TaskCreate/
TaskUpdate tool_result messages over WebSocket.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 13:00:45 +08:00
程序员阿江(Relakkes)
06d766308f feat: optimize AskUserQuestion UI with tab navigation and toggle selection
- Multi-question display uses horizontal tabs instead of vertical stack
- Options are toggleable (click to select, click again to deselect)
- Submit requires all questions answered or custom text provided
- Align card width with assistant message content (ml-10)
- Selected indicator uses filled checkmark instead of hollow radio

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 10:37:23 +08:00
程序员阿江(Relakkes)
d059a8b487 feat: add Provider management UI, CLI Tasks page, and enhance NewTaskModal
- Settings: new Providers tab with full CRUD, activation, and connectivity
  test; Model tab shows active provider name; General tab simplified
- Tasks: new CLI Tasks page displaying task lists from ~/.claude/tasks/
  with status, owner, and dependency (blocks/blockedBy) visualization
- NewTaskModal: add Advanced options (model, permission mode, working dir)
- Backend: fix TaskService to parse CLI V2 task format; extend /api/tasks
  with /lists endpoint for grouped queries
- Fix ModelInfo.context type from number to string

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 10:05:50 +08:00
程序员阿江(Relakkes)
5d908b2828 feat: redesign sidebar — project filter dropdown + time-grouped session list
Replace project-grouped session list with a flat time-grouped layout
(Today / Yesterday / Last 7 days / Last 30 days / Older) matching
the original Claude Code desktop design. Add ProjectFilter component
with multi-select dropdown for filtering by project. Deduplicate
sessions by ID in the store to fix duplicate-key React errors caused
by the same session appearing across multiple project directories.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 01:08:55 +08:00
程序员阿江(Relakkes)
5e4e7d3955 fix: soften error indicators in tool call groups — icon instead of red badge
- Replace "ERROR" text badge with material error icon (less visually jarring)
- Add "pending" icon when tool results haven't been matched yet
- Remove red border on error groups — all groups now use the same neutral border
- Single tool call ERROR badge also changed to icon

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-06 23:13:18 +08:00
程序员阿江(Relakkes)
83559ce7be feat: sync CLI status (verb, elapsed, tokens) to StreamingIndicator
- Store statusVerb from server 'status' WebSocket messages
- StreamingIndicator now shows the real CLI verb (Canoodling, Thinking, etc.)
  plus elapsed time and output token count
- Only show StreamingIndicator during tool_executing (not during thinking,
  where ThinkingBlock already provides feedback)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-06 22:49:33 +08:00
程序员阿江(Relakkes)
905d4216a5 fix: hide duplicate StreamingIndicator during thinking, fix plain text color in code blocks
- StreamingIndicator now only shows during 'tool_executing' state
  (ThinkingBlock already animates during 'thinking')
- Plain text code blocks force dark color (#24292f) instead of prism's
  default faded gray which was invisible on our beige background

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-06 22:45:07 +08:00
程序员阿江(Relakkes)
8cc38f6979 chore: delete highlightCode.ts, remove hljs CSS, fix test for new DiffViewer
- Deleted desktop/src/components/chat/highlightCode.ts (no longer needed)
- Removed all .hljs-* CSS rules from globals.css
- Updated chatBlocks test for react-diff-viewer-continued (doesn't render
  diff content in jsdom, so test verifies component mounting instead)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-06 22:29:52 +08:00
程序员阿江(Relakkes)
9dc0dbacad feat: rewrite MarkdownRenderer code blocks with React CodeViewer — no more HTML string templates
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 22:21:47 +08:00
程序员阿江(Relakkes)
e3714e9245 feat: rewrite DiffViewer with react-diff-viewer-continued — GitHub PR-style diffs
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 22:19:58 +08:00
程序员阿江(Relakkes)
b9a387406a feat: rewrite CodeViewer with prism-react-renderer — pure React rendering, GitHub theme
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 22:17:48 +08:00
程序员阿江(Relakkes)
3b83c9bd34 fix: disable hljs.highlightAuto for unknown languages, hide line numbers for plain text
- highlightAuto was misdetecting plain text (file trees, command output) as
  code and applying wrong syntax colors (red keywords, green tags, etc.)
- Now only highlights when language is explicitly specified and known to hljs
- Code blocks without a specified language render as clean plain text
- Line numbers hidden for plain text blocks (only shown for actual code)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-06 21:55:00 +08:00
程序员阿江(Relakkes)
be9ae99793 fix: address code review findings — consistent px-3, rounded-lg, leading-[1.3]
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-06 21:41:48 +08:00
程序员阿江(Relakkes)
d25be78f0c fix: streamline AssistantMessage, ThinkingBlock, and StreamingIndicator — remove avatar, compact layout
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 21:38:14 +08:00
程序员阿江(Relakkes)
001994d0bd feat: group consecutive tool calls into collapsible summaries in MessageList
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 21:36:39 +08:00
程序员阿江(Relakkes)
458945da52 feat: add ToolCallGroup + compact ToolCallBlock for collapsible tool summaries
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 21:35:04 +08:00
程序员阿江(Relakkes)
defa72292e fix: sync markdown code blocks with CodeViewer compact styles
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 21:32:41 +08:00
程序员阿江(Relakkes)
7ed1c920cc fix: compact diff viewer — tighter rows, gutter indicators, softer borders
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 21:31:40 +08:00
程序员阿江(Relakkes)
cc9fe832c2 fix: compact code block rendering — tighter line height, softer borders
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 21:30:34 +08:00
程序员阿江(Relakkes)
993b96cd39 Stabilize the desktop transcript so long agent sessions stay readable
The desktop app now keeps the composer stable while turns are active,
reduces low-signal tool noise in the transcript, restores project context
under the composer after session creation, and relies on the CLI's own
permission requests instead of injecting broader desktop-side Bash asks.

This also brings in the supporting desktop app source tree and the server
routes/session metadata needed for git info, filesystem browsing, session
resume, slash commands, and SDK-backed permission bridging so the UI can
operate as a coherent feature instead of a partial patch.

Constraint: Desktop transcript needs to stay usable during long multi-tool sessions without hiding file-change diffs
Constraint: Permission prompts must mirror CLI behavior closely enough that read-only commands do not get desktop-only prompts
Rejected: Keep rendering Read/Bash bodies inline | too noisy and unlike the intended transcript model
Rejected: Commit only the touched desktop files | would leave the newly introduced desktop app incomplete in git history
Confidence: medium
Scope-risk: broad
Reversibility: messy
Directive: Treat non-writing tools as summary-first transcript events; do not re-expand them by default without validating the UX against long sessions
Tested: cd desktop && bun run lint
Tested: cd desktop && bun run test -- --run
Tested: bun test src/server/__tests__/conversations.test.ts
Not-tested: Manual visual regression against the exact screenshots in a live desktop session
Not-tested: Full root TypeScript check (repository still has unrelated extracted-native parse failures)
2026-04-06 20:37:44 +08:00