Skip to content

feat(code): suggest PR work items on new task page#2553

Draft
adboio wants to merge 1 commit into
mainfrom
06-09-feat_code_suggest_pr_work_items_on_new_task_page
Draft

feat(code): suggest PR work items on new task page#2553
adboio wants to merge 1 commit into
mainfrom
06-09-feat_code_suggest_pr_work_items_on_new_task_page

Conversation

@adboio

@adboio adboio commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Problem

the new task page is effectively an empty text box

this is fine long-term or for existing users, but hurts new user activation imo

Changes

adds "PR work items" as suggestions below the input box. things like:

  • PRs with failing CI
  • PRs with merge conflicts
  • PRs that need you review
  • open / assigned issues

clicking a suggestion enters a prompt so the agent can help you get started

How did you test this?

manually

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

adboio commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

React Doctor found 2 issues in 2 files · 2 warnings.

2 warnings

src/renderer/features/task-detail/components/SuggestedTasksPanel.tsx

src/renderer/features/work-items/WorkItemCard.tsx

Reviewed by React Doctor for commit 4aa1c2c.

@greptile-apps

greptile-apps Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor
Prompt To Fix All With AI
Fix the following 2 code review issues. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 2
apps/code/src/shared/types/analytics.ts:908
**Duplicate type definition**

`WorkItemKind` here (`"review" | "ci" | "conflict"`) is identical to `PrWorkItemKind` already exported from `@main/services/git/schemas`. Defining the same union twice means any future change to the work-item kinds must be applied in two places. The analytics properties could instead import and reuse `PrWorkItemKind` directly, as `SuggestedTasksPanel.tsx` already imports from that path.

### Issue 2 of 2
apps/code/src/renderer/features/task-detail/components/SuggestedTasksPanel.tsx:181-184
**Unguarded Set construction in render body**

`dismissed` and `workItems` are recomputed (allocating a new `Set` and array) on every render, even when `dismissedWorkItemKeys` and `workItemsRaw` haven't changed. Wrapping both in a `useMemo` (dependencies: `dismissedWorkItemKeys`, `workItemsRaw`, `selectedDirectory`) would avoid churning downstream derived state on unrelated re-renders.

Reviews (1): Last reviewed commit: "feat(code): suggest PR work items on new..." | Re-trigger Greptile

[ANALYTICS_EVENTS.SETUP_TASK_SELECTED]: SetupTaskSelectedProperties;
[ANALYTICS_EVENTS.SETUP_TASK_DISMISSED]: SetupTaskDismissedProperties;
[ANALYTICS_EVENTS.SETUP_WORK_ITEM_SELECTED]: SetupWorkItemSelectedProperties;
[ANALYTICS_EVENTS.SETUP_WORK_ITEM_DISMISSED]: SetupWorkItemDismissedProperties;

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 Duplicate type definition

WorkItemKind here ("review" | "ci" | "conflict") is identical to PrWorkItemKind already exported from @main/services/git/schemas. Defining the same union twice means any future change to the work-item kinds must be applied in two places. The analytics properties could instead import and reuse PrWorkItemKind directly, as SuggestedTasksPanel.tsx already imports from that path.

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/code/src/shared/types/analytics.ts
Line: 908

Comment:
**Duplicate type definition**

`WorkItemKind` here (`"review" | "ci" | "conflict"`) is identical to `PrWorkItemKind` already exported from `@main/services/git/schemas`. Defining the same union twice means any future change to the work-item kinds must be applied in two places. The analytics properties could instead import and reuse `PrWorkItemKind` directly, as `SuggestedTasksPanel.tsx` already imports from that path.

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

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment on lines +181 to +184
const dismissed = new Set(dismissedWorkItemKeys);
const workItems = workItemsRaw.filter(
(item) => !dismissed.has(dismissedWorkItemKey(selectedDirectory, item)),
);

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 Unguarded Set construction in render body

dismissed and workItems are recomputed (allocating a new Set and array) on every render, even when dismissedWorkItemKeys and workItemsRaw haven't changed. Wrapping both in a useMemo (dependencies: dismissedWorkItemKeys, workItemsRaw, selectedDirectory) would avoid churning downstream derived state on unrelated re-renders.

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/code/src/renderer/features/task-detail/components/SuggestedTasksPanel.tsx
Line: 181-184

Comment:
**Unguarded Set construction in render body**

`dismissed` and `workItems` are recomputed (allocating a new `Set` and array) on every render, even when `dismissedWorkItemKeys` and `workItemsRaw` haven't changed. Wrapping both in a `useMemo` (dependencies: `dismissedWorkItemKeys`, `workItemsRaw`, `selectedDirectory`) would avoid churning downstream derived state on unrelated re-renders.

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

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

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