Skip to content

feat(desktop): multi-select GitHub issues to spin up workspaces#4338

Merged
AviPeltz merged 11 commits into
mainfrom
gh-issue-multi-select-age
May 14, 2026
Merged

feat(desktop): multi-select GitHub issues to spin up workspaces#4338
AviPeltz merged 11 commits into
mainfrom
gh-issue-multi-select-age

Conversation

@AviPeltz
Copy link
Copy Markdown
Collaborator

@AviPeltz AviPeltz commented May 10, 2026

Summary

  • Adds row checkboxes to the GitHub issues view in the tasks tab; the existing top-bar selection UI (clear + count + Run in Workspace) now appears for issue selections too.
  • New RunIssuesInWorkspacePopover mirrors the V2 task popover but uses an issue-derived branch (issue-<n>-<slug>) and an agent prompt seeded from the issue title and URL. Defaults the project to the current projectFilter while keeping device + agent pickers.
  • Selection auto-clears when the project filter changes.

Test plan

  • Open the tasks view, switch to the Issues tab — checkboxes render on each row.
  • Click a checkbox: row stays in place, top bar shows "N selected" with clear (X) and Run in Workspace.
  • Click Run in Workspace, pick agent + host, confirm — one workspace is created per issue with the issue title as the workspace name.
  • Switch the project filter — selection clears.
  • Click a row (not a checkbox) — issue preview still opens.

Summary by cubic

Add multi-select to Tasks > Issues so you can launch one workspace per selected issue from the same top bar used for tasks. Includes a popover to pick host/device, project, and optional agent, with issue-derived branch names and prompts.

  • New Features

    • Checkboxes in Issues with top-bar actions (clear, count, Run in Workspace).
    • RunIssuesInWorkspacePopover: one workspace per issue; branch issue-<n> from title; agent prompt from title + URL; host/device, project, and agent pickers; project defaults to the current filter; remembers the last selected agent; persists the last used project on run.
    • Selection clears on project filter change; row clicks still open the issue preview.
  • Bug Fixes

    • Project queries: remove empty-string fallback when filtering by organization ID in both the V2 tasks popover and the new issues popover to avoid accidental matches.

Written for commit b400050. Summary will update on new commits.

Summary by CodeRabbit

  • New Features

    • Multi-select GitHub issues via checkboxes; selection integrates with the tasks top bar.
    • New "Run Issues in Workspace" popover to launch workspace runs for selected issues (choose host, project, optional agent); persists agent preference and submits per-issue runs with real-time toasts.
  • UX

    • Selection clears when project filter changes; clear-selection and Run controls reflect issue vs. task context and disable when prerequisites aren’t met.

Review Change Stack

Add row checkboxes to the GitHub issues view in the tasks tab so users
can select issues and launch one workspace per issue (with an agent)
from the same selection bar that already exists for tasks. The new
RunIssuesInWorkspacePopover mirrors the V2 task popover but uses an
issue-derived branch name and an agent prompt seeded from the issue
title and URL.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 10, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 43ded5ba-d5d9-4ea0-8d61-faaf398b5db8

📥 Commits

Reviewing files that changed from the base of the PR and between 59c8106 and b400050.

📒 Files selected for processing (1)
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/tasks/components/TasksView/components/TasksTopBar/components/RunIssuesInWorkspacePopover/RunIssuesInWorkspacePopover.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/tasks/components/TasksView/components/TasksTopBar/components/RunIssuesInWorkspacePopover/RunIssuesInWorkspacePopover.tsx

📝 Walkthrough

Walkthrough

Adds multi-issue selection to the GitHub issues list, threads selection state through TasksView and TasksTopBar, and provides a RunIssuesInWorkspacePopover to submit selected issues as workspace runs with host/project/agent choices.

Changes

GitHub Issues Selection and Workspace Execution

