Skip to content

feat(ui): wire shared Kanban pilot into both apps via AutoCodeClient adapters (U1)#383

Merged
OBenner merged 2 commits into
developfrom
claude/ui-kanban-adapters-u1
Jul 5, 2026
Merged

feat(ui): wire shared Kanban pilot into both apps via AutoCodeClient adapters (U1)#383
OBenner merged 2 commits into
developfrom
claude/ui-kanban-adapters-u1

Conversation

@OBenner

@OBenner OBenner commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Completes U1 (Track D — see docs/strategy/roadmap.md): libs/ui's KanbanBoard now renders real data in both targets through per-app AutoCodeClient adapters — the ports-and-adapters seam introduced in #364 is proven end to end. No changes to libs/ui itself.

Web (apps/web-frontend)

  • api/autoCodeClient.ts — REST adapter over the existing ApiClient: TaskSummary → UiTask (complete→done, in_progress→running, else draft; "3/7" progress → percent; folder as the canonical id). Unit-tested against an injected source (vitest, 5 tests).
  • pages/KanbanPilot.tsx at /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 in tasks.json).
  • Route-only on purpose: codegraph impact analysis on SidebarView surfaced the legacy web Sidebar — and its clicks don't navigate at all (handleViewChange only highlights; Layout gets no onViewChange). 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 real subscribeTasks bridged 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 + new kanban-next sidebar view (union + nav item + App branch); selecting a card resolves the full Task and reuses the existing handleTaskClick. en+fr keys in navigation.json and kanban.json.
  • Adapter unit tests (vitest, 6 tests) incl. the live-subscription bridge over a fake store.

Verification

  • Electron: tsc --noEmit clean (exit 0); vitest 6/6.
  • Web: vitest 5/5; tsc adds 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.
  • CI's npm-ci + hoist path performs the true integration validation.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added a new “Kanban (New UI)” experience to the desktop and web apps, accessible from navigation and available at /kanban-next.
    • Included localized pilot Kanban titles, column labels, loading/error/retry messaging, and badge text.
    • Enabled task selection from the new board, taking users to task details.
  • Bug Fixes

    • Improved how task statuses, progress, and badges are translated and displayed in board cards.
  • Tests

    • Added unit tests covering status mapping, progress parsing, and task-store/UI update behavior.

…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>
@cursor

cursor Bot commented Jul 5, 2026

Copy link
Copy Markdown

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.

@coderabbitai

coderabbitai Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 300299b0-a1b4-491f-9412-9e1972e72641

📥 Commits

Reviewing files that changed from the base of the PR and between 2c6d4ab and d7ca090.

📒 Files selected for processing (5)
  • apps/frontend/src/renderer/__tests__/autoCodeClient.test.ts
  • apps/frontend/src/renderer/components/KanbanPilotView.tsx
  • apps/frontend/src/renderer/lib/autoCodeClient.ts
  • apps/web-frontend/src/api/autoCodeClient.test.ts
  • apps/web-frontend/src/api/autoCodeClient.ts

📝 Walkthrough

Walkthrough

Adds a new kanban-next pilot Kanban view in the Electron renderer and web frontend, with shared UI task adapters, route and sidebar wiring, localized strings, and tests.

Changes

Electron Renderer Kanban Pilot

Layer / File(s) Summary
Task-store AutoCodeClient adapter
apps/frontend/src/renderer/lib/autoCodeClient.ts
Implements the renderer task-store adapter that maps desktop Task data into shared UiTask objects with status, progress, and badge translation.
KanbanPilotView component
apps/frontend/src/renderer/components/KanbanPilotView.tsx
Adds the pilot view that renders the shared Kanban board through an AutoCodeClientProvider, handles loading and error states, and resolves task selection callbacks.
App and Sidebar wiring, i18n
apps/frontend/src/renderer/App.tsx, apps/frontend/src/renderer/components/Sidebar.tsx, apps/frontend/src/shared/i18n/locales/en/*.json, apps/frontend/src/shared/i18n/locales/fr/*.json
Wires kanban-next into renderer navigation and adds English/French locale strings for the pilot Kanban UI and navigation label.
Adapter unit tests
apps/frontend/src/renderer/__tests__/autoCodeClient.test.ts
Adds tests for status mapping, progress calculation, task conversion, subscription behavior, and lazy label resolution.

Web Frontend Kanban Pilot

Layer / File(s) Summary
REST AutoCodeClient adapter
apps/web-frontend/src/api/autoCodeClient.ts
Implements the REST adapter that maps backend task summaries into shared UiTask objects for the web frontend.
KanbanPilot page and routing
apps/web-frontend/src/pages/KanbanPilot.tsx, apps/web-frontend/src/App.tsx, apps/web-frontend/src/i18n/locales/en/tasks.json, apps/web-frontend/src/i18n/locales/fr/tasks.json
Adds the pilot page, wires the /kanban-next route, and adds locale strings for the new Kanban UI.
REST adapter unit tests
apps/web-frontend/src/api/autoCodeClient.test.ts
Adds tests for REST task status normalization, progress parsing, task mapping, and client listing behavior.

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[]
Loading
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
Loading

Suggested labels: area/fullstack, size/XL

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: wiring the shared Kanban pilot into both apps through AutoCodeClient adapters.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/ui-kanban-adapters-u1

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 9eeec55 and 2c6d4ab.

📒 Files selected for processing (15)
  • apps/frontend/src/renderer/App.tsx
  • apps/frontend/src/renderer/__tests__/autoCodeClient.test.ts
  • apps/frontend/src/renderer/components/KanbanPilotView.tsx
  • apps/frontend/src/renderer/components/Sidebar.tsx
  • apps/frontend/src/renderer/lib/autoCodeClient.ts
  • apps/frontend/src/shared/i18n/locales/en/kanban.json
  • apps/frontend/src/shared/i18n/locales/en/navigation.json
  • apps/frontend/src/shared/i18n/locales/fr/kanban.json
  • apps/frontend/src/shared/i18n/locales/fr/navigation.json
  • apps/web-frontend/src/App.tsx
  • apps/web-frontend/src/api/autoCodeClient.test.ts
  • apps/web-frontend/src/api/autoCodeClient.ts
  • apps/web-frontend/src/i18n/locales/en/tasks.json
  • apps/web-frontend/src/i18n/locales/fr/tasks.json
  • apps/web-frontend/src/pages/KanbanPilot.tsx

Comment thread apps/frontend/src/renderer/__tests__/autoCodeClient.test.ts
Comment thread apps/frontend/src/renderer/components/KanbanPilotView.tsx Outdated
Comment thread apps/frontend/src/renderer/lib/autoCodeClient.ts
Comment thread apps/web-frontend/src/api/autoCodeClient.ts
…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>
@cursor

cursor Bot commented Jul 5, 2026

Copy link
Copy Markdown

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.

@sonarqubecloud

sonarqubecloud Bot commented Jul 5, 2026

Copy link
Copy Markdown

@OBenner OBenner merged commit 8383ddb into develop Jul 5, 2026
19 checks passed
OBenner added a commit that referenced this pull request Jul 5, 2026
…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>
OBenner added a commit that referenced this pull request Jul 5, 2026
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant