101 Commits

Author SHA1 Message Date
程序员阿江(Relakkes)
f4dce4985d feat: parse pasted JSON to auto-fill provider form fields 2026-04-07 14:03:50 +08:00
程序员阿江(Relakkes)
b49a8b6c9b fix: show correct model name when custom provider is active
When a custom provider (e.g. MiniMax) is activated, settings.model still
contains the old Anthropic model ID. handleCurrentModel was returning this
raw ID as the model name instead of the provider's configured model.

Fix handleCurrentModel to use ANTHROPIC_MODEL from env (set by
syncToSettings when provider was activated) when no explicit model is
set. Also fix getRuntimeSettings to skip passing --model to CLI when a
provider is active and model is still the default — the CLI should read
ANTHROPIC_MODEL from env instead of receiving a wrong model ID override.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 13:51:05 +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)
56b4fe3585 Merge branch 'feat/provider-model-config' into main
Provider preset redesign:
- Preset-based providers (DeepSeek, ZhipuGLM, Kimi, MiniMax, Custom)
- Storage moved to ~/.claude/cc-haha/providers.json
- Full 6-key env sync to ~/.claude/settings.json (merge, not overwrite)
- Official provider card with one-click activation (clears env)
- Editable settings.json preview in provider form
- Remove redundant Model tab from Settings

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 12:28:37 +08:00
程序员阿江(Relakkes)
ed8114ce68 fix: official card at top, modal state reset on close, remove official from presets
- Official provider shown as fixed card in provider list (click to activate)
- Add Provider modal conditionally rendered — state resets on close (fixes API key leak)
- Remove official from preset chips (not applicable to Add flow)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 12:28:28 +08:00
程序员阿江(Relakkes)
1b190524e5 fix: official preset add button — write settings.json first, handle errors
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 12:12:22 +08:00
程序员阿江(Relakkes)
d3d3e0ce2a fix: show settings.json editor for all presets including official
- Official preset shows Name, Notes, and full settings.json editor
- Non-official presets show Base URL, API Key, Model Mapping, Test, plus settings.json
- Settings JSON re-loads when switching presets

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 12:09:31 +08:00
程序员阿江(Relakkes)
aac41964ba fix: update models API for new provider structure, widen dialog
- Replace getActiveProvider() calls with listProviders() + activeId lookup
- Convert ModelMapping to model list for API compatibility
- Widen provider form dialog from 600px to 720px

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 12:06:50 +08:00
程序员阿江(Relakkes)
d109759c9c feat: editable settings.json in provider form with JSON validation
- Load full ~/.claude/settings.json content, merge provider env vars
- Editable textarea replaces read-only preview
- Real-time JSON syntax validation, blocks submit on error
- On save, writes edited JSON to settings.json then saves provider
- Shows all existing settings (plugins, hooks, etc.) preserved

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 12:00:10 +08:00
程序员阿江(Relakkes)
2e92ba3116 fix: official preset in chips, model mapping always visible, settings.json preview
- Move Official to first preset chip instead of standalone card
- Show model mapping directly without collapsible
- Add settings.json preview showing the env vars that will be written
- Official preset shows "no config needed" message

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 11:54:11 +08:00
程序员阿江(Relakkes)
232f768750 feat: rewrite ProviderSettings UI — preset chips, official card, simplified form
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-07 11:28:39 +08:00
程序员阿江(Relakkes)
609ddd0ff5 refactor: rewrite frontend provider types, API client, and store for preset system
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-07 11:28:36 +08:00
程序员阿江(Relakkes)
e584df1d28 refactor: update provider API — presets endpoint, simplified activate, official route 2026-04-07 11:24:22 +08:00
程序员阿江(Relakkes)
747b45b14f refactor: rewrite providerService — cc-haha storage, full env sync, official clear 2026-04-07 11:23:59 +08:00
程序员阿江(Relakkes)
9806bef5ec refactor: rewrite provider types — simplified model mapping, preset-based structure 2026-04-07 11:23:24 +08:00
程序员阿江(Relakkes)
08cd15ed1b feat: add provider preset definitions (Official, DeepSeek, ZhipuGLM, Kimi, MiniMax, Custom)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-07 11:21:35 +08:00
程序员阿江(Relakkes)
468a2853e0 docs: add provider preset redesign implementation plan
7 tasks: presets config, backend types/service/API rewrite, frontend types/API/store/UI rewrite.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 11:17:10 +08:00
程序员阿江(Relakkes)
ec78c066f9 docs: add provider preset redesign spec
Preset-based provider configuration inspired by cc-switch.
Presets: Official, DeepSeek, ZhipuGLM, Kimi, MiniMax, Custom.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 11:11:34 +08:00
程序员阿江(Relakkes)
e9fa36ab86 refactor: remove Model tab, move effort level to General, fix test button in edit mode
- Remove redundant Model tab — model config is handled by Providers
- Move Effort Level control to General tab
- Fix Test Connection disabled in edit mode — use testProvider(id) when no new API key entered

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 10:54:44 +08:00
程序员阿江(Relakkes)
dca08d6f00 chore: untrack .omx, .playwright-mcp, desktop/dist — already in .gitignore
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 10:38:14 +08:00
程序员阿江(Relakkes)
58837589fb Merge branch 'docs/ui-clone-requirements' into main
Features merged:
- Provider management UI (CRUD, activation, connectivity test)
- CLI Tasks page with dependency graph visualization
- Scheduled task enhancements (model, permissionMode, folderPath)
- AskUserQuestion tab navigation and toggle selection
- Sidebar redesign with project filter and time-grouped sessions
- Markdown/code viewer rewrite (Prism + React)
- Streaming indicator with CLI status sync

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 10:38:01 +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)
454548207c chore: add .playwright-mcp, .omx, desktop/dist, e2e screenshots to .gitignore
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 10:07:00 +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)
da2be1f81b Merge branch 'worktree-feature-scheduled-tasks' into docs/ui-clone-requirements
Resolve PLAN.md conflict by keeping both plans: Provider management
system and Scheduled Tasks enhancement.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 01:48:03 +08:00
程序员阿江(Relakkes)
b1db66ac8c feat: add scheduled task edit UI, CronUpdateTool, wizard components and tests 2026-04-07 01:44:44 +08:00
程序员阿江(Relakkes)
bd658d98f6 Merge branch 'worktree-feature-model-config' into docs/ui-clone-requirements 2026-04-07 01:33:09 +08:00
程序员阿江(Relakkes)
985b1a8b7d feat: add Provider management system — multi-provider CRUD, activation, and connectivity test
Implement a full Provider management layer compatible with Claude Code's settings.json protocol.