Layer / File(s) Summary
Type Definition
.../GitHubIssuesContent/GitHubIssuesContent.tsx, .../GitHubIssuesContent/index.ts
Adds exported SelectedIssue type (issueNumber, title, url, state) and re-exports it.
Issue Selection State
.../GitHubIssuesContent/GitHubIssuesContent.tsx
Adds Map-based selectedIssues state, toggleIssueSelection and clearSelection, clears on projectFilter change, and exposes onSelectionChange(selectedIssues[], clearSelection). Per-row checkboxes stop propagation to avoid row navigation.
TasksView Integration
.../TasksView/TasksView.tsx
Imports SelectedIssue, creates selectedIssues state and clearIssueSelectionRef, and wires selection callbacks into GitHubIssuesContent and props into TasksTopBar.
TasksTopBar Conditional Rendering
.../TasksTopBar/TasksTopBar.tsx
Accepts selectedIssues and onClearIssueSelection, computes showIssues and selectedCount, routes clear button to issue vs task clear handlers, and renders RunIssuesInWorkspacePopover when viewing issues.
Run Issues Popover
.../RunIssuesInWorkspacePopover/RunIssuesInWorkspacePopover.tsx, .../RunIssuesInWorkspacePopover/index.ts
New component loads org projects and repo metadata, manages host/project/agent selection with validation, builds per-issue workspace payloads (deterministic branch + snapshot ids), submits batch requests with error handling, and presents a popover UI to run N workspaces.
V2 Popover query tweak
.../RunInWorkspacePopoverV2/RunInWorkspacePopoverV2.tsx
Adjusts V2 projects live query to use activeOrganizationId directly rather than activeOrganizationId ?? "", changing returned results when organization id is absent.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant TopBar as TasksTopBar
  participant Popover as RunIssuesInWorkspacePopover
  participant API as WorkspaceAPI
  participant Toast
  User->>TopBar: open actions for selected issues
  TopBar->>Popover: open popover(issues, projectFilter)
  User->>Popover: choose host/project/agent and click Run
  Popover->>API: submit per-issue workspace payloads (batch)
  API-->>Popover: success/failure
  Popover->>Toast: show loading/success/error
  Popover->>TopBar: onComplete -> clear issue selection
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • superset-sh/superset#4493: Modifies TasksView/GitHubIssuesContent integration (search behavior) and could overlap with the issue-selection wiring changes here.

Poem

🐇 I nudged the checkbox, gathered each bright issue,

branches named and snapshots stitched in tissue—
Hosts wake, agents listen, projects hum and run,
Tiny rabbit cheers as workspaces spring to sun.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main feature: adding multi-select capability to GitHub issues for spinning up workspaces.
Description check ✅ Passed The description includes all key required sections: a clear summary of changes, a comprehensive test plan, type of change (new feature), and additional implementation details.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 gh-issue-multi-select-age

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


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 and usage tips.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 10, 2026

Greptile Summary

Adds multi-select checkboxes to the GitHub Issues tab so users can batch-create workspaces from selected issues. The new RunIssuesInWorkspacePopover mirrors the V2 task popover, seeding the project picker from projectFilter and generating branch names via issue-<n>-<sanitized-title>.

  • Checkbox selection is managed in a Map<number, SelectedIssue> inside GitHubIssuesContent, lifted to TasksView via onSelectionChange, and passed down to TasksTopBar alongside the existing task-selection props.
  • TasksTopBar now branches on typeTab === \"issues\" to compute selectedCount and render the issues-specific popover instead of the V2 task popovers.
  • Selection auto-clears when projectFilter changes; row click still opens the issue preview (checkbox click is stopped from propagating).

Confidence Score: 4/5

The change is additive and does not touch auth, data mutation, or any critical path outside the tasks view.

The implementation faithfully mirrors the proven V2 task batch-workspace flow. The main concerns are minor: selection is cleared optimistically before async submissions settle (same trade-off accepted in V2), lastProjectId is not updated when running with the default seeded project, and authorLogin is captured in the type but never consumed. None of these would cause data loss or broken functionality in typical usage.

RunIssuesInWorkspacePopover.tsx — the handleRun flow around optimistic selection clearing and lastProjectId persistence.

Important Files Changed

