Repository navigation
feat(jira): kanban board view for Jira issues in the Tasks panel - #13054
EugeValeiras wants to merge 4 commits into
Conversation
Adds a List/Board toggle to the Jira tasks panel, mirroring the Linear board. Columns come from groupJiraIssuesByStatus, so they follow the project's real Agile board column order when available and fall back to alphabetical status order otherwise. Cards support HTML5 drag & drop between columns; since Jira only changes status through transitions, the drop resolves a transition targeting the destination column (cached per issue+status via the metadata request store), applies an optimistic status patch, and rolls back with a toast when no transition exists or the update fails. Co-Authored-By: Claude Fable 5 <[email protected]>
📝 WalkthroughWalkthroughJira task pages now support list and board layouts, sprint-only filtering, and board issue movement. The board groups issues by configured or discovered status sections and supports issue selection, workspace actions, Jira links, and drag-and-drop movement. Transition loading uses scoped, status-aware caching and matches target sections by status ID or label. Issue moves apply optimistic updates, submit Jira transitions, roll back failures, and track per-issue progress. Tests cover status ordering, board rendering, transition lookup, sprint filtering, drag payload validation, and failure handling. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
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: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 3528e9bf-3305-48cf-9f63-03bbb051b752
📒 Files selected for processing (9)
src/renderer/src/components/TaskPage.tsxsrc/renderer/src/components/task-page-jira-board-transitions.test.tssrc/renderer/src/components/task-page-jira-board-transitions.tssrc/renderer/src/components/task-page-jira-board.test.tsxsrc/renderer/src/components/task-page-jira-board.tsxsrc/renderer/src/components/task-page-localized-options.tsxsrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/lib/jira-board-drag-payload.test.tssrc/renderer/src/lib/jira-board-drag-payload.ts
| function matchesDragRef(issue: JiraIssue, ref: JiraBoardIssueDragRef): boolean { | ||
| if (issue.key !== ref.key) { | ||
| return false | ||
| } | ||
| return !ref.siteId || !issue.siteId || ref.siteId === issue.siteId | ||
| } |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Use exact site matching for issue identity.
At Line 24 and Line 45, a missing siteId matches every site. If a list contains the same issue key in multiple site contexts, handleSectionDrop can call onMoveIssue for the wrong issue. Compare siteId values exactly in both helpers.
Proposed fix
function matchesDragRef(issue: JiraIssue, ref: JiraBoardIssueDragRef): boolean {
if (issue.key !== ref.key) {
return false
}
- return !ref.siteId || !issue.siteId || ref.siteId === issue.siteId
+ return ref.siteId === issue.siteId
}
function isSelectedIssue(issue: JiraIssue, selectedIssue: JiraIssue | null): boolean {
if (!selectedIssue || issue.key !== selectedIssue.key) {
return false
}
- return !selectedIssue.siteId || !issue.siteId || selectedIssue.siteId === issue.siteId
+ return selectedIssue.siteId === issue.siteId
}Also applies to: 41-45
| patchJiraIssue( | ||
| issue.key, | ||
| { status: transition.to }, | ||
| { sourceContext: jiraTaskSourceContext } | ||
| ) | ||
| const result = await jiraUpdateIssue( | ||
| providerSettings, | ||
| issue.key, | ||
| { transitionId: transition.id }, | ||
| issue.siteId | ||
| ) | ||
| if (result.ok === false) { | ||
| patchJiraIssue( | ||
| issue.key, | ||
| { status: previousStatus }, | ||
| { sourceContext: jiraTaskSourceContext } | ||
| ) |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift
Scope optimistic Jira patches by site ID.
Line 5799 patches by issue.key only. When All Jira sites is selected, two sites can contain the same Jira key. The optimistic update and rollback can then modify the wrong cached issue.
Pass issue.siteId through patchJiraIssue, and match the composite site/key reference. Add a same-key cross-site rollback test.
The board reused the Linear grid, which wraps columns into 2-3 per row; Jira boards commonly have more columns than fit the panel, so lanes now sit side by side with horizontal scrolling. Co-Authored-By: Claude Fable 5 <[email protected]>
# Conflicts: # src/renderer/src/components/TaskPage.tsx # src/renderer/src/components/task-page-localized-options.tsx
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
Two board gaps: columns only existed when an issue occupied them, and there was no way to focus the board on the active sprint. getProjectStatusOrder now carries each board column's name alongside its status ids (optional field, so old remote runtimes keep the id-only shape), and the board builds one lane per real column — empty ones render with a drop placeholder and resolve transitions through their config status ids. Statuses outside the board config still get appended lanes. The Sprint toggle composes `sprint in openSprints()` onto the active preset or search JQL client-side and rides the existing JQL search path, so it needs no wire change and works against older remote hosts. Co-Authored-By: Claude Fable 5 <[email protected]>
|
Pushed two board improvements after using it against a real sprint-heavy project:
Both covered by unit tests (board sections, transition resolution for empty lanes, JQL composition, main-side column extraction). |
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 78756233-15f8-4daf-a40b-4a30be3d3eb5
📒 Files selected for processing (17)
src/main/jira/issues.test.tssrc/main/jira/issues.tssrc/renderer/src/components/TaskPage.tsxsrc/renderer/src/components/task-page-jira-board-sections.test.tssrc/renderer/src/components/task-page-jira-board-sections.tssrc/renderer/src/components/task-page-jira-board-transitions.test.tssrc/renderer/src/components/task-page-jira-board-transitions.tssrc/renderer/src/components/task-page-jira-board.test.tsxsrc/renderer/src/components/task-page-jira-board.tsxsrc/renderer/src/components/task-page-jira-sprint-filter.test.tssrc/renderer/src/components/task-page-jira-sprint-filter.tssrc/renderer/src/components/task-page-localized-options.tsxsrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/lib/jira-board-drag-payload.test.tssrc/renderer/src/lib/jira-board-drag-payload.tssrc/shared/jira-types.tssrc/shared/types.ts
🚧 Files skipped from review as they are similar to previous changes (9)
- src/renderer/src/lib/jira-board-drag-payload.test.ts
- src/renderer/src/components/task-page-jira-board.test.tsx
- src/renderer/src/components/task-page-jira-board-transitions.ts
- src/renderer/src/i18n/locales/en.json
- src/renderer/src/lib/jira-board-drag-payload.ts
- src/renderer/src/components/task-page-jira-board-transitions.test.ts
- src/renderer/src/components/task-page-jira-board.tsx
- src/renderer/src/components/task-page-localized-options.tsx
- src/renderer/src/components/TaskPage.tsx
| const orderByMatch = jql.match(/\sORDER\s+BY\s[\s\S]*$/i) | ||
| if (!orderByMatch || orderByMatch.index === undefined) { | ||
| return `(${jql}) AND ${CURRENT_SPRINT_CLAUSE}` | ||
| } | ||
| const where = jql.slice(0, orderByMatch.index).trim() | ||
| if (!where) { | ||
| return jql |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Apply the current-sprint clause to bare ORDER BY queries.
jiraCurrentSprintJql trims custom JQL before it calls withCurrentSprintClause. The helper does not detect ORDER BY at offset zero, and its empty-predicate branch omits the filter.
src/renderer/src/components/task-page-jira-sprint-filter.ts#L24-L30: MatchORDER BYat the start of the query and return the sprint clause before the order clause whenwhereis empty.src/renderer/src/components/task-page-jira-sprint-filter.test.ts#L31-L33: Assert thatORDER BY created ASCbecomessprint in openSprints() ORDER BY created ASC.
Proposed fix
- const orderByMatch = jql.match(/\sORDER\s+BY\s[\s\S]*$/i)
+ const orderByMatch = jql.match(/(?:^|\s)ORDER\s+BY\s[\s\S]*$/i)
if (!orderByMatch || orderByMatch.index === undefined) {
return `(${jql}) AND ${CURRENT_SPRINT_CLAUSE}`
}
const where = jql.slice(0, orderByMatch.index).trim()
+ const orderBy = jql.slice(orderByMatch.index).trim()
if (!where) {
- return jql
+ return `${CURRENT_SPRINT_CLAUSE} ${orderBy}`
}
- const orderBy = jql.slice(orderByMatch.index).trim()
return `(${where}) AND ${CURRENT_SPRINT_CLAUSE} ${orderBy}`📍 Affects 2 files
src/renderer/src/components/task-page-jira-sprint-filter.ts#L24-L30(this comment)src/renderer/src/components/task-page-jira-sprint-filter.test.ts#L31-L33
Show Jira issues as a board alongside the existing list and add the current-sprint preset. Status moves use the existing owner-scoped mutation queue, collect required workflow fields/comments, retain rejected drafts, and reload the mounted comment timeline once after success. Source/session fences keep older detail failures from undoing newer board moves. Preserve statuses plus sprint in query preview and Edit-as-JQL. Older hosts must advertise sprint support; unsupported peers fail clearly. Existing capability definitions and test fixtures are split without changing public exports, wire strings, or coverage to meet current lint limits. Validation:351 tests/42 suites,all46 changed sources full-file lint/anti-slop and7quality stages,localization/RPC checks,and independent source review passed. Node types passed on runtime-identical99d and web types passed on final602d. Fresh hidden Electron54/54 checks passed on99d; final two test-only changes were hash and emitted-runtime audited. The inherited IPC301-line failure is byte-identical main and being corrected separately by the image PR. Adapted Eugenio Valeiras (@EugeValeiras)'s board contribution from PR #13054. Co-authored-by: Eugenio Valeiras <[email protected]> Co-authored-by: Claude Fable 5 <[email protected]>
Summary
Adds a List / Board toggle to the Jira panel in Tasks, rendering issues as a kanban board — mirroring the existing Linear board pattern.
Board view
groupJiraIssuesByStatus, so they follow the project's real Agile board column order (jira.getProjectStatusOrder) when the issues resolve to a single project/site with one board, and degrade to alphabetical status order otherwise — same behavior the grouped list already has.getJiraStatusTone), cards show key, priority, title, labels, assignee, and relative update time, with the same Start workspace / Open in Jira actions as list rows.getJiraViewOptions).Drag & drop with Jira transitions
Jira only changes status through transitions, so dropping a card:
createMetadataRequestStore, so a moved issue naturally misses its stale entry; works over IPC locally andjira.listTransitionsRPC on remote runtimes).to.idof statuses already present in the column, falling back toto.namematching the section label.patchJiraIssuestatus patch, callsjira.updateIssuewith thetransitionId, and rolls back with a toast if no transition exists or the update fails.The drag payload is a typed MIME (
application/x-orca-jira-issue-ref) carryingkey+siteId(keys are only unique per site), with the same size guard and Electrondragoverhidden-payload handling as the Linear board payload.Tests
jira-board-drag-payload.test.ts— round-trip, hidden/missing/rejected payload states.task-page-jira-board-transitions.test.ts— transition resolution by id and label, per-status caching, failure fallback.task-page-jira-board.test.tsx— column rendering, board-order sorting, updating-card drag lockout.No open issue tracks this; closest prior art is the GitHub Projects board work (#9943, #10186), which doesn't cover Jira.
🤖 Generated with Claude Code