- ProviderService: CRUD + activation + settings.json sync + HTTP connectivity test
- Provider REST API: 8 endpoints (list, get, create, update, delete, activate, test)
- API key masking in GET responses (sk-a****xyz)
- Models API refactored to read from active Provider dynamically
- 42 unit tests + 6 real-config integration tests, all passing

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-07 01:29:52 +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)
d601bbf968 docs: add sidebar redesign spec — project filter + time-grouped list
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-07 00:40:21 +08:00
程序员阿江(Relakkes)
767abfc233 fix: restore tool calls on page refresh — handle server type mapping
Server marks assistant messages with tool_use blocks as type='tool_use'
(not 'assistant'), and user messages with tool_result blocks as
type='tool_result' (not 'user'). mapHistoryMessagesToUiMessages now
handles both type variants when parsing content arrays, so tool calls
are properly restored after page refresh.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-06 23:26:29 +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)
5e71da88c3 fix: preserve intermediate text between tool calls, restore thinking blocks on refresh
Two bugs fixed:

1. Intermediate assistant text (e.g. "项目已经有 node_modules,直接启动") was
   lost between tool calls because content_start didn't flush streamingText.
   Now we flush accumulated text as assistant_text before switching to the
   next content block.

2. History reload (page refresh) now restores thinking blocks alongside
   tool_use, tool_result, and text blocks. Previously thinking blocks were
   intentionally dropped — now they're preserved for full conversation replay.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-06 23:01:37 +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)
941d8f0314 chore: add prism-react-renderer + react-diff-viewer-continued, remove highlight.js + diff
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 22:16:03 +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
程序员阿江(Relakkes)
52f00a95d6 fix: address Codex review findings — auth, cron CLI, workdir, model IDs
- Enforce auth on API/WS when non-localhost or SERVER_AUTH_REQUIRED=1
- Fix CronScheduler: add --verbose flag and correct stream-json message envelope
- Resolve session workdir from JSONL file instead of hardcoding process.cwd()
- Give Opus 4.6 1M a unique composite ID (claude-opus-4-6-20250610:1m)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 15:21:55 +08:00