Filename Overview
apps/desktop/src/renderer/routes/_authenticated/_dashboard/tasks/components/TasksView/components/TasksTopBar/components/RunIssuesInWorkspacePopover/RunIssuesInWorkspacePopover.tsx New popover component for bulk issue-to-workspace creation; mirrors V2 task popover closely but seeds from projectFilter instead of lastProjectId, and clears selection optimistically before async submissions complete.
apps/desktop/src/renderer/routes/_authenticated/_dashboard/tasks/components/TasksView/components/GitHubIssuesContent/GitHubIssuesContent.tsx Adds checkbox selection to each issue row, manages selection in a Map keyed by issue number, lifts state via onSelectionChange callback, and auto-clears when projectFilter changes.
apps/desktop/src/renderer/routes/_authenticated/_dashboard/tasks/components/TasksView/TasksView.tsx Wires selectedIssues state and clearIssueSelectionRef into TasksTopBar and GitHubIssuesContent; straightforward parallel of the existing task-selection plumbing.
apps/desktop/src/renderer/routes/_authenticated/_dashboard/tasks/components/TasksView/components/TasksTopBar/TasksTopBar.tsx Extends selection display logic to cover issues tab by computing selectedCount from the active tab; renders RunIssuesInWorkspacePopover in place of the task popovers when typeTab === "issues".

Sequence Diagram

sequenceDiagram
    participant User
    participant GitHubIssuesContent
    participant TasksView
    participant TasksTopBar
    participant RunIssuesInWorkspacePopover
    participant WorkspaceCreates

    User->>GitHubIssuesContent: Check issue checkbox
    GitHubIssuesContent->>GitHubIssuesContent: "toggleIssueSelection -> update Map"
    GitHubIssuesContent->>TasksView: onSelectionChange(issues[], clearFn)
    TasksView->>TasksView: setSelectedIssues(issues[])
    TasksView->>TasksTopBar: selectedIssues prop updated

    User->>TasksTopBar: Click Run in Workspace
    TasksTopBar->>RunIssuesInWorkspacePopover: issues[], projectFilter, onComplete

    User->>RunIssuesInWorkspacePopover: Pick agent/host, click Run
    RunIssuesInWorkspacePopover->>WorkspaceCreates: "submit({ hostId, snapshot }) x N"
    RunIssuesInWorkspacePopover->>RunIssuesInWorkspacePopover: setOpen(false)
    RunIssuesInWorkspacePopover->>TasksView: "onComplete() -> clearIssueSelectionRef()"
    TasksView->>GitHubIssuesContent: "clearSelection() -> setSelectedIssues(new Map())"
    WorkspaceCreates-->>RunIssuesInWorkspacePopover: Promise resolves/rejects
    RunIssuesInWorkspacePopover-->>User: toast success/error
Loading
Prompt To Fix All With AI
Fix the following 3 code review issues. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 3
apps/desktop/src/renderer/routes/_authenticated/_dashboard/tasks/components/TasksView/components/TasksTopBar/components/RunIssuesInWorkspacePopover/RunIssuesInWorkspacePopover.tsx:221-261
**Selection cleared before knowing submission outcome**

`onComplete()` is called synchronously right after `toast.promise(promise, ...)`, so the issue selection is wiped out while workspace creations are still in-flight. If one or more creates fail, the user sees only a partial-success count in the toast (e.g. "2 of 5 succeeded") but the selection is already gone, making it impossible to identify and retry the failed issues without re-selecting them manually. The same trade-off exists in `RunInWorkspacePopoverV2`, so the behavior is at least consistent, but since issue numbers are visible in the list it's worth considering moving `setOpen(false)` and `onComplete()` into the `.then`/settled callback so the selection survives a failure.

### Issue 2 of 3
apps/desktop/src/renderer/routes/_authenticated/_dashboard/tasks/components/TasksView/components/GitHubIssuesContent/GitHubIssuesContent.tsx:23-30
**`authorLogin` field captured but never consumed**

