This repository was archived by the owner on Sep 2, 2026. It is now read-only.
Repository navigation
Display merged GitHub PRs as Merged in issue state badges - #60
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 ofmerged. 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
mergedmapIssueStateinsrc/main/github/mappers.ts; unit-tested inmappers.test.tsgh issue viewfallback rejects PRs like the guarded API pathwork-item-fetch.tsguard +work-item-fetch.test.tsIssueStateBadge, task-page status helpers,getStateLabel; tests per moduleMergedBadge/PURPLE_TONE, same classes/icon asReviewStateBadgesrc/main/github/*, shared GitHub types, renderer GitHub componentsChanges
Mapping (main process)
mapIssueState(state, mergeEvidence?)centralizing the open/closed/merged decisionmapIssueWorkItemdetects PR merge evidence; type staysissueso linked-issue id prefixes remain stablefetchIssueWorkItemfallback now rejectspull_requestpayloadsRenderer
IssueStateBadgegains a Merged branch reusingReviewStateBadge's exact vocabulary (purple tone + GitMerge icon)work-item-state-presentation.getStateLabelhandle'merged'for issue-typed itemsTypes
IssueStatewidened additively to include'merged'QA plan