Commit Graph

320 Commits

Author SHA1 Message Date
yushen
ca63ccda9b chore: bump version to 0.1.7 v0.1.7 desktop-v0.1.7 2026-02-05 12:10:07 +08:00
LinYushen
ab90c8330a Merge pull request #134 from multica-ai/dev
fix: resolve duplicate user message in UI after focus sync
2026-02-05 11:51:01 +08:00
yushen
9692fb2bc4 Merge remote-tracking branch 'origin/main' into dev 2026-02-05 11:49:38 +08:00
LinYushen
b1b0b78246 Merge pull request #133 from multica-ai/feat/local-build
feat: add local build script for unsigned macOS .app
2026-02-05 11:28:56 +08:00
yushen
0020c64d0b fix: clean dist directory before local build
Ensures a fresh build by removing the dist directory before starting,
preventing stale artifacts from previous builds.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 11:28:03 +08:00
yushen
d4c1790bda fix: allow typing spaces in session rename input
The @dnd-kit KeyboardSensor intercepts the Space key globally to
activate drag-and-drop, preventing spaces from being typed in the
session rename input field. Use a custom KeyboardSensor that skips
activation when the event target is an input, textarea, or
contenteditable element.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 17:37:14 +08:00
yushen
19a556359e feat: add local build script for unsigned macOS .app
Add a convenience script to build unsigned, unnotarized macOS .app
for local development and personal use.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 17:32:28 +08:00
LinYushen
f89ef13908 Merge pull request #132 from multica-ai/fix/duplicate-user-message
fix: resolve duplicate user message in UI after focus sync
2026-02-04 16:55:47 +08:00
yushen
0a1cf3c87c fix: resolve duplicate user message in UI after focus sync
The optimistic user_message update was missing `_internal: false`,
causing mergeSessionUpdates to fail deduplication when the DB version
(which includes `_internal: false`) arrived via focus sync or session
reload. Both copies survived the merge, showing two identical messages.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 16:49:29 +08:00
LinYushen
b92e1aef9a Merge pull request #130 from multica-ai/dev
Dev
2026-02-04 15:03:28 +08:00
yushen
149742e5cf Merge remote-tracking branch 'origin/main' into dev 2026-02-04 15:00:24 +08:00
LinYushen
3b0ef79cdf fix: resolve AI response not rendering after long idle/sleep (#129)
* fix: resolve AI response not rendering after long idle/sleep

- Add backgroundThrottling: false to prevent Chromium from throttling
  the renderer process when the window is in the background
- Add powerMonitor.on('resume') to send APP_FOCUS event after system
  wake, triggering DB sync to recover any missed IPC messages
- Re-sync session updates from DB on app focus to capture messages
  lost during sleep/wake or background throttling
- Guard async DB sync with currentSessionIdRef check to prevent
  race condition when user switches sessions during the async call

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix: dedupe focus resync logs

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 14:51:38 +08:00
Jiayuan
bfad56fbf6 fix(MUL-76): add --force to npm install commands to handle partial installs (#125)
When a user already has @openai/codex installed but not @zed-industries/codex-acp,
npm install fails with EEXIST error because the codex binary already exists.

Adding --force flag allows npm to overwrite existing files and continue
installing the missing packages.

Fixes MUL-76
2026-01-27 16:22:30 +08:00
Jiayuan
575e640758 refactor(#121): Phase 2 - Split useApp.ts and extract groupUpdatesIntoMessages (#124)
Split monolithic useApp.ts (953 lines) into focused hooks:
- useProjects.ts (131 lines) - Project CRUD, reordering
- useSessions.ts (325 lines) - Session CRUD, selection, state
- useAgentStatus.ts (248 lines) - Running/processing state, agent actions
- useAppSubscriptions.ts (254 lines) - IPC event handlers
- useApp.ts (316 lines) - Composition layer combining hooks

Extract groupUpdatesIntoMessages from ChatView.tsx:
- ChatView.tsx reduced from ~1028 to 644 lines
- messageGrouping.ts (456 lines) - Pure utility for message grouping
- sessionUpdates.ts (78 lines) - Session update merge utility

Maintains same external interface from useApp.ts - no breaking changes.
All 367 tests pass.
2026-01-27 16:21:52 +08:00
Jiayuan
82cac79897 fix(#121): Phase 1 - Deprecate SessionStore.ts and add tests for AgentProcess/AcpClientFactory (#123)
* fix(#121): Phase 1 - Deprecate SessionStore.ts and add tests for AgentProcess/AcpClientFactory

Phase 1 of Karpathy Guidelines refactor (Issue #121):

1. Deprecated SessionStore.ts (legacy file-based storage)
   - Added deprecation notices to class and module
   - Documented that DatabaseStore.ts is the replacement
   - Updated exports in index.ts with deprecation warning

2. Added comprehensive tests for AgentProcess.ts
   - Tests for start/stop lifecycle
   - Tests for stdin/stdout web stream conversion
   - Tests for exit callbacks and PID tracking
   - Coverage: 98.03%

3. Added comprehensive tests for AcpClientFactory.ts
   - Tests for sessionUpdate handling (all update types)
   - Tests for mode/commands update callbacks
   - Tests for permission request handling
   - Tests for error handling and null sessionStore
   - Coverage: 100%

Test coverage increased from 49.3% to 53.15%, now above CI threshold.

* fix: add return type to createMockProcess to satisfy ESLint
2026-01-27 15:42:09 +08:00
Jiayuan
5c4b9d6941 Merge pull request #122 from multica-ai/dev
Dev
2026-01-27 12:21:18 +08:00
Jiayuan
6db3a041a2 chore: add karpathy skills 2026-01-27 12:09:28 +08:00
Naiyuan Qing
2203b71652 Merge pull request #120 from multica-ai/feat/agent-state-sync-and-default-mode
feat: Agent state sync and default mode configuration
2026-01-26 18:50:52 +08:00
Naiyuan Qing
8be4cdb4c3 refactor: improve React patterns and fix edge cases
AgentModelSelector:
- Move state reset from useEffect to event handler (React best practice)
- Reset highlight index when search query changes

ModeSelector:
- Don't capture Shift+Tab in input/textarea/contenteditable elements
- Preserves accessibility for reverse tab navigation

Settings:
- Use Promise.allSettled for version checks before clearing loading state
- Use queueMicrotask to defer async operations in useEffect
- Consolidate cleanup logic in handleOpenChange

agentStore:
- Fix isAgentInstalled to return false for unknown agents
- Add error logging for loadAgents failures
- Add comprehensive unit tests

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 18:48:30 +08:00
Naiyuan Qing
6703fc5dd0 fix: add fallback for default mode when creating sessions
When defaultModes[agentId] is undefined (user hasn't explicitly set),
use getDefaultModeForAgent() as fallback to ensure the agent's semantic
default mode is applied.

Also add debug logging for defaultAgentId persistence to help diagnose
any future issues.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 18:46:50 +08:00
Naiyuan Qing
6fb5c64267 feat: add agent state sync and default mode configuration
- Add agentStore for centralized agent state management
- Refresh agent state on app focus (detect external install/uninstall)
- Validate agent installation before switching
- Show warning UI when current agent is not installed
- Add default mode selection per agent in Settings
- Apply user's preferred mode when creating new sessions
- Extend MODE_CONFIG with agentIds, isDefault, and displayName
- Use parallel Promise.all for better performance
- Fix React Compiler warnings in useCallback/useMemo dependencies

Closes #119

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 18:00:30 +08:00
Naiyuan Qing
6edce73f5f Merge pull request #118 from multica-ai/feat/mode-selector-ux
feat: improve mode selector UX with semantic filtering and icons
2026-01-26 16:01:03 +08:00
Naiyuan Qing
3585b069a8 fix: remove unused SemanticType import in tests
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 15:59:02 +08:00
Naiyuan Qing
4f1110db67 test: add unit tests for mode-semantic module
Tests cover:
- filterVisibleModes() - visible/hidden/unknown modes
- getSemanticType() - semantic mapping for all agents
- isModeVisible() - visibility checks
- getModeConfig() - raw config access
- getNextModeId() - Shift+Tab cycling logic

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 15:59:02 +08:00
Naiyuan Qing
5c1ddfd310 feat: improve mode selector UX with semantic filtering and icons
Closes #110

- Add mode-semantic.ts for unified mode handling across agents
- Filter dangerous/internal modes (bypassPermissions, dontAsk, full-access)
- Add semantic icons and colors (plan, readonly, auto, default)
- Show mode descriptions in dropdown and tooltip
- Add global Shift+Tab shortcut to cycle modes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 15:59:02 +08:00
Jiayuan
2f801c337a Merge pull request #116 from multica-ai/forrestchang/list-shortcuts
refactor: remove sidebar Cmd+B keyboard shortcut
2026-01-25 21:02:49 +08:00
Jiayuan
8146c292d0 refactor: remove sidebar Cmd+B keyboard shortcut
Remove the local keyboard shortcut handler from the sidebar component. This functionality can be managed at a higher level through a centralized shortcut system.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-01-25 20:58:38 +08:00
yushen
8e4de4722a chore: bump version to 0.1.6 desktop-v0.1.6 v0.1.6 2026-01-25 10:43:53 +08:00
Jiayuan
6c6be7eb5b Merge pull request #103 from multica-ai/dev
Dev
2026-01-24 17:25:40 +08:00
LinYushen
e203f2099b feat: auto-generate session titles and support manual title editing (#115)
- Add TitleGenerator module to generate session titles using Agent CLI
  - Support claude-code, opencode, and codex agents
  - Fire-and-forget async generation on first user message
  - Prevent concurrent generation with in-flight tracking
  - Re-check before update to avoid overwriting manual titles

- Add double-click to edit session title in sidebar
  - Inline editing with Enter to save, Escape to cancel
  - Blur saves by default, but respects Escape cancellation
  - Persist title changes to database

- Add SESSION_UPDATE IPC channel for title updates
- Add SESSION_META_UPDATED event for real-time UI sync
- Add comprehensive unit tests for new functionality

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 19:20:29 +08:00
Naiyuan Qing
edfe8c4c7a Merge pull request #114 from multica-ai/feat/issue-113-plan-approval-ui
feat: Add PlanApprovalUI for ExitPlanMode tool
2026-01-23 18:53:58 +08:00
Naiyuan Qing
2bc5cbabb2 feat: Add PlanApprovalUI for ExitPlanMode tool
- Add isPlanApprovalTool() detection function in tool-names.ts
- Create PlanApprovalUI component with markdown rendering
- Smart option categorization (approve/deny buttons)
- Defensive error handling for missing plan content
- Route ExitPlanMode requests to new UI in PermissionRequestItem
- Replace Circle icons with appropriate icons (Wrench, ClipboardCheck)

Closes #113

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 18:51:44 +08:00
Bohan Jiang
ab5ce575d1 fix: slash command not triggering in multiline input (#112)
The slash command menu only detected `/` at the start of the entire
input text. Now it detects `/` at the start of the current line where
the cursor is positioned, enabling slash commands to work in multiline
input.

Changes:
- Track cursor position in MessageInput to extract current line
- Parse slash command from current line at cursor instead of full input
- Update handleCommandSelect to replace only the current line's command
- Add onSelect handler to track cursor movement
- Update regex in parseSlashCommand to support multiline arguments
- Add unit tests for multiline slash command scenarios

Closes #109

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 18:14:59 +08:00
Jiayuan
2dfc6dfc80 Merge pull request #107 from multica-ai/forrestchang/check-ci-config
ci: enable CI for pull requests to dev branch
2026-01-23 16:20:42 +08:00
Bohan Jiang
53c9a63c7c fix: ACP error handling - proper serialization and agent recovery (#108)
Two fixes for ACP error handling:

1. Fix error serialization in parseAcpError(): Plain object errors (e.g.,
   { code: -32603, message: '...' }) were converted via String() which
   returns "[object Object]". Now properly extracts message property or
   uses JSON.stringify() as fallback.

2. Stop broken agent process on error: When an ACP protocol error occurs
   (e.g., "only prompt commands are supported in streaming mode"), the
   agent connection enters a stuck state. Now calls agentProcessManager.stop()
   so the next request starts a fresh agent process instead of repeating
   the same error.

Closes #105

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 16:19:53 +08:00
Jiayuan
bed7097e12 fix: disable eslint warning for React import in test
React import is required for JSX but eslint flags it as unused.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-01-23 16:17:59 +08:00
Jiayuan
0833a6e972 fix: CI test failures
- Add React import back in FileTreeComponent.test.tsx (required for JSX)
- Fix isValidPath to recognize Windows paths on non-Windows platforms

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-01-23 16:15:15 +08:00
Jiayuan
58817b651f fix: remove unused React import in FileTreeComponent test
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-01-23 16:10:34 +08:00
Jiayuan
98ba6cba31 ci: enable CI for pull requests to dev branch
Add dev branch to the pull_request trigger so that CI runs on PRs to dev, matching the configuration for main branch.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-01-23 16:08:17 +08:00
Jiayuan
edcbe7ceff Merge pull request #106 from multica-ai/forrestchang/fix-readme-naming
Standardize Chinese README naming to use script codes
2026-01-23 16:06:51 +08:00
Jiayuan
f747913478 Standardize Chinese README naming to use script codes
Rename README files from region codes (zh-CN, zh-TW) to standard script codes (zh-Hans for simplified Chinese, zh-Hant for traditional Chinese) following BCP 47 standards. Update all navigation links across all language-specific README files.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-01-23 16:05:52 +08:00
Naiyuan Qing
ee5d263913 Merge pull request #101 from multica-ai/feat/optimize-message-timer
fix: optimize MessageTimer display during long pauses
2026-01-23 15:42:20 +08:00
Jiayuan
5b8d1abbb6 Merge pull request #97 from multica-ai/forrestchang/ui-redesign
feat: redesign UI with Project -> Session hierarchy
2026-01-23 15:40:15 +08:00
Jiayuan
86d092afcd feat: add session archive functionality
Replace session delete with archive (soft delete):
- Add isArchived field to MulticaSession type
- Add archive/unarchive/listArchived methods to DatabaseStore
- Add IPC channels and handlers for archive operations
- Update Conductor with archive methods

UI changes:
- Change session delete button to archive icon
- Add "..." menu on project row with dropdown menu
- Add "View Archived Sessions" option in dropdown
- Add ArchiveSessionModal for confirming archive
- Add ArchivedSessionsModal for viewing/restoring archived sessions
- Users can restore archived sessions from the modal

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 15:37:07 +08:00
LinYushen
1e823a2001 Merge pull request #102 from multica-ai/main
main to dev
2026-01-23 15:34:53 +08:00
Naiyuan Qing
45758b5d91 fix: optimize MessageTimer display during long pauses
- Add LiveTimer component with event-driven updates + timeout projection
- Track lastEventTimestamp in ChatView for accurate pause detection
- Project time forward after 500ms of no events (variable 80-180ms interval)
- Immediately sync to accurate value when events resume
- Change formatDuration to 1 decimal place for cleaner display
- Remove debug console.log statements

Closes #100

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 15:33:15 +08:00
Naiyuan Qing
1241b8ed12 Merge pull request #99 from multica-ai/feat/markdown-syntax-highlighting
feat: Add syntax highlighting for code blocks in chat messages
2026-01-23 15:32:13 +08:00
Naiyuan Qing
aabedab72f feat: add syntax highlighting for code blocks
- Integrate Shiki for VS Code-quality syntax highlighting
- Add dark mode support with MutationObserver
- Implement LRU cache (200 entries) for performance
- Add streaming optimization with block-level memoization
- Auto-detect and linkify URLs and file paths
- Update CSP to allow WebAssembly for Shiki

Closes #98

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 15:28:07 +08:00
Jiayuan Zhang
962cce82d1 docs: fix DatabaseStore storage location comment
Correct the comment to accurately reflect that the database is stored
in ~/Library/Application Support/Multica/ (Electron userData), not
~/.multica/ which is only used as a fallback for tests.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 15:16:32 +08:00
Jiayuan Zhang
5956554fa6 feat: redesign UI with Project -> Session hierarchy
- Add SQLite storage using sql.js for Project and Session data
- Implement Project -> Session hierarchical structure in sidebar
- Add drag-and-drop reordering for projects
- Reduce sidebar padding for better space utilization
- Show session title in top bar, remove folder name/path/status
- Add delete confirmation modals for projects and sessions

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 15:11:45 +08:00