`authorLogin` is included in `SelectedIssue` and copied into the selection map, but nothing in `RunIssuesInWorkspacePopover` — not the branch name, workspace name, or agent prompt — makes use of it. If it's intended for a future attribution feature, a comment would clarify the intent; otherwise it adds noise to the type and every selection entry.

### Issue 3 of 3
apps/desktop/src/renderer/routes/_authenticated/_dashboard/tasks/components/TasksView/components/TasksTopBar/components/RunIssuesInWorkspacePopover/RunIssuesInWorkspacePopover.tsx:119-138
**`lastProjectId` not persisted when running with the seeded default**

`setLastProjectId` is only invoked from the project-picker `onSelect` handler, not from `handleRun`. This means if a user opens the popover, accepts the `projectFilter`-seeded default without touching the picker, and clicks Run, the store's `lastProjectId` is never updated. The sibling `RunInWorkspacePopoverV2` seeds from `lastProjectId` (not `projectFilter`), so after one issues run the V2 popover may still show a stale project. Calling `setLastProjectId(selectedProjectId)` inside `handleRun` (before the early return) would keep the two flows consistent.

Reviews (1): Last reviewed commit: "feat(desktop): multi-select GitHub issue..." | Re-trigger Greptile

Comment on lines +221 to +261
hostId,
snapshot: {
id: crypto.randomUUID(),
projectId: selectedProjectId,
name: issue.title,
branch: deriveBranchName({
slug: issueSlug(issue),
title: issue.title,
}),
agents:
selectedAgent === NONE
? undefined
: [
{
agent: selectedAgent,
prompt: synthesizeIssuePrompt(issue),
},
],
},
}),
);

const promise = Promise.all(submissions).then((results) => {
const failed = results.filter((r) => !r.ok).length;
if (failed > 0) {
throw new Error(
`${results.length - failed} of ${results.length} succeeded`,
);
}
return results.length;
});

toast.promise(promise, {
loading: `Creating ${issues.length} workspace${issues.length === 1 ? "" : "s"}...`,
success: (count) => `Created ${count} workspace${count === 1 ? "" : "s"}`,
error: (err) => (err instanceof Error ? err.message : String(err)),
});

setOpen(false);
onComplete();
};
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.

P2 Selection cleared before knowing submission outcome

onComplete() is called synchronously right after toast.promise(promise, ...), so the issue selection is wiped out while workspace creations are still in-flight. If one or more creates fail, the user sees only a partial-success count in the toast (e.g. "2 of 5 succeeded") but the selection is already gone, making it impossible to identify and retry the failed issues without re-selecting them manually. The same trade-off exists in RunInWorkspacePopoverV2, so the behavior is at least consistent, but since issue numbers are visible in the list it's worth considering moving setOpen(false) and onComplete() into the .then/settled callback so the selection survives a failure.

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop/src/renderer/routes/_authenticated/_dashboard/tasks/components/TasksView/components/TasksTopBar/components/RunIssuesInWorkspacePopover/RunIssuesInWorkspacePopover.tsx
Line: 221-261

Comment:
**Selection cleared before knowing submission outcome**

`onComplete()` is called synchronously right after `toast.promise(promise, ...)`, so the issue selection is wiped out while workspace creations are still in-flight. If one or more creates fail, the user sees only a partial-success count in the toast (e.g. "2 of 5 succeeded") but the selection is already gone, making it impossible to identify and retry the failed issues without re-selecting them manually. The same trade-off exists in `RunInWorkspacePopoverV2`, so the behavior is at least consistent, but since issue numbers are visible in the list it's worth considering moving `setOpen(false)` and `onComplete()` into the `.then`/settled callback so the selection survives a failure.

How can I resolve this? If you propose a fix, please make it concise.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
apps/desktop/src/renderer/routes/_authenticated/_dashboard/tasks/components/TasksView/components/TasksTopBar/components/RunIssuesInWorkspacePopover/RunIssuesInWorkspacePopover.tsx (1)

243-251: ⚡ Quick win

Clarify the partial-failure error message.

The error message "${results.length - failed} of ${results.length} succeeded" is confusing because it emphasizes success within an error context. Users might not immediately understand that some workspaces failed to create.

