feat(ui): wire shared Kanban pilot into both apps via AutoCodeClient adapters (U1)#383
Conversation
…adapters (U1)
Completes the U1 pilot: libs/ui's KanbanBoard now renders real data in BOTH targets through per-app AutoCodeClient adapters — the ports-and-adapters seam is proven end to end.
Web (apps/web-frontend):
- api/autoCodeClient.ts: REST adapter over the existing ApiClient — maps TaskSummary onto UiTask (complete->done, in_progress->running, else draft; '3/7' progress -> percent; folder as canonical id), unit-tested against an injected source.
- pages/KanbanPilot.tsx at /kanban-next next to the legacy /kanban (page-by-page migration per the roadmap decision); card click navigates to /tasks/{id}; all strings via i18n (en+fr keys in tasks.json). Route-only on purpose: codegraph impact analysis showed the legacy web Sidebar's clicks don't navigate at all (its handleViewChange only highlights), so a nav item there would be dead — the legacy shell stays untouched until replacement.
Electron (apps/frontend):
- renderer/lib/autoCodeClient.ts: adapter over the live task store (IPC transport already behind it) — full status mapping (backlog/queue->draft, ai_review/human_review->review, error->review + badge, pr_created->done + badge), subtask-based progress, and real subscribeTasks via the zustand subscription so the board updates live; badge labels injected from the component so they pass through i18n.
- renderer/components/KanbanPilotView.tsx + new 'kanban-next' sidebar view (union + item + App branch); selecting a card resolves the full Task and reuses the existing handleTaskClick; en+fr keys in navigation.json and kanban.json.
Verified: Electron tsc clean (exit 0) and vitest 6/6; web vitest 5/5 and tsc adds no new errors (the 4 pre-existing test-file errors on develop — Terminal.test, websocket.test — are out of scope; CI does not typecheck web-frontend). CI's npm-ci/hoist path does the true integration validation.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughAdds a new ChangesElectron Renderer Kanban Pilot
Web Frontend Kanban Pilot
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant TaskStore
participant AutoCodeClient
participant KanbanPilotView
TaskStore->>AutoCodeClient: getState().tasks / subscribe()
AutoCodeClient->>AutoCodeClient: mapStatus / computeProgress / mapTaskToUiTask
AutoCodeClient-->>KanbanPilotView: UiTask[]
sequenceDiagram
participant User
participant KanbanPilot
participant PilotBoard
participant AutoCodeClient
participant API
User->>KanbanPilot: navigate to /kanban-next
KanbanPilot->>AutoCodeClient: createRestAutoCodeClient(apiClient)
KanbanPilot->>PilotBoard: provide client via AutoCodeClientProvider
PilotBoard->>AutoCodeClient: listTasks()
AutoCodeClient->>API: source.listTasks()
API-->>AutoCodeClient: TaskSummary[]
AutoCodeClient-->>PilotBoard: UiTask[]
User->>PilotBoard: select task
PilotBoard->>User: navigate to /tasks/:id
Suggested labels: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/frontend/src/renderer/__tests__/autoCodeClient.test.ts`:
- Around line 31-42: The helper makeTask currently relies on an as Task cast,
which hides missing required fields from the Task type. Update makeTask in
autoCodeClient.test.ts to construct a fully valid Task object by providing safe
default values for logs, createdAt, and updatedAt alongside the existing fields,
while still allowing overrides to merge in test-specific values. Keep the helper
structurally compatible with Task so TypeScript can catch future breakages
without any cast.
In `@apps/frontend/src/renderer/components/KanbanPilotView.tsx`:
- Around line 69-84: The AutoCodeClient instance in KanbanPilotView is being
recreated on every locale change because useMemo depends on t, which causes the
store subscription to churn and tasks to reload. Make the client stable across
translation updates by removing the t-based dependency from the
createTaskStoreAutoCodeClient memoization, and handle localized badge text
separately from the client instance if needed. Use KanbanPilotView, useMemo, and
createTaskStoreAutoCodeClient to locate the fix.
In `@apps/frontend/src/renderer/lib/autoCodeClient.ts`:
- Around line 78-88: The subscription in createTaskStoreAutoCodeClient is
rebuilding the full task snapshot on every store update, even when tasks have
not changed. Update subscribeTasks to use a selector-based subscription on
store.getState().tasks if TaskStoreLike supports it, so only task list changes
trigger onChange. Keep snapshot() and mapTaskToUiTask as the task-mapping path,
and reference createTaskStoreAutoCodeClient, snapshot, and subscribeTasks when
adjusting the listener logic.
In `@apps/web-frontend/src/api/autoCodeClient.ts`:
- Around line 18-28: The mapStatus helper only handles complete and in_progress,
so review-oriented statuses still fall through to draft. Update mapStatus in
autoCodeClient.ts to explicitly map any review-related API statuses to the
TaskStatus value used by the review column, and then verify KanbanPilot.tsx
consumes that status so those items no longer land in Draft.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: af86daed-08fc-4d64-9e0b-d25aacc146f4
📒 Files selected for processing (15)
apps/frontend/src/renderer/App.tsxapps/frontend/src/renderer/__tests__/autoCodeClient.test.tsapps/frontend/src/renderer/components/KanbanPilotView.tsxapps/frontend/src/renderer/components/Sidebar.tsxapps/frontend/src/renderer/lib/autoCodeClient.tsapps/frontend/src/shared/i18n/locales/en/kanban.jsonapps/frontend/src/shared/i18n/locales/en/navigation.jsonapps/frontend/src/shared/i18n/locales/fr/kanban.jsonapps/frontend/src/shared/i18n/locales/fr/navigation.jsonapps/web-frontend/src/App.tsxapps/web-frontend/src/api/autoCodeClient.test.tsapps/web-frontend/src/api/autoCodeClient.tsapps/web-frontend/src/i18n/locales/en/tasks.jsonapps/web-frontend/src/i18n/locales/fr/tasks.jsonapps/web-frontend/src/pages/KanbanPilot.tsx
…ap (U1 review) - web mapStatus: the backend decorates statuses with ' (has build)' (list_specs), so exact matching sent even in_progress to Draft — strip the decoration before matching (worse than the reported gap); also map the review family (review/ai_review/human_review) onto the Review column defensively (backend doesn't emit them yet). - electron adapter: subscribeTasks now re-maps only when state.tasks was actually replaced (reference guard; zustand updates immutably) instead of on every store change; labels can be a getter so the client identity survives locale switches. - KanbanPilotView: client memoized once, translations flow through a ref — no resubscribe/reload flicker on language change; props marked Readonly (Sonar S6759 x2). - tests: makeTask now builds a fully valid Task (logs/createdAt/updatedAt) without the as-cast; +2 adapter tests (skip-on-unrelated-store-change, lazy labels across a 'locale switch'); +suffix/review mapStatus cases. Verified: electron vitest 8/8 + tsc exit 0; web vitest 7/7 + tsc adds no new errors (same 4 pre-existing baseline). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
…k (U2) (#384) First canonical screen on the shared design system (Track D / U2), building on the U1 seam. - Port (libs/ui/src/client): AutoCodeClient gains OPTIONAL getTask(id) and createTask(input) — optional so existing adapters (the U1 Kanban clients) still satisfy the interface and adopt these incrementally. New UiTaskDetail (spec body + per-status progress breakdown) and CreateTaskInput types. - Hook: useTask(id) mirrors useTasks — idle when id is null, surfaces a clear error when an adapter doesn't implement getTask, otherwise loads detail with loading/error/reload. - Screen: TaskDetail — presentational, data-agnostic (pair with useTask + an adapter): header (id/title/status pill), badges, description, subtask progress breakdown, and the spec body. Tokens/BEM mirror KanbanBoard; localized status labels injectable; props Readonly. - Exported from index. No app changes — adapters wire getTask + mount the screen next (after #383 lands the U1 adapters they extend). Verified: libs/ui tsc --noEmit clean; rendered live against sample data (header + status pill + progress breakdown + spec body, light/dark). Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
…385) * refactor(ui): strip status suffix without regex (Sonar S8786) The \s*(...)$ pattern backtracks super-linearly; replace with endsWith + slice. Behavior unchanged — the suffix/review vitest cases still pass (7/7). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * style(ui): overflow-wrap instead of deprecated word-break value (Sonar css:S1874) word-break: break-word is deprecated; overflow-wrap: anywhere is the modern equivalent. Verified in the browser: computed style overflow-wrap=anywhere, spec panel renders unchanged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * ci: run test + security workflows on libs/** changes This libs-only PR exposed the gap: both workflows filter on apps/** (+tests/package files), so changes to the shared libs/ui package skipped test-frontend (which typechecks libs through the apps) and CodeQL entirely — only Sonar ran. Add libs/** to the pull_request and push path filters of ci.yml and quality-security.yml. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * feat(ui): task detail wired into both apps via getTask adapters (U2) Completes the board->detail->back flow on the shared design system in BOTH targets, on top of the merged U1 adapters and U2 TaskDetail screen. Web (apps/web-frontend): - adapter: getTask maps the backend TaskDetail onto UiTaskDetail (per-status progress breakdown, spec body; the decorated status goes through the same suffix-stripping mapStatus). - pages/TaskDetailNext.tsx at /tasks-next/:id with i18n-injected status labels; the /kanban-next pilot now navigates there, so the whole flow stays on the new UI. +3 vitest cases (detail mapping incl. decorated status, optional-field omission, client wiring). Electron (apps/frontend): - adapter: mapTaskToUiTaskDetail (subtask breakdown — SubtaskStatus maps 1:1) + getTask resolving from the live store; specContent stays undefined until an IPC spec fetch is wired (follow-up). - KanbanPilotView: selecting a card opens the shared TaskDetail INLINE (board -> detail -> back), replacing the legacy modal hop; status labels reuse the pilot column translations; App no longer passes onTaskSelect. +3 vitest cases. Also recovers three commits stranded by early squash-merges of #383/#384: the S8786 regex removal, the css S1874 overflow-wrap fix, and the ci path-filter fix adding libs/** so libs-only PRs actually run tests/CodeQL. Verified: electron vitest 11/11 + tsc exit 0; web vitest 10/10 + tsc adds no new errors over the 5 pre-existing baseline test-file errors. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>



Completes U1 (Track D — see docs/strategy/roadmap.md):
libs/ui's KanbanBoard now renders real data in both targets through per-appAutoCodeClientadapters — the ports-and-adapters seam introduced in #364 is proven end to end. No changes tolibs/uiitself.Web (
apps/web-frontend)api/autoCodeClient.ts— REST adapter over the existingApiClient:TaskSummary → UiTask(complete→done,in_progress→running, elsedraft;"3/7"progress → percent; folder as the canonical id). Unit-tested against an injected source (vitest, 5 tests).pages/KanbanPilot.tsxat/kanban-next, next to the legacy/kanban(page-by-page migration per the recorded roadmap decision); card click →/tasks/{id}; all strings via i18n (en+fr intasks.json).SidebarViewsurfaced the legacy web Sidebar — and its clicks don't navigate at all (handleViewChangeonly highlights;Layoutgets noonViewChange). A nav item there would be dead UI, and the legacy shell stays untouched until replacement.Electron (
apps/frontend)renderer/lib/autoCodeClient.ts— adapter over the live task store (the IPC transport already keeps it fresh): full status mapping (backlog/queue→draft,ai_review/human_review→review,error→review+ badge,pr_created→done+ badge), subtask-based progress, and a realsubscribeTasksbridged to the zustand subscription — the shared board updates live. Badge labels are injected from the component so they go through i18n.renderer/components/KanbanPilotView.tsx+ newkanban-nextsidebar view (union + nav item + App branch); selecting a card resolves the fullTaskand reuses the existinghandleTaskClick. en+fr keys innavigation.jsonandkanban.json.Verification
tsc --noEmitclean (exit 0); vitest 6/6.tscadds no new errors — the 4 pre-existing test-file errors on develop (Terminal.test.tsx×3,websocket.test.ts×1) are out of this PR's scope, and CI doesn't typecheck web-frontend.🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
/kanban-next.Bug Fixes
Tests