Skip to content
This repository was archived by the owner on Sep 2, 2026. It is now read-only.

Display merged GitHub PRs as Merged in issue state badges - #60

Merged
64ix merged 6 commits into
mainfrom
spec/31-merged-pr-status
Aug 24, 2026
Merged

64ix merged 6 commits into
mainfrom
spec/31-merged-pr-status

Conversation

@64ix

@64ix 64ix commented Aug 23, 2026 •

Copy link
Copy Markdown
Owner
Files Added Deleted Net
Test 6 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​232 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​232
Prod 7 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​79 $\color{#cf222e}{\Huge{\mathbf{−}}}$​18 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​61

Summary

Linked GitHub items that are actually merged pull requests rendered as Open/Closed because every issue-shaped surface — REST /issues/{n}, gh issue view, and the issue state badges built on them — had no concept of merged. This change threads merge evidence through the mapping layers and renders a purple Merged state consistently.

Spec & Tickets

Closes stablyai#31

No child tickets — the spec was implemented as a single ticket (spec/31-ticket-spec) plus one review-fixes pass (spec/31-review-fixes).

Criteria

Criterion Verdict Evidence
Issue-shaped payloads for merged PRs map to merged ✅ mapIssueState in src/main/github/mappers.ts; unit-tested in mappers.test.ts
gh issue view fallback rejects PRs like the guarded API path ✅ work-item-fetch.ts guard + work-item-fetch.test.ts
Renderer shows Merged wherever issue states render ✅ IssueStateBadge, task-page status helpers, getStateLabel; tests per module
Merged badge matches existing merged vocabulary ✅ Shared MergedBadge/PURPLE_TONE, same classes/icon as ReviewStateBadge
GitLab MR paths untouched ✅ Diff confined to src/main/github/*, shared GitHub types, renderer GitHub components

Changes

Mapping (main process)

  • New exported mapIssueState(state, mergeEvidence?) centralizing the open/closed/merged decision
  • mapIssueWorkItem detects PR merge evidence; type stays issue so linked-issue id prefixes remain stable
  • fetchIssueWorkItem fallback now rejects pull_request payloads

Renderer

  • IssueStateBadge gains a Merged branch reusing ReviewStateBadge's exact vocabulary (purple tone + GitMerge icon)
  • Task-page status label/tone helpers and work-item-state-presentation.getStateLabel handle 'merged' for issue-typed items

Types

  • IssueState widened additively to include 'merged'

QA plan

  • Attach a merged PR number to a workspace card → chip shows purple "State: Merged" (not Open/Closed)
  • Attach an open issue → green Open pill unchanged; closed issue → rose Closed pill unchanged
  • A linked item whose fetch resolves through the issues endpoint but is a merged PR → still shows Merged
  • GitLab MR chips unchanged

64ix added 6 commits August 23, 2026 10:17
Issue-shaped surfaces (REST /issues/{n}, gh issue view) report a merged
PR as state 'closed'. Detect merge evidence in mapIssueInfo and
mapIssueWorkItem to surface 'merged', guard the fetchIssueWorkItem
fallback against PR payloads, and render a Merged badge in
IssueStateBadge matching the PR badge vocabulary.

#31
@64ix
64ix marked this pull request as ready for review August 23, 2026 12:42
@64ix
64ix merged commit 48a02d5 into main Aug 24, 2026
95 checks passed
@64ix
64ix deleted the spec/31-merged-pr-status branch August 24, 2026 08:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

We don't display closed PR as "merged" status

1 participant