📝 Proposed rewording
       const failed = results.filter((r) => !r.ok).length;
       if (failed > 0) {
         throw new Error(
-          `${results.length - failed} of ${results.length} succeeded`,
+          `Failed to create ${failed} workspace${failed === 1 ? "" : "s"}; ${results.length - failed} of ${results.length} succeeded`,
         );
       }
🤖 Prompt for 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.

In
`@apps/desktop/src/renderer/routes/_authenticated/_dashboard/tasks/components/TasksView/components/TasksTopBar/components/RunIssuesInWorkspacePopover/RunIssuesInWorkspacePopover.tsx`
around lines 243 - 251, The current Error thrown in the Promise.all handler
(inside the promise variable created from submissions) uses a success-focused
message `${results.length - failed} of ${results.length} succeeded`, which is
confusing; update the Error message in the block that throws (the throw new
Error(...) in RunIssuesInWorkspacePopover.tsx) to clearly indicate partial
failure and how many failed (for example: `${failed} of ${results.length}
workspaces failed to create`), keeping the same location and semantics so
callers still receive the Error object but with a clearer, failure-focused
message.
🤖 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/desktop/src/renderer/routes/_authenticated/_dashboard/tasks/components/TasksView/components/TasksTopBar/components/RunIssuesInWorkspacePopover/RunIssuesInWorkspacePopover.tsx`:
- Around line 89-98: The query uses activeOrganizationId ?? "" which matches
empty-string org IDs; change the logic so when activeOrganizationId is null the
query returns no results instead of comparing to "". Update the
useLiveQuery/v2Projects call: either short-circuit and return an empty array
when activeOrganizationId is null, or build the query conditionally so the
where(eq(projects.organizationId, ...)) is only applied when
activeOrganizationId is non-null (e.g., skip/replace with a false predicate),
referencing useLiveQuery, v2Projects, collections.v2Projects,
activeOrganizationId, and eq to locate the code to change.

---

Nitpick comments:
In
`@apps/desktop/src/renderer/routes/_authenticated/_dashboard/tasks/components/TasksView/components/TasksTopBar/components/RunIssuesInWorkspacePopover/RunIssuesInWorkspacePopover.tsx`:
- Around line 243-251: The current Error thrown in the Promise.all handler
(inside the promise variable created from submissions) uses a success-focused
message `${results.length - failed} of ${results.length} succeeded`, which is
confusing; update the Error message in the block that throws (the throw new
Error(...) in RunIssuesInWorkspacePopover.tsx) to clearly indicate partial
failure and how many failed (for example: `${failed} of ${results.length}
workspaces failed to create`), keeping the same location and semantics so
callers still receive the Error object but with a clearer, failure-focused
message.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: be9098be-7bf4-42f8-ab16-ffaafd21253c

📥 Commits

Reviewing files that changed from the base of the PR and between 0fb3414 and 814f95a.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (6)
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/tasks/components/TasksView/TasksView.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/tasks/components/TasksView/components/GitHubIssuesContent/GitHubIssuesContent.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/tasks/components/TasksView/components/GitHubIssuesContent/index.ts
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/tasks/components/TasksView/components/TasksTopBar/TasksTopBar.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/tasks/components/TasksView/components/TasksTopBar/components/RunIssuesInWorkspacePopover/RunIssuesInWorkspacePopover.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/tasks/components/TasksView/components/TasksTopBar/components/RunIssuesInWorkspacePopover/index.ts

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 10, 2026

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

  • ✅ Neon database branch

Thank you for your contribution! 🎉

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 7 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/desktop/src/renderer/routes/_authenticated/_dashboard/tasks/components/TasksView/components/TasksTopBar/components/RunIssuesInWorkspacePopover/RunIssuesInWorkspacePopover.tsx">

<violation number="1" location="apps/desktop/src/renderer/routes/_authenticated/_dashboard/tasks/components/TasksView/components/TasksTopBar/components/RunIssuesInWorkspacePopover/RunIssuesInWorkspacePopover.tsx:219">
P2: `setLastProjectId` is only called from the project picker's `onSelect` handler. If the user accepts the seeded default (from `projectFilter`) without touching the picker and clicks Run, the store's `lastProjectId` is never updated. This causes the sibling `RunInWorkspacePopoverV2` (which seeds from `lastProjectId`) to show a stale project after an issues run. Call `setLastProjectId(selectedProjectId)` inside `handleRun` before submitting.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

… run

- Remove unused authorLogin field from SelectedIssue
- Persist selectedProjectId to the V2 workspace defaults store inside
  handleRun so a subsequent task popover seeds from the project the
  user just ran issues against
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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/desktop/src/renderer/routes/_authenticated/_dashboard/tasks/components/TasksView/components/GitHubIssuesContent/GitHubIssuesContent.tsx`:
- Around line 138-145: The selectedIssues clear on projectFilter change can
still trigger the selection callback with the old values; update the
projectFilter useEffect (the one that calls setSelectedIssues(new Map())) to
also invoke onSelectionChange with an empty array and clearSelection (guarded by
if (onSelectionChange)) right after clearing the Map so the parent receives the
cleared selection immediately and never momentarily sees the old project’s
selections; reference setSelectedIssues, selectedIssues, projectFilter,
onSelectionChange, and clearSelection in your change.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: dc582094-8665-4d64-9d4d-7d392ae1918a

