Skip to content

fix(web): pass onMerge to AttentionZone in kanban view#2114

Open
0xGermain wants to merge 1 commit into
AgentWrapper:mainfrom
0xGermain:fix/kanban-merge-button-noop
Open

fix(web): pass onMerge to AttentionZone in kanban view#2114
0xGermain wants to merge 1 commit into
AgentWrapper:mainfrom
0xGermain:fix/kanban-merge-button-noop

Conversation

@0xGermain

Copy link
Copy Markdown

Summary

  • Pass onMerge={handleMerge} to AttentionZone in the kanban layout — the prop was missing, making the merge button a silent no-op
  • Parse JSON error responses from /api/prs/:id/merge so the toast shows human-readable blocker reasons instead of raw JSON

What happened

The handleMerge callback was wired to BottomSheet (mobile preview) but never forwarded to AttentionZone in the desktop kanban grid. Since SessionCard declares onMerge as optional (onMerge?.()), clicking the merge button silently did nothing — no fetch, no error, no toast.

Additionally, when a merge does fail (e.g. CI blockers), the error toast dumped raw JSON like {"error":"PR is not mergeable","blockers":["CI is failing"]}. Now it shows Merge blocked: CI is failing.

Changes

packages/web/src/components/Dashboard.tsx

  1. Added onMerge={handleMerge} to the AttentionZone component in the kanban map() (line ~723)
  2. Parse the merge API error response JSON to extract blockers or error for the toast message

How to test

  1. Start AO with a project that has an open PR in the "merge" kanban column
  2. Click the "Merge PR #N" button on the kanban card
  3. Before fix: nothing happens, no network request in DevTools
  4. After fix: merge request fires; on success a "PR merged" toast appears; on failure a readable error toast appears (e.g. "Merge blocked: CI is failing")

Closes #TBD

The merge button on kanban session cards was silently no-op because
onMerge was not forwarded to the AttentionZone component. The optional
chain onMerge?.() resolved to undefined, so clicking the button produced
no fetch, no error, and no user feedback.

Also parse the JSON error response from /api/prs/:id/merge so the toast
shows human-readable blocker reasons (e.g. "Merge blocked: CI is failing")
instead of raw JSON.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant