Skip to content

[codex] fix closed picker filters#3702

Merged
Kitenite merged 2 commits intomainfrom
lacy-chamomile
Apr 24, 2026
Merged

[codex] fix closed picker filters#3702
Kitenite merged 2 commits intomainfrom
lacy-chamomile

Conversation

@Kitenite
Copy link
Copy Markdown
Collaborator

@Kitenite Kitenite commented Apr 24, 2026

What changed

  • Default GitHub issue, task, and pull request pickers to open items only.
  • Add a Show closed checkbox to include closed issues/tasks/PRs on demand.
  • Fix v2 host-service PR search so merged PRs are detected from merged_at and displayed as merged rather than plain closed.
  • Thread the same includeClosed behavior through the legacy desktop projects tRPC picker endpoints.

Why

Closed items were appearing in picker results by default, and REST/search PR results did not distinguish merged PRs from closed PRs. That made the v2 PR picker/status UI lose useful state and made closed work too easy to select accidentally.

Validation

  • bun run --cwd packages/host-service typecheck
  • bun run --cwd apps/desktop typecheck
  • bunx @biomejs/biome@2.4.2 check ... on touched files

Summary by cubic

Default GitHub issue, PR, and local task pickers now show only open items by default. Added a “Show closed” toggle and ensured merged PRs are labeled correctly.

  • Bug Fixes

    • Closed items hidden by default in all pickers; local tasks filter out completed/canceled.
    • host-service PR state uses merged_at to show “merged” instead of “closed”; direct number lookups exclude closed items when includeClosed is false.
  • New Features

    • Added a “Show closed” checkbox to all pickers (issues, PRs, and local tasks).
    • Picker APIs accept an includeClosed flag across host-service and desktop projects endpoints, switching GitHub queries between open and all.

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

Summary by CodeRabbit

  • New Features
    • Added "Show closed" toggle filters to pull request and issue selection interfaces, enabling users to include or exclude closed items when searching or browsing recent PRs and issues.
    • Improved filtering behavior to provide consistent open/closed status handling across all pull request and issue selection flows.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 24, 2026

📝 Walkthrough

Walkthrough

This PR adds an optional includeClosed boolean parameter to pull request and issue queries across the tRPC API, allowing filtering between open and closed items. Frontend components add "Show closed" checkboxes in various link command UIs, passing the toggle state to backend queries which conditionally filter results based on item status.

Changes

Cohort / File(s) Summary
Backend tRPC Router Configuration
apps/desktop/src/lib/trpc/routers/projects/projects.ts, packages/host-service/src/trpc/router/workspace-creation/schemas.ts
Added optional includeClosed parameter to listPullRequests, searchPullRequests, and listIssues input schemas; updated GitHub CLI --state flag to resolve conditionally based on parameter value.
Backend Search & Filter Logic
packages/host-service/src/trpc/router/workspace-creation/procedures/search-pull-requests.ts, packages/host-service/src/trpc/router/workspace-creation/procedures/search-github-issues.ts
Implemented status filtering in GitHub API queries: conditionally appends is:open filter when includeClosed is false; added PR state normalization to distinguish merged status; applied early result suppression for closed items when filtering is active.
Desktop UI: Issue Link Commands
apps/desktop/src/renderer/components/Chat/.../IssueLinkCommand.tsx, apps/desktop/src/renderer/components/NewWorkspaceModal/.../GitHubIssueLinkCommand/GitHubIssueLinkCommand.tsx, apps/desktop/src/renderer/routes/_authenticated/.../GitHubIssueLinkCommand/GitHubIssueLinkCommand.tsx
Added "Show closed" checkbox with stable useId identifiers; updated Fuse search and task list filtering to respect closed-status logic; adjusted empty-state and heading text to reflect inclusion of closed issues.
Desktop UI: PR Link Commands
apps/desktop/src/renderer/components/NewWorkspaceModal/.../PRLinkCommand/PRLinkCommand.tsx, apps/desktop/src/renderer/routes/_authenticated/.../PRLinkCommand/PRLinkCommand.tsx
Added "Show closed" checkbox; integrated includeClosed parameter into both search and list queries; updated UI messaging and command group headings based on closed-PR visibility toggle.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Poem

🐰 A checkbox springs to life today,
Closed issues hidden, then on display!
From UI clicks to database calls,
The filter flows through tRPC halls,
Now users peek behind the veil. 🎉

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.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 '[codex] fix closed picker filters' clearly summarizes the main change: fixing the default behavior of closed item filters in pickers.
Description check ✅ Passed The PR description covers all key aspects: what changed, why it was changed, and validation steps performed. It provides clear, specific details about the implementation.
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 lacy-chamomile

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.

@Kitenite Kitenite marked this pull request as ready for review April 24, 2026 06:52
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 24, 2026

Greptile Summary

This PR defaults all GitHub issue, task, and PR pickers to open items only and adds a "Show closed" checkbox to opt-in to closed/merged results. It also fixes the v2 host-service PR search to correctly distinguish merged PRs (via merged_at) from plain closed ones.

  • P1 – URL-paste silently blocked for closed items (workspace-creation.ts lines 1566–1568 and 1645–1647): when a user pastes a direct URL for a closed issue or merged PR and showClosed is false (the default), the direct-lookup path returns an empty result with no indication that the item exists. Users must first toggle "Show closed" and re-paste, which is a surprising regression from the previous behavior.

Confidence Score: 4/5

Safe to merge after addressing the URL-paste regression for closed/merged items.

One P1 issue: pasting a URL for a closed issue or merged PR silently returns empty results when showClosed is false. All other findings are P2 style/cleanup. The core feature (open-by-default + Show closed toggle) and the merged-PR detection logic are correct.

packages/host-service/src/trpc/router/workspace-creation/workspace-creation.ts — the direct-URL lookup branches for both issues and PRs.

Important Files Changed

Filename Overview
packages/host-service/src/trpc/router/workspace-creation/workspace-creation.ts Adds includeClosed to searchGitHubIssues and searchPullRequests; introduces normalizePullRequestState; direct-URL lookup now silently returns empty for closed/merged items when includeClosed is false (P1).
apps/desktop/src/lib/trpc/routers/projects/projects.ts Adds optional includeClosed to listPullRequests, searchPullRequests, and listIssues; gh CLI state flag switches between "open" and "all" correctly.
apps/desktop/src/renderer/components/Chat/ChatInterface/components/IssueLinkCommand/IssueLinkCommand.tsx Adds Show-closed checkbox for local tasks; filter logic is duplicated between Fuse construction and filteredTasks, but functionally correct.
apps/desktop/src/renderer/routes/_authenticated/components/DashboardNewWorkspaceModal/components/DashboardNewWorkspaceForm/PromptGroup/components/PRLinkCommand/PRLinkCommand.tsx Adds Show-closed checkbox; minor wording inconsistency in empty-state messages ("found" vs no "found").
apps/desktop/src/renderer/components/NewWorkspaceModal/components/PromptGroup/components/GitHubIssueLinkCommand/GitHubIssueLinkCommand.tsx Adds Show-closed checkbox; passes includeClosed to the tRPC query; UI labels update correctly.
apps/desktop/src/renderer/components/NewWorkspaceModal/components/PromptGroup/components/PRLinkCommand/PRLinkCommand.tsx Adds Show-closed checkbox; passes includeClosed to both listPullRequests and searchPullRequests queries.
apps/desktop/src/renderer/routes/_authenticated/components/DashboardNewWorkspaceModal/components/DashboardNewWorkspaceForm/PromptGroup/components/GitHubIssueLinkCommand/GitHubIssueLinkCommand.tsx Adds Show-closed checkbox; includeClosed is threaded into the query key and queryFn correctly.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[User opens picker] --> B{showClosed?}
    B -- false --> C[Query: is:open filter applied]
    B -- true --> D[Query: no state filter]
    C --> E{Direct URL paste?}
    D --> E
    E -- yes, includeClosed=false --> F{item.state === open?}
    F -- no --> G[⚠️ Return empty — user sees No items found]
    F -- yes --> H[Return item]
    E -- yes, includeClosed=true --> H
    E -- no --> I[GitHub search / gh CLI list]
    I --> J[Results shown in CommandList]
    H --> J
Loading
Prompt To Fix All With AI
This is a comment left during a code review.
Path: packages/host-service/src/trpc/router/workspace-creation/workspace-creation.ts
Line: 1566-1568

Comment:
**Closed-item URL paste silently returns empty**

When a user pastes a URL for a specific closed issue or merged PR directly into the picker (e.g. `https://github.com/org/repo/issues/42` for a closed issue), the direct-lookup path now returns `{ issues: [] }` unless `includeClosed` is already checked. Since `showClosed` defaults to `false`, the user sees "No issues found" with no hint that the issue exists but is filtered — they must first toggle "Show closed" and then re-paste the URL. This is a surprising regression for the URL-paste workflow, which was previously always able to resolve a specific item by number.

The same applies to the PR path at line 1645.

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

---

This is a comment left during a code review.
Path: apps/desktop/src/renderer/components/Chat/ChatInterface/components/IssueLinkCommand/IssueLinkCommand.tsx
Line: 93-115

Comment:
**Duplicate filter computation**

The closed-status filter is computed in two places: once to build the Fuse index (lines 93–100) and again inside `filteredTasks` for the no-search-query branch (lines 110–115). When a search query is active the results come from `taskFuse`, which already excludes closed items, so the second filter is never needed for that path. Consider deriving a single `visibleTasks` array outside both `useMemo` calls and reusing it as the Fuse input.

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

---

This is a comment left during a code review.
Path: apps/desktop/src/renderer/routes/_authenticated/components/DashboardNewWorkspaceModal/components/DashboardNewWorkspaceForm/PromptGroup/components/PRLinkCommand/PRLinkCommand.tsx
Line: 157-162

Comment:
**Inconsistent empty-state wording**

When a search query is active and nothing is found, the message is `"No open pull requests found."`, but when the list is simply empty with no query the message is `"No open pull requests."` (no "found"). The sibling `NewWorkspaceModal` `PRLinkCommand` uses "No open pull requests." consistently for both cases. Pick one form and apply it uniformly.

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

Reviews (1): Last reviewed commit: "fix closed picker filters" | Re-trigger Greptile

Comment on lines +1566 to +1568
if (!input.includeClosed && issue.state !== "open") {
return { issues: [] };
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Closed-item URL paste silently returns empty

When a user pastes a URL for a specific closed issue or merged PR directly into the picker (e.g. https://github.com/org/repo/issues/42 for a closed issue), the direct-lookup path now returns { issues: [] } unless includeClosed is already checked. Since showClosed defaults to false, the user sees "No issues found" with no hint that the issue exists but is filtered — they must first toggle "Show closed" and then re-paste the URL. This is a surprising regression for the URL-paste workflow, which was previously always able to resolve a specific item by number.

The same applies to the PR path at line 1645.

Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/host-service/src/trpc/router/workspace-creation/workspace-creation.ts
Line: 1566-1568

Comment:
**Closed-item URL paste silently returns empty**

When a user pastes a URL for a specific closed issue or merged PR directly into the picker (e.g. `https://github.com/org/repo/issues/42` for a closed issue), the direct-lookup path now returns `{ issues: [] }` unless `includeClosed` is already checked. Since `showClosed` defaults to `false`, the user sees "No issues found" with no hint that the issue exists but is filtered — they must first toggle "Show closed" and then re-paste the URL. This is a surprising regression for the URL-paste workflow, which was previously always able to resolve a specific item by number.

The same applies to the PR path at line 1645.

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

Comment on lines +93 to +115
(allTasks ?? []).filter((task) => {
if (showClosed) return true;
const status = task.statusId
? statusMap.get(task.statusId)
: undefined;
return !isClosedStatus(status?.type);
}),
{
keys: [
{ name: "slug", weight: 3 },
{ name: "title", weight: 2 },
],
threshold: 0.4,
ignoreLocation: true,
},
),
[allTasks, showClosed, statusMap],
);

const filteredTasks = useMemo(() => {
if (!allTasks?.length) return [];
const visibleTasks = allTasks.filter((task) => {
if (showClosed) return true;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Duplicate filter computation

The closed-status filter is computed in two places: once to build the Fuse index (lines 93–100) and again inside filteredTasks for the no-search-query branch (lines 110–115). When a search query is active the results come from taskFuse, which already excludes closed items, so the second filter is never needed for that path. Consider deriving a single visibleTasks array outside both useMemo calls and reusing it as the Fuse input.

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop/src/renderer/components/Chat/ChatInterface/components/IssueLinkCommand/IssueLinkCommand.tsx
Line: 93-115

Comment:
**Duplicate filter computation**

The closed-status filter is computed in two places: once to build the Fuse index (lines 93–100) and again inside `filteredTasks` for the no-search-query branch (lines 110–115). When a search query is active the results come from `taskFuse`, which already excludes closed items, so the second filter is never needed for that path. Consider deriving a single `visibleTasks` array outside both `useMemo` calls and reusing it as the Fuse input.

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

Comment on lines 157 to +162
: repoMismatch
? `PR URL must match ${repoMismatch}.`
: debouncedTrimmed
? "No pull requests found."
: "No pull requests found."}
? showClosed
? "No pull requests found."
: "No open pull requests found."
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Inconsistent empty-state wording

When a search query is active and nothing is found, the message is "No open pull requests found.", but when the list is simply empty with no query the message is "No open pull requests." (no "found"). The sibling NewWorkspaceModal PRLinkCommand uses "No open pull requests." consistently for both cases. Pick one form and apply it uniformly.

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop/src/renderer/routes/_authenticated/components/DashboardNewWorkspaceModal/components/DashboardNewWorkspaceForm/PromptGroup/components/PRLinkCommand/PRLinkCommand.tsx
Line: 157-162

Comment:
**Inconsistent empty-state wording**

When a search query is active and nothing is found, the message is `"No open pull requests found."`, but when the list is simply empty with no query the message is `"No open pull requests."` (no "found"). The sibling `NewWorkspaceModal` `PRLinkCommand` uses "No open pull requests." consistently for both cases. Pick one form and apply it uniformly.

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

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/components/NewWorkspaceModal/components/PromptGroup/components/PRLinkCommand/PRLinkCommand.tsx (1)

188-211: ⚠️ Potential issue | 🟡 Minor

Empty-state copy doesn't tell the user closed PRs are filtered out when they search.

When showClosed=false and the user has typed a query with no results, the message is a flat "No pull requests found." — the sibling DashboardNewWorkspaceModal/PRLinkCommand.tsx handles this by saying "No open pull requests found." in the same state, which is a clearer hint. Also minor: "No open pull requests." (Line 200) drops the trailing "found" that the other branches include. Consider aligning the wording across both pickers.

Suggested consolidation
-									: debouncedTrimmed
-										? "No pull requests found."
-										: showClosed
-											? "No pull requests found."
-											: "No open pull requests."}
+									: showClosed
+										? "No pull requests found."
+										: "No open pull requests found."}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@apps/desktop/src/renderer/components/NewWorkspaceModal/components/PromptGroup/components/PRLinkCommand/PRLinkCommand.tsx`
around lines 188 - 211, Update the empty-state copy logic in PRLinkCommand
(PRLinkCommand.tsx) so the message for the case when showClosed is false and the
user has typed a query (debouncedTrimmed true) explicitly mentions “open” PRs
and mirrors the sibling component wording; specifically adjust the CommandEmpty
branches that build messages using isLoading, debouncedTrimmed,
isCrossRepositoryUrl, and showClosed so the “no results” text becomes “No open
pull requests found.” (and keep the existing “No open pull requests found.” or
“No pull requests found.” consistency across other branches) ensuring the same
phrasing used in DashboardNewWorkspaceModal/PRLinkCommand.tsx is applied.
🧹 Nitpick comments (2)
apps/desktop/src/renderer/routes/_authenticated/components/DashboardNewWorkspaceModal/components/DashboardNewWorkspaceForm/PromptGroup/components/GitHubIssueLinkCommand/GitHubIssueLinkCommand.tsx (1)

158-165: Redundant nested ternary — both branches produce the same output.

The debouncedTrimmed branch and the !debouncedTrimmed branch here resolve to the identical pair of strings, so the outer conditional has no effect. Collapse to a single showClosed check.

Proposed simplification
-										: debouncedTrimmed
-											? showClosed
-												? "No issues found."
-												: "No open issues found."
-											: showClosed
-												? "No issues found."
-												: "No open issues found."}
+										: showClosed
+											? "No issues found."
+											: "No open issues found."}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@apps/desktop/src/renderer/routes/_authenticated/components/DashboardNewWorkspaceModal/components/DashboardNewWorkspaceForm/PromptGroup/components/GitHubIssueLinkCommand/GitHubIssueLinkCommand.tsx`
around lines 158 - 165, The nested ternary inside the CommandEmpty JSX in
GitHubIssueLinkCommand.tsx is redundant because both debouncedTrimmed branches
produce the same strings; replace the entire conditional expression that
currently uses debouncedTrimmed and showClosed with a single check on showClosed
(e.g., showClosed ? "No issues found." : "No open issues found.") so
CommandEmpty renders the same text without the unnecessary debouncedTrimmed
branch.
apps/desktop/src/renderer/components/Chat/ChatInterface/components/IssueLinkCommand/IssueLinkCommand.tsx (1)

90-130: Optional: extract the open/closed filter to avoid duplicating the predicate.

The same showClosed + isClosedStatus(statusMap.get(task.statusId)?.type) filter runs in both taskFuse (Lines 93-99) and filteredTasks (Lines 114-118). Extracting a single memoized visibleTasks keeps the two paths in sync and drops one scan of allTasks.

Sketch
+	const visibleTasks = useMemo(() => {
+		if (!allTasks?.length) return [];
+		if (showClosed) return allTasks;
+		return allTasks.filter((task) => {
+			const status = task.statusId ? statusMap.get(task.statusId) : undefined;
+			return !isClosedStatus(status?.type);
+		});
+	}, [allTasks, showClosed, statusMap]);
+
 	const taskFuse = useMemo(
 		() =>
-			new Fuse(
-				(allTasks ?? []).filter((task) => {
-					if (showClosed) return true;
-					const status = task.statusId
-						? statusMap.get(task.statusId)
-						: undefined;
-					return !isClosedStatus(status?.type);
-				}),
-				{ ... },
-			),
-		[allTasks, showClosed, statusMap],
+			new Fuse(visibleTasks, { ... }),
+		[visibleTasks],
 	);

 	const filteredTasks = useMemo(() => {
-		if (!allTasks?.length) return [];
-		const visibleTasks = allTasks.filter((task) => { ... });
 		if (!searchQuery) {
 			return visibleTasks.sort(...).slice(0, MAX_RESULTS);
 		}
 		return taskFuse.search(searchQuery, { limit: MAX_RESULTS }).map((r) => r.item);
-	}, [allTasks, searchQuery, showClosed, statusMap, taskFuse]);
+	}, [visibleTasks, searchQuery, taskFuse]);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@apps/desktop/src/renderer/components/Chat/ChatInterface/components/IssueLinkCommand/IssueLinkCommand.tsx`
around lines 90 - 130, The open/closed filtering logic is duplicated in taskFuse
and filteredTasks; extract it into a single memoized visibleTasks using useMemo
(dependant on allTasks, showClosed, statusMap, isClosedStatus) and use that in
both taskFuse (replace (allTasks ?? []).filter(...) with visibleTasks) and
filteredTasks (use visibleTasks for the no-search branch and for creating
taskFuse results), keeping the same sort/limit (MAX_RESULTS) and preserving
taskFuse, filteredTasks, and MAX_RESULTS identifiers and their existing useMemo
dependency lists.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@apps/desktop/src/renderer/routes/_authenticated/components/DashboardNewWorkspaceModal/components/DashboardNewWorkspaceForm/PromptGroup/components/PRLinkCommand/PRLinkCommand.tsx`:
- Around line 159-165: The nested ternary in PRLinkCommand using
debouncedTrimmed and showClosed is redundant and inconsistent ("No open pull
requests." lacks "found."); replace the whole expression with a single check on
showClosed and make both branches end with "found." — e.g. use showClosed ? "No
pull requests found." : "No open pull requests found." — remove the outer
ternary on debouncedTrimmed and ensure the strings are used where the current
nested ternary is returned.

---

Outside diff comments:
In
`@apps/desktop/src/renderer/components/NewWorkspaceModal/components/PromptGroup/components/PRLinkCommand/PRLinkCommand.tsx`:
- Around line 188-211: Update the empty-state copy logic in PRLinkCommand
(PRLinkCommand.tsx) so the message for the case when showClosed is false and the
user has typed a query (debouncedTrimmed true) explicitly mentions “open” PRs
and mirrors the sibling component wording; specifically adjust the CommandEmpty
branches that build messages using isLoading, debouncedTrimmed,
isCrossRepositoryUrl, and showClosed so the “no results” text becomes “No open
pull requests found.” (and keep the existing “No open pull requests found.” or
“No pull requests found.” consistency across other branches) ensuring the same
phrasing used in DashboardNewWorkspaceModal/PRLinkCommand.tsx is applied.

---

Nitpick comments:
In
`@apps/desktop/src/renderer/components/Chat/ChatInterface/components/IssueLinkCommand/IssueLinkCommand.tsx`:
- Around line 90-130: The open/closed filtering logic is duplicated in taskFuse
and filteredTasks; extract it into a single memoized visibleTasks using useMemo
(dependant on allTasks, showClosed, statusMap, isClosedStatus) and use that in
both taskFuse (replace (allTasks ?? []).filter(...) with visibleTasks) and
filteredTasks (use visibleTasks for the no-search branch and for creating
taskFuse results), keeping the same sort/limit (MAX_RESULTS) and preserving
taskFuse, filteredTasks, and MAX_RESULTS identifiers and their existing useMemo
dependency lists.

In
`@apps/desktop/src/renderer/routes/_authenticated/components/DashboardNewWorkspaceModal/components/DashboardNewWorkspaceForm/PromptGroup/components/GitHubIssueLinkCommand/GitHubIssueLinkCommand.tsx`:
- Around line 158-165: The nested ternary inside the CommandEmpty JSX in
GitHubIssueLinkCommand.tsx is redundant because both debouncedTrimmed branches
produce the same strings; replace the entire conditional expression that
currently uses debouncedTrimmed and showClosed with a single check on showClosed
(e.g., showClosed ? "No issues found." : "No open issues found.") so
CommandEmpty renders the same text without the unnecessary debouncedTrimmed
branch.
🪄 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: 71c59778-4f73-4696-ae2f-3a3cffbe27d2

📥 Commits

Reviewing files that changed from the base of the PR and between 167542e and a68a90d.

📒 Files selected for processing (7)
  • apps/desktop/src/lib/trpc/routers/projects/projects.ts
  • apps/desktop/src/renderer/components/Chat/ChatInterface/components/IssueLinkCommand/IssueLinkCommand.tsx
  • apps/desktop/src/renderer/components/NewWorkspaceModal/components/PromptGroup/components/GitHubIssueLinkCommand/GitHubIssueLinkCommand.tsx
  • apps/desktop/src/renderer/components/NewWorkspaceModal/components/PromptGroup/components/PRLinkCommand/PRLinkCommand.tsx
  • apps/desktop/src/renderer/routes/_authenticated/components/DashboardNewWorkspaceModal/components/DashboardNewWorkspaceForm/PromptGroup/components/GitHubIssueLinkCommand/GitHubIssueLinkCommand.tsx
  • apps/desktop/src/renderer/routes/_authenticated/components/DashboardNewWorkspaceModal/components/DashboardNewWorkspaceForm/PromptGroup/components/PRLinkCommand/PRLinkCommand.tsx
  • packages/host-service/src/trpc/router/workspace-creation/workspace-creation.ts

Comment on lines 159 to +165
: debouncedTrimmed
? "No pull requests found."
: "No pull requests found."}
? showClosed
? "No pull requests found."
: "No open pull requests found."
: showClosed
? "No pull requests found."
: "No open pull requests."}
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

Minor wording inconsistency + mostly-redundant outer ternary.

Three of the four branches say "...found." but "No open pull requests." (Line 165) drops the trailing "found.". Beyond consistency, note that the showClosed arms on both sides of debouncedTrimmed produce the same "No pull requests found." — the outer ternary only differentiates the !showClosed case. Easy to collapse:

Proposed simplification
-										: debouncedTrimmed
-											? showClosed
-												? "No pull requests found."
-												: "No open pull requests found."
-											: showClosed
-												? "No pull requests found."
-												: "No open pull requests."}
+										: showClosed
+											? "No pull requests found."
+											: "No open pull requests found."}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@apps/desktop/src/renderer/routes/_authenticated/components/DashboardNewWorkspaceModal/components/DashboardNewWorkspaceForm/PromptGroup/components/PRLinkCommand/PRLinkCommand.tsx`
around lines 159 - 165, The nested ternary in PRLinkCommand using
debouncedTrimmed and showClosed is redundant and inconsistent ("No open pull
requests." lacks "found."); replace the whole expression with a single check on
showClosed and make both branches end with "found." — e.g. use showClosed ? "No
pull requests found." : "No open pull requests found." — remove the outer
ternary on debouncedTrimmed and ensure the strings are used where the current
nested ternary is returned.

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.

No issues found across 7 files

# Conflicts:
#	packages/host-service/src/trpc/router/workspace-creation/workspace-creation.ts
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.

🧹 Nitpick comments (1)
packages/host-service/src/trpc/router/workspace-creation/procedures/search-pull-requests.ts (1)

61-63: Nit: double space in the built query when includeClosed is true.

When stateFilter is "", the template yields repo:... is:pr ${effectiveQuery} with two spaces between is:pr and the query; .trim() only strips leading/trailing whitespace, not internal. GitHub's search API tolerates it, so this is purely cosmetic, but a small tweak keeps the constructed query tidy:

♻️ Optional cleanup
-			const stateFilter = input.includeClosed ? "" : " is:open";
-			const query =
-				`repo:${repo.owner}/${repo.name} is:pr${stateFilter} ${effectiveQuery}`.trim();
+			const stateFilter = input.includeClosed ? "" : "is:open";
+			const query = [
+				`repo:${repo.owner}/${repo.name}`,
+				"is:pr",
+				stateFilter,
+				effectiveQuery,
+			]
+				.filter(Boolean)
+				.join(" ");
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@packages/host-service/src/trpc/router/workspace-creation/procedures/search-pull-requests.ts`
around lines 61 - 63, The constructed query string in search-pull-requests.ts
can contain a double space when stateFilter is an empty string (caused by
`stateFilter` + `effectiveQuery`), so update the `query` construction (where
`stateFilter`, `query`, `includeClosed`, `effectiveQuery`, and
`repo.owner`/`repo.name` are used) to avoid inserting an extra space: build the
parts conditionally or join non-empty segments (e.g., include the space only
when `stateFilter` is non-empty or use an array of segments and
.filter(Boolean).join(' ')) so the final `query` has single spacing without
relying on .trim().
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In
`@packages/host-service/src/trpc/router/workspace-creation/procedures/search-pull-requests.ts`:
- Around line 61-63: The constructed query string in search-pull-requests.ts can
contain a double space when stateFilter is an empty string (caused by
`stateFilter` + `effectiveQuery`), so update the `query` construction (where
`stateFilter`, `query`, `includeClosed`, `effectiveQuery`, and
`repo.owner`/`repo.name` are used) to avoid inserting an extra space: build the
parts conditionally or join non-empty segments (e.g., include the space only
when `stateFilter` is non-empty or use an array of segments and
.filter(Boolean).join(' ')) so the final `query` has single spacing without
relying on .trim().

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: bcd81c74-4646-469a-bd0b-8f816179dbe1

📥 Commits

Reviewing files that changed from the base of the PR and between a68a90d and acac6bc.

📒 Files selected for processing (3)
  • packages/host-service/src/trpc/router/workspace-creation/procedures/search-github-issues.ts
  • packages/host-service/src/trpc/router/workspace-creation/procedures/search-pull-requests.ts
  • packages/host-service/src/trpc/router/workspace-creation/schemas.ts
✅ Files skipped from review due to trivial changes (1)
  • packages/host-service/src/trpc/router/workspace-creation/schemas.ts

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 24, 2026

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

  • ✅ Neon database branch

Thank you for your contribution! 🎉

@Kitenite Kitenite merged commit 5aab22a into main Apr 24, 2026
14 checks passed
@Kitenite Kitenite deleted the lacy-chamomile branch April 24, 2026 23:24
MocA-Love pushed a commit to MocA-Love/superset that referenced this pull request Apr 25, 2026
MocA-Love added a commit to MocA-Love/superset that referenced this pull request Apr 25, 2026
upstream の 10 commits は #426#427 で fork 固有の差分を保ちながら個別に
cherry-pick 取り込み済み。本 merge は ours strategy で **記録だけ** マージ済みに
することで behind=0 を達成し、git 履歴上の追跡を正しくする。

Cherry-pick 取り込み済 (PR #426):
- 5aab22a fix closed picker filters (superset-sh#3702) → cdb52f9
- 99db5be [codex] simplify workspace controls (superset-sh#3714) → f079606
- 186078a fix(chat): prevent ask_user question from shadowing sandbox access prompt (superset-sh#3662) → 09d6b57
- 47893c2 fix desktop workspace creation title clamp (superset-sh#3718) → 6a8c4ae
- 09323ff Add diff pane file viewer action (superset-sh#3715) → 817ed8d
- a5891c6 remove pending launch log (superset-sh#3721) → 0764d03
- c83de0c Add Tiptap table support (superset-sh#3719) → e67a885
- 486b621 [codex] Fix v2 terminal lifecycle after sleep (superset-sh#3711) → b71fbbb (+ #426 内 review fixups)

Cherry-pick 取り込み済 (PR #427):
- e07aef6 feat(desktop): play v2 notification hooks client-side (superset-sh#3675) → 27ac18a
- eae6008 [codex] Port v2 terminal hotkeys to v1 (superset-sh#3724) → 05a77b8 (+ #427 内 Windows .ps1 v2 化)

Fork 固有領域は変更ゼロで保持: 19 tRPC procedures (workspaces.githubExtended)、
AudioScheduler / Aivis TTS / notification-manager、terminal suggestion handler
(新 terminalKeyboardHandler.ts に移植)、TERMINAL_OPTIONS、SUPERSET_WORKSPACE_NAME、
MainWindowEffects、INCEPTION_AUTH_PROVIDER_ID、v1MigrationState、TiptapPromptEditor、
electron-builder.ts (dmg.size="4g", fileAssociations)、Service Status Dashboard、
Linux daemon systemd、Worktree auto-sync、Windows support、DnD scratch route 他。
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