📥 Commits

Reviewing files that changed from the base of the PR and between 814f95a and cc1ba3a.

📒 Files selected for processing (2)
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/tasks/components/TasksView/components/GitHubIssuesContent/GitHubIssuesContent.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/tasks/components/TasksView/components/TasksTopBar/components/RunIssuesInWorkspacePopover/RunIssuesInWorkspacePopover.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/tasks/components/TasksView/components/TasksTopBar/components/RunIssuesInWorkspacePopover/RunIssuesInWorkspacePopover.tsx

Comment on lines +138 to +145
useEffect(() => {
setSelectedIssues(new Map());
}, [projectFilter]);

useEffect(() => {
if (!onSelectionChange) return;
onSelectionChange(Array.from(selectedIssues.values()), clearSelection);
}, [selectedIssues, clearSelection, onSelectionChange]);
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.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Prevent stale selection callback right after project switch.

At Line 138-Line 145, onSelectionChange can fire once with the old project’s selected issues before the clear state is applied. This creates a transient mismatch in the top bar state.

Suggested fix
+ const skipNextSelectionNotifyRef = useRef(false);
+
  // biome-ignore lint/correctness/useExhaustiveDependencies: clear selection only when project changes
  useEffect(() => {
+   skipNextSelectionNotifyRef.current = true;
    setSelectedIssues(new Map());
  }, [projectFilter]);

  useEffect(() => {
    if (!onSelectionChange) return;
+   if (skipNextSelectionNotifyRef.current) {
+     skipNextSelectionNotifyRef.current = false;
+     return;
+   }
    onSelectionChange(Array.from(selectedIssues.values()), clearSelection);
  }, [selectedIssues, clearSelection, onSelectionChange]);
🤖 Prompt for 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.

In
`@apps/desktop/src/renderer/routes/_authenticated/_dashboard/tasks/components/TasksView/components/GitHubIssuesContent/GitHubIssuesContent.tsx`
around lines 138 - 145, The selectedIssues clear on projectFilter change can
still trigger the selection callback with the old values; update the
projectFilter useEffect (the one that calls setSelectedIssues(new Map())) to
also invoke onSelectionChange with an empty array and clearSelection (guarded by
if (onSelectionChange)) right after clearing the Map so the parent receives the
cleared selection immediately and never momentarily sees the old project’s
selections; reference setSelectedIssues, selectedIssues, projectFilter,
onSelectionChange, and clearSelection in your change.

AviPeltz added 7 commits May 11, 2026 02:16
Move setOpen/onComplete into the promise success branch so the popover stays open and the selection survives when one or more workspace creates fail.
Passing null straight through avoids accidentally matching projects whose organizationId is "" when no org is active.
…-age

