Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Aug 19, 2025

This PR fixes the inconsistent coloring of closed issues in the PR webview to align with GitHub.com's visual design, including support for distinguishing between issues closed as "completed" vs "not planned".

Problem

Previously, both closed issues and closed pull requests displayed with red color in the extension's webview, which was inconsistent with GitHub.com where:

  • Closed issues should display in purple (same as merged PRs) when completed
  • Closed issues should display in grey when closed as "not planned"
  • Closed pull requests should remain red

Solution

Updated the color logic to differentiate between closed issues and closed PRs using GitHub's stateReason field:

  1. Added stateReason field to GraphQL queries to fetch issue closure reason (COMPLETED vs NOT_PLANNED)
  2. Updated Issue interfaces in both interface.ts and views.ts to include the optional stateReason field
  3. Enhanced getStatus() function in webviews/components/header.tsx to accept stateReason parameter and use appropriate colors:
    • Issues closed as "not planned": grey (draft color)
    • Issues closed as "completed": purple (merged color)
    • Closed PRs: red (unchanged)
  4. Updated IssueModel to track and handle stateReason changes
  5. Enhanced markdown icon colors in src/github/markdownUtils.ts to use grey (#6a737d) for "not planned" issues and purple (#8957e5) for "completed" issues

Visual Impact

  • 🟣 Closed issues (completed): Display in purple (matching GitHub.com)
  • 🔘 Closed issues (not planned): Display in grey (matching draft PR color)
  • 🔴 Closed PRs: Continue to display in red (unchanged)
  • 🟢 Open states: Remain green for both issues and PRs (unchanged)
  • 🟣 Merged PRs: Continue to display in purple (unchanged)

This change makes the extension's visual language consistent with users' expectations from GitHub.com, improving the overall user experience and reducing confusion between different item states.

Fixes #7628.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Red "closed" on closed issues is confusing Fix issue closed state colors to match GitHub.com behavior Aug 19, 2025
Copilot AI requested a review from alexr00 August 19, 2025 11:24
Copy link
Member

@alexr00 alexr00 left a comment

Choose a reason for hiding this comment

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

@copilot Now, we are using the proper existing purple merged color for closed issues. The next step is to:

  • Determine if an issue was closed as not planned or completed
  • Use the exising grey "draft pr" color for issues closed as not planned issues.

Copy link
Contributor Author

Copilot AI commented Aug 20, 2025

@copilot Now, we are using the proper existing purple merged color for closed issues. The next step is to:

  • Determine if an issue was closed as not planned or completed
  • Use the exising grey "draft ...

I've implemented the stateReason functionality to distinguish between issues closed as "not planned" vs "completed":

Changes made in commit 1a22a03:

  • Added stateReason field to GraphQL queries to fetch closure reason
  • Updated Issue interfaces to include the stateReason field
  • Modified getStatus() function to use grey "draft" color for issues closed as NOT_PLANNED
  • Enhanced markdown icon colors to use grey (#6a737d) for not planned issues

Color behavior:

  • 🔘 Issues closed as "not planned": Grey (using existing draft PR color)
  • 🟣 Issues closed as "completed": Purple (using merged PR color)
  • 🔴 Closed PRs: Red (unchanged)

The implementation leverages GitHub's stateReason field which can be NOT_PLANNED, COMPLETED, or REOPENED for issues.

Copilot AI changed the title Fix issue closed state colors to match GitHub.com behavior Fix issue closed state colors to match GitHub.com behavior with state reason support Aug 20, 2025
Copilot AI requested a review from alexr00 August 20, 2025 13:38
@alexr00 alexr00 marked this pull request as ready for review August 20, 2025 17:13
@alexr00 alexr00 enabled auto-merge (squash) August 20, 2025 17:13
@vs-code-engineering vs-code-engineering bot added this to the August 2025 milestone Aug 20, 2025
@alexr00 alexr00 merged commit 8fd0a5c into main Aug 20, 2025
3 checks passed
@alexr00 alexr00 deleted the copilot/fix-7628 branch August 20, 2025 17:17
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.

Red "closed" on closed issues is confusing

3 participants