Commit graph

1581 commits

Author SHA1 Message Date
Naiyuan Qing
2ec3e4eb89 fix(subscribers): use composite key (user_id + user_type) in subscriber:removed WS handler
Consistent with subscriber:added handler. Prevents removing a member subscriber
when an agent with the same UUID is unsubscribed (or vice versa).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 21:07:48 +08:00
Naiyuan Qing
f410799ab5 fix(subscribers): prevent duplicate subscriber entries from optimistic update + WS race
When subscribing, both the optimistic setSubscribers and the WS subscriber:added
event could add the same entry. Now both paths check for existing entries using
(user_id + user_type) composite key before appending.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 20:59:35 +08:00
Naiyuan Qing
8a96aa698c fix(subscribers): deduplicate members list in subscriber popover
Members array from workspace store can contain duplicate user_ids (e.g. user
added to workspace twice). Filter by unique user_id before rendering to prevent
React duplicate key warnings.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 20:57:41 +08:00
Naiyuan Qing
b8fa71462a fix(subscribers): pass user_type to subscribe/unsubscribe API for correct agent handling
Root cause: backend hardcoded UserType="member" in subscribe/unsubscribe handlers,
so unsubscribing an agent actually tried to delete a member record (no-op), and
the WS event broadcast wrong user_type causing other subscribers' UI to break.

- Backend: accept optional user_type in subscribe/unsubscribe request body
- Frontend: pass userType through API client to backend
- Fixes: clicking agent checkbox no longer affects member subscriptions

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 20:56:37 +08:00
Naiyuan Qing
df6f6584c3 fix(subscribers): fix duplicate key error, add agents to subscriber popover
- Fix duplicate React key by using composite key (type-id) for avatars and command items
- Add Agents section to subscriber Command popover (members + agents both selectable)
- Fix subscriber matching to use both user_type and user_id (prevents cross-type collisions)
- Add max-h-64 to CommandList to prevent overflow
- toggleSubscriber now accepts userType parameter for proper agent support

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 20:51:50 +08:00
Naiyuan Qing
05c0471945 feat(subscribers): interactive subscriber management with AvatarGroup + Command popover
- Backend: subscribe/unsubscribe API now accepts optional user_id to manage other users
- Frontend: replace manual avatar stacking with shadcn AvatarGroup component
- Frontend: replace disabled-checkbox Popover with Command+Popover combo (Linear-style)
  - Search/filter workspace members
  - Click to toggle subscription (checkbox)
  - Shows reason badge (Assignee, Creator, etc.) for auto-subscribed users
- Clean up duplicate status_change type (keep only status_changed)
- All tests pass (Go + TypeScript)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 20:48:20 +08:00
Naiyuan Qing
ec188a36c9 refactor(issues): move subscribers UI from sidebar to Activity header (Linear-style)
Move subscriber controls from right sidebar to Activity section header:
- Left: "Activity" title, Right: "Subscribe/Unsubscribe" button + avatar stack
- Click avatar stack opens Popover showing all subscribers with checkboxes
- Non-subscribers shown dimmed in the popover list
- Stacked avatar display (overlapping, max 5 + count badge)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 20:36:50 +08:00
Naiyuan Qing
6a09714041 fix(inbox): add missing notification type labels for subscriber-driven notifications
Add new_comment, unassigned, assignee_changed, priority_changed, status_changed
to InboxItemType and typeLabels so inbox renders proper labels instead of raw
type strings.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 20:29:26 +08:00
Naiyuan Qing
5b9241b74f fix(notifications): address code review feedback
- Add comment explaining subscriber→notification listener registration order in main.go
- Add issue_status field to notifySubscribers and notifyDirect (fixes missing StatusIcon in inbox)
- Backfill existing commenters as subscribers in migration 016
- Add TODO comment for @mention duplicate notification prevention (deferred until @mention feature is enabled)
- Add context.Background() usage note for future bus-level timeout improvements
- Add toast error feedback on subscribe/unsubscribe failure

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 20:24:07 +08:00
Naiyuan Qing
bfe9498def feat(notifications): replace hardcoded inbox notifications with subscriber-driven model
Replace inbox_listeners.go with a subscriber-driven notification system:

- Add issue_subscriber table with auto-subscribe on create/assign/comment
- New subscriber_listeners.go: maintains subscriber data on domain events
- New notification_listeners.go: notifySubscribers (fanout to all subscribers
  minus actor) and notifyDirect (targeted, punches through unsubscribe)