# Conflicts:
#	apps/desktop/src/renderer/routes/_authenticated/_dashboard/tasks/components/TasksView/TasksView.tsx
@capy-ai
Copy link
Copy Markdown

capy-ai Bot commented May 14, 2026

Capy auto-review is paused for this organization because the monthly auto-review limit has been reached. Increase the limit or turn it off in billing settings to resume automatic reviews.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/desktop/src/renderer/routes/_authenticated/_dashboard/tasks/components/TasksView/components/TasksTopBar/components/RunInWorkspacePopoverV2/RunInWorkspacePopoverV2.tsx (1)

88-97: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Replace eq(projects.organizationId, null) with proper null-handling logic.

TanStack DB's eq() function does not handle null parameters specially—it simply creates an equality predicate with null as a literal operand. This will not produce IS NULL semantics and relies on undefined behavior.

When activeOrganizationId is null (line 64), the query passes null to eq(), which will return no projects. While this may be the intended behavior when there's no active organization, it should be expressed explicitly using one of these approaches:

  • Conditional query: Only execute useLiveQuery when activeOrganizationId is not null; return empty data otherwise.
  • Explicit null check: Use isNull(projects.organizationId) if the intent is to match projects with null organization IDs.
  • Ensure non-null: Guarantee activeOrganizationId reaches the query as a non-null value (e.g., via default fallback).
Current code
const { data: v2Projects } = useLiveQuery(
	(q) =>
		q
			.from({ projects: collections.v2Projects })
			.where(({ projects }) =>
				eq(projects.organizationId, activeOrganizationId),
			)
			.select(({ projects }) => ({ ...projects })),
	[collections, activeOrganizationId],
);
🤖 Prompt for 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.

In
`@apps/desktop/src/renderer/routes/_authenticated/_dashboard/tasks/components/TasksView/components/TasksTopBar/components/RunInWorkspacePopoverV2/RunInWorkspacePopoverV2.tsx`
around lines 88 - 97, The query currently passes activeOrganizationId (which can
be null) into eq(), producing incorrect SQL semantics; update the where clause
in the useLiveQuery callback to handle null explicitly: when
activeOrganizationId === null use isNull(projects.organizationId), otherwise use
eq(projects.organizationId, activeOrganizationId); import and use the isNull
helper from TanStack DB and keep the same select and dependencies (useLiveQuery,
collections.v2Projects, v2Projects) so the hook returns the intended rows for
both null and non-null organization ids.
🤖 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.

Outside diff comments:
In
`@apps/desktop/src/renderer/routes/_authenticated/_dashboard/tasks/components/TasksView/components/TasksTopBar/components/RunInWorkspacePopoverV2/RunInWorkspacePopoverV2.tsx`:
- Around line 88-97: The query currently passes activeOrganizationId (which can
be null) into eq(), producing incorrect SQL semantics; update the where clause
in the useLiveQuery callback to handle null explicitly: when
activeOrganizationId === null use isNull(projects.organizationId), otherwise use
eq(projects.organizationId, activeOrganizationId); import and use the isNull
helper from TanStack DB and keep the same select and dependencies (useLiveQuery,
collections.v2Projects, v2Projects) so the hook returns the intended rows for
both null and non-null organization ids.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 00c4bfd0-0e73-4b1b-a434-8312b2089da7

📥 Commits

Reviewing files that changed from the base of the PR and between cc1ba3a and 59c8106.

📒 Files selected for processing (2)
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/tasks/components/TasksView/TasksView.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/tasks/components/TasksView/components/TasksTopBar/components/RunInWorkspacePopoverV2/RunInWorkspacePopoverV2.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/tasks/components/TasksView/TasksView.tsx

Passing null straight through avoids accidentally matching projects whose organizationId is "" when no org is active. Mirrors the same fix already applied to RunInWorkspacePopoverV2.
@AviPeltz AviPeltz merged commit a9ccbe1 into main May 14, 2026
10 checks passed
MocA-Love added a commit to MocA-Love/superset that referenced this pull request May 25, 2026
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