fix: approveIssue() uses wrong data source in board/swimlanes view#35
Merged
marcus merged 1 commit intomarcus:mainfrom Feb 19, 2026
Merged
Conversation
approveIssue() was directly indexing into m.TaskListRows using m.Cursor[PanelTaskList], which is only valid in the flat list view. In board swimlanes mode, the actual selection lives in m.BoardMode.SwimlaneRows with m.BoardMode.SwimlaneCursor, and in kanban mode it lives in m.BoardMode.Issues with m.BoardMode.Cursor. This caused the wrong task to be approved when using the swimlanes view, particularly visible in the "in review" column where the stale index mapped to an entirely different task. The fix replaces the manual cursor/row lookup with m.SelectedIssueID(), which already handles all three view modes correctly. The old CategoryReviewable guard was redundant — the state machine validation and self-review check already enforce the same constraints. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
approveIssue()approved the wrong task when using the board swimlanes view, especially visible in the "in review" columnm.TaskListRowsusingm.Cursor[PanelTaskList], which is only valid in the flat list view — in swimlanes mode, the actual selection lives inm.BoardMode.SwimlaneRows/m.BoardMode.SwimlaneCursorm.SelectedIssueID(), which already correctly handles all three view modes (list, kanban, swimlanes)Root Cause
Every other action function in
actions.go(submitToReview,confirmDelete,reopenIssue, etc.) uses the view-mode-awareSelectedIssueID()helper to resolve the selected task.approveIssue()was the only function that bypassed this helper and manually indexed intom.TaskListRows— it did this to accessrow.Categoryfor aCategoryReviewableguard check.When the swimlanes view was added,
SelectedIssueID()was updated to handle the new data structures, butapproveIssue()was missed because it didn't go through that code path. The stalem.TaskListRowsarray has a completely different ordering than the swimlane rows, so the cursor position mapped to the wrong task.Why the CategoryReviewable guard removal is safe
The old code checked
row.Category != CategoryReviewablebefore proceeding. This guard is redundant becauseapproveIssue()already has two equivalent checks downstream:IsValidTransition(issue.Status, StatusClosed)) — onlyin_reviewissues can transition toclosedvia approvalissue.ImplementerSession == m.SessionID) — blocks approving your own workThese two checks enforce the exact same constraints that
CategoryReviewablewas guarding.Test plan
go build ./...compiles cleango test ./pkg/monitor/...all tests pass🤖 Generated with Claude Code