Skip to content

fix: show draft PR status icon#2096

Merged
arnestrickmann merged 1 commit into
mainfrom
jan/eng-1322-add-correct-sidebar-icon-for-draft-prs
May 18, 2026
Merged

fix: show draft PR status icon#2096
arnestrickmann merged 1 commit into
mainfrom
jan/eng-1322-add-correct-sidebar-icon-for-draft-prs

Conversation

@janburzinski
Copy link
Copy Markdown
Collaborator

image

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 18, 2026

Greptile Summary

This PR fixes a missing draft PR status icon by refactoring StatusIcon to accept the full pr object (typed as Pick<PullRequest, 'status' | 'isDraft'>) instead of just status, then adding a status === 'open' && isDraft branch that renders the GitPullRequestDraft icon with a "Draft" tooltip.

  • All four callsites (pr-row, pr-entry, and both variants in pr-badge) are consistently updated to pass pr={pr} instead of status={pr.status}, and TypeScript will catch any missed callsite at compile time.
  • The draft branch is correctly ordered after merged and closed checks, so the draft icon only appears for open draft PRs.

Confidence Score: 5/5

Safe to merge — a narrowly scoped display fix with no logic or data changes.

The change only affects how the status icon is rendered. The isDraft field is a non-nullable boolean on PullRequest, so the new branch cannot throw. All existing callsites were updated in the same commit, and TypeScript's type checker would surface any missed usage. Closed and merged PRs are unaffected by the new branch ordering.

No files require special attention.

Important Files Changed

Filename Overview
src/renderer/lib/components/pr-status-icon.tsx Core change: accepts a pr object (with status and isDraft) instead of just status; adds a draft-PR branch that renders GitPullRequestDraft when status === 'open' && isDraft.
src/renderer/features/projects/components/pr-view/pr-row.tsx Callsite updated from status={pr.status} to pr={pr} to match the new StatusIcon signature.
src/renderer/features/tasks/diff-view/changes-panel/components/pr-entry/pr-entry.tsx Removed now-unused prStatus local variable; updated StatusIcon callsite to pr={pr}.
src/renderer/lib/components/pr-badge.tsx All three StatusIcon callsites updated from status={pr.status} to pr={pr}; no logic changes.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[StatusIcon receives pr object] --> B{status === 'merged'?}
    B -- yes --> C[GitMerge icon 'Merged' tooltip]
    B -- no --> D{status === 'closed'?}
    D -- yes --> E[GitPullRequestClosed icon 'Closed' tooltip]
    D -- no --> F{status === 'open' AND isDraft?}
    F -- yes --> G[GitPullRequestDraft icon 'Draft' tooltip]
    F -- no --> H[GitPullRequestArrow icon 'Open' tooltip]
Loading

Reviews (1): Last reviewed commit: "fix: show draft PR status icon" | Re-trigger Greptile

Copy link
Copy Markdown
Contributor

@arnestrickmann arnestrickmann left a comment

Choose a reason for hiding this comment

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

lgtm

@arnestrickmann arnestrickmann merged commit 41a10a7 into main May 18, 2026
1 check passed
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.

2 participants