- Subscriber API: list/subscribe/unsubscribe endpoints
- Frontend: subscribers section in issue detail sidebar with real-time sync
- Frontend: inbox notification grouping by (issue_id, type, actor_id)
- Remove createInboxForIssueCreator from task.go (unified through event bus)
- 21 new Go tests, all passing

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 19:33:20 +08:00
Naiyuan Qing
5fc03c61fe
Merge pull request #158 from multica-ai/forrestchang/theme-card-selector
feat(settings): visual theme preview card selector
2026-03-28 16:27:12 +08:00
Naiyuan Qing
6b93e3ba9c fix(tests): update issue page tests for new header and view store shape
- Add missing view-store mock fields (sortBy, sortDirection, cardProperties,
  listCollapsedStatuses, toggleListCollapsed) and exported constants
- Add SortableContext mock to @dnd-kit/sortable
- Fix filter button assertions (Status/Priority: All → Filter/Display)
- Fix issue detail test: use getAllByText for duplicate title text
- Fix breadcrumb test: workspace name shown instead of "Issues"

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 16:25:20 +08:00
Naiyuan Qing
572d033b95 feat(ui): comprehensive UI consistency fixes and list view accordion redesign
- Runtime page: add ResizablePanelGroup with persistent layout, fix scroll
- Agents page: replace hand-rolled dropdowns with shadcn Popover/DropdownMenu,
  remove redundant wrapper div, fix header height to h-12
- Skills page: widen create dialog to sm:max-w-md, stabilize tab height
- Settings: use variant="destructive" on AlertDialogAction instead of hardcoded className
- Issues list view: rewrite with base-ui Accordion grouped by status,
  show all statuses (including empty), add per-group create button,
  persist expand/collapse state, apply sort settings
- Issues header: show filtered issue count next to New Issue button
- Extract shared sortIssues utility from board-column for reuse
- Remove redundant StatusIcon from ListRow (already grouped by status)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 16:18:42 +08:00
Naiyuan Qing
1d08057dd8 feat(settings): replace theme buttons with visual preview card selector
Replace simple text buttons with macOS-style window preview cards for
Light/Dark/System theme selection, using pure CSS miniature window mockups.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 15:03:47 +08:00
Jiayuan Zhang
fd9d2e2290
Merge pull request #157 from multica-ai/forrestchang/kanban-redesign
feat(issues): redesign kanban board with drag sorting and display settings
2026-03-28 01:14:39 +08:00
Jiayuan
f050ab1ae2 feat(issues): add inline property editing on kanban cards and calendar date picker
- Add inline pickers on board cards for priority, assignee, and due date
- Add custom trigger prop to PriorityPicker, AssigneePicker, DueDatePicker for styling control
- Replace due date quick options with Calendar-based DueDatePicker in issue detail sidebar
- Use PickerWrapper to stop event propagation from pickers to Link/drag handlers

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-28 01:13:18 +08:00
Jiayuan Zhang
14ae1b9aff
Merge pull request #156 from multica-ai/forrestchang/agent-issue-flow
feat(daemon): inject skills into agent-native directories
2026-03-28 00:52:32 +08:00
Jiayuan
7cd9110628 feat(issues): redesign kanban board with drag sorting, filters, and display settings
- Redesign card layout: priority label, description line, subtle shadow, configurable properties
- Wider columns (280px) with rounded background, count badge, and card spacing
- Add SortableContext for within-column drag reordering with fractional position indexing
- Fix collision detection to prefer card targets over column droppables for reliable down-drag
- Add hidden columns panel on right side with show/hide toggle
- Consolidate header into Filter popover (status + priority) and Display popover (ordering + card properties)
- Auto-switch to manual sort when cards are dragged to preserve drag ordering

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-28 00:50:29 +08:00
Jiayuan
46144646c5 feat(daemon): inject skills into agent-native directories
Write skills to provider-native paths so agents discover them
automatically instead of relying on manual path references in
CLAUDE.md/AGENTS.md.

- Claude: write to {workDir}/.claude/skills/ (native discovery)
- Codex: write to per-task CODEX_HOME/skills/ with auth/config
  seeded from ~/.codex/ (symlink auth.json, copy config files)
- Fallback: keep .agent_context/skills/ for unknown providers

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-28 00:47:00 +08:00
Jiayuan Zhang
1b505c3a21
Merge pull request #155 from multica-ai/forrestchang/codex-token-parse
fix(daemon): fix Codex token usage parsing from session logs
2026-03-28 00:04:40 +08:00
Jiayuan
241acb3eac fix(daemon): fix Codex token usage parsing from session logs
The parser read `payload.msg` but Codex JSONL files store token data at
`payload.info`. Also adds model tracking from `turn_context` events,
`last_token_usage` fallback, and `cache_read_input_tokens` field support.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-28 00:03:47 +08:00
Jiayuan Zhang
e860691124
Merge pull request #154 from multica-ai/forrestchang/skills-tree-view
feat(skills): file-browser tree view with markdown preview
2026-03-27 23:57:28 +08:00
Jiayuan
8de700620d feat(skills): replace skill detail with file-browser tree view
Redesign the skill detail panel to use a directory tree + file viewer
layout, similar to a file browser. SKILL.md and supporting files are
shown in a collapsible tree on the left; selecting a file renders its
content on the right with markdown preview (including YAML frontmatter
parsing) and an edit toggle.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-27 23:54:32 +08:00
Jiayuan Zhang
88294fada6
Merge pull request #153 from multica-ai/forrestchang/skill-add-ux-review
feat(skills): improve import skill UX with source cards
2026-03-27 23:44:26 +08:00
Jiayuan
f4ff01210b feat(skills): improve import skill UX with source cards
Replace the subtle inline badge with two always-visible source cards
that show URL formats for ClawHub and Skills.sh, highlighting the
detected source as the user types. Import button now shows
source-specific loading text.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-27 23:42:08 +08:00
Jiayuan Zhang
6395a74661
Merge pull request #152 from multica-ai/forrestchang/paperclip-audit
Improve local CLI auth and skills UX
2026-03-27 18:43:52 +08:00
Jiayuan
ed426872cc Improve local CLI auth and skills UX 2026-03-27 18:32:56 +08:00
LinYushen
6d2a0b45d2
refactor: decouple task lifecycle from issue status (#151)
* refactor: decouple task lifecycle from issue status, add daemon health server

- Remove automatic issue status changes from StartTask (in_progress),
  CompleteTask (in_review), and FailTask (blocked) in task service.
  Issue status is now fully managed by the agent via `multica issue status`.
- Update agent prompt and meta skill to instruct agents to manage issue
  status themselves (in_progress → done/in_review/blocked).
- Add daemon health HTTP server on 127.0.0.1:19514 with /health endpoint
  exposing pid, uptime, agents, and workspaces. Fail fast if port is taken
  (another daemon already running).
- Update `multica status` to check both server and daemon health.
- Add Save button to repos section in workspace settings UI.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* refactor(daemon): simplify prompt, fix runtime config path, improve task error logging

- Slim down BuildPrompt to a minimal hint; detailed workflow now lives in CLAUDE.md/AGENTS.md
- Write CLAUDE.md to workDir root instead of .claude/CLAUDE.md
- Fix git-exclude pattern (.claude → CLAUDE.md)
- Decouple task queue reconciliation from issue status changes (agents manage status via CLI)
- Add diagnostic logging when CompleteTask/FailTask fail due to unexpected task state

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(task): use task_completed/task_failed inbox notification types

FailTask was sending "agent_blocked" which conflates agent crash with
issue-level blocked status. Align notification types with the new
decoupled model: task_completed and task_failed. Update frontend types
and labels accordingly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 18:30:21 +08:00
LinYushen
8bd476f47c
Merge pull request #150 from multica-ai/fix/pr-149-review-fixes
fix: address PR #149 review findings
2026-03-27 16:19:47 +08:00
yushen
4d8b2edb2d fix: address PR #149 review findings
- Replace custom contains/searchString with strings.Contains in tests
- Fix variable shadow (r -> reposJSON) in workspace handler
- Wire daemon auth token + server URL into spawned agent env vars
- Remove unused CreateAgentTaskWithContext query (dead code after refactor)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 16:15:58 +08:00
LinYushen
327973be08
Merge pull request #149 from multica-ai/feat/cli-issue-commands
feat(cli): add issue management commands
2026-03-27 16:12:03 +08:00
yushen
bae2926370 feat(web): add repos management UI to workspace settings
Add a Repositories section to workspace settings where admins can
add/remove GitHub repo URLs with descriptions. Agents use these repos
to clone and work on code.

- Add WorkspaceRepo type and export from shared/types
- Update API client updateWorkspace to accept repos
- Add repos section in workspace-tab.tsx with add/remove UI
- Fix test helpers to include repos field

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 16:05:54 +08:00
yushen
83111761db feat(workspace): add repos JSONB field for GitHub repository URLs
Add a `repos` JSONB column to the workspace table for storing
associated repository URLs and descriptions. This enables the daemon
to clone repos and set up git worktrees for agent task execution.

Structure: [{"url": "https://github.com/org/repo", "description": "..."}]

- Migration 014: adds repos column with default '[]'
- UpdateWorkspace query: supports updating repos
- Workspace API: returns repos in GET, accepts in PUT

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 15:49:30 +08:00
yushen
1deae2a1e9 refactor(daemon): remove context snapshot, let agent fetch data via CLI
Replace the frozen context snapshot pattern with a CLI-driven approach:
agents now use `multica` CLI commands to fetch issue details, comments,
and workspace context on demand, always getting the latest data.

- Remove buildContextSnapshot and snapshot generation from enqueue
- Claim endpoint now returns fresh agent name + skills from DB
- Daemon resolves provider from local runtimeIndex, not snapshot
- Prompt instructs agent to use `multica issue get` / `comment list`
- Meta skill (CLAUDE.md/AGENTS.md) documents all available CLI commands
- Skills still injected as filesystem files (static agent config)
- Simplify daemon types: remove TaskContext/IssueContext/RuntimeContext

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 15:31:22 +08:00
yushen
6733262a63 test(cli): add unit tests for issue command helpers
Tests for truncateID, formatAssignee, resolveAssignee (6 cases),
and validIssueStatuses.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 14:12:20 +08:00
yushen
673ba09baf fix(cli): rune-safe truncateID, consistent client construction, add --output to status cmd
- Make truncateID use rune counting instead of byte length for unicode safety
- Refactor workspaceGet and workspaceMembers to use newAPIClient helper
  for consistent server-URL validation
- Add --output flag to issueStatusCmd for JSON output support

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 14:12:16 +08:00
yushen
4a62b98c9a feat(cli): add workspace get and members commands
Expose workspace details (including context field) and member listing
via the CLI so agents can dynamically query workspace context instead
of relying on static snapshots.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 13:54:40 +08:00
yushen
daecf7985c fix(cli): propagate API errors in resolveAssignee and fix rune-safe truncation
- resolveAssignee now reports actual API errors instead of silently
  falling through to "not found" when both member/agent fetches fail
- Comment content truncation uses rune count for correct CJK handling
- Remove unnecessary _ = aType discard

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 13:38:11 +08:00
yushen
765ba8e380 feat(cli): add issue management commands
Add `multica issue` command group with subcommands for full issue
lifecycle management: list, get, create, update, assign, status,
and comment operations. Includes assignee resolution by name across
both workspace members and agents.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 12:33:53 +08:00
yushen
568b5f3a8f docs: update CLAUDE.md with logging, CI, and CLI details
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 12:33:38 +08:00
Jiayuan Zhang
da2f794a1b
Merge pull request #148 from multica-ai/forrestchang/rm-agent-skills
chore: remove .agents/skills directory
2026-03-27 03:35:10 +08:00
Jiayuan
e07e294623 chore: remove .agents/skills directory
Remove all Claude Code skills (ui-ux-pro-max, shadcn, frontend-design,
web-design-guidelines) from the .agents directory.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-27 03:34:21 +08:00
Jiayuan Zhang
7e74c7b18c
Merge pull request #147 from multica-ai/feat/add-claude-skills
feat: add Claude Code skills for UI/UX development
2026-03-27 00:42:07 +08:00
Jiayuan
acf9c625eb feat: add Claude Code skills for UI/UX development
Add four Claude Code skills to enhance frontend development workflow:
- frontend-design: production-grade frontend interfaces
- shadcn: shadcn/ui component management
- ui-ux-pro-max: comprehensive UI/UX design intelligence
- web-design-guidelines: Web Interface Guidelines compliance

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 00:40:16 +08:00
Jiayuan Zhang
a6e9bb1f61
Merge pull request #146 from multica-ai/forrestchang/rm-knowledge-base
Remove knowledge base module and fix worktree port conflicts
2026-03-26 21:00:10 +08:00
Jiayuan
c1fc5c7bca chore(web): remove knowledge base module and fix worktree port conflicts
Remove the frontend-only knowledge base page, sidebar nav entry, and
unused BookOpen import. Fix setup-worktree to always generate unique
ports via init-worktree-env.sh instead of skipping when .env.worktree
already exists with default ports.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-26 20:57:14 +08:00
Naiyuan Qing
88de467094
Merge pull request #145 from multica-ai/NevilleQingNY/rm-monorepo
Remove monorepo tooling, settings redesign, and UI improvements
2026-03-26 19:32:13 +08:00
Naiyuan Qing
488b41fc5e fix(test): update issues page test for empty state behavior change
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 19:30:59 +08:00
Naiyuan Qing
5696b78a26 fix(web): show empty board/list view when no issues match filters
Previously the entire view was replaced with "No matching issues" text.
Now the board columns or list view render even when empty.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 19:29:00 +08:00
Naiyuan Qing
46708e8948 fix(web): resolve duplicate tiptap Link extension warning
Disable Link in StarterKit since it's configured separately.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 19:27:30 +08:00