You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Display linked issue(s) from the PR Overview #5824 (#6835)
* Display linked issues in PR overview sidebar
Adds a "Linked Issues" section to the PR Overview sidebar that lists the
issues a PR closes, using the GraphQL `closingIssuesReferences` field.
The section is read-only since GitHub's API does not expose a mutation
for linking/unlinking issues.
Squashed and rebased onto current main; drops the now-redundant
`parsePullRequestState` helper since main has independently introduced
`stateToStateEnum` for the same dedup, and replaces it with an inline
OPEN/CLOSED mapping in `parseClosingIssuesReferences`.
Co-Authored-By: Alex Ross <38270282+alexr00@users.noreply.github.com>
* Address review feedback for #6835
- Extract IssueReference type into views.ts and use it for closingIssues
(alexr00 review feedback).
- Sidebar: drop orphan tailwind-style class names (p-2, gap-2, p-4,
text-sm, text-gray-500, text-center, h2) that are not defined in the
project's CSS — replace with the project's section conventions.
- Use the existing issueIcon / issueClosedIcon for the issue state icon
instead of settingsIcon / closeIcon.
- Switch on GithubItemStateEnum directly rather than lowercasing strings.
- Move the React `key` to the iterating element and key by issue.number
(titles are not guaranteed unique).
- Render the issue number alongside the title.
- Initialize PullRequestModel.closingIssues to [] so the field is never
undefined when serialized to the webview.
* Add issueIcon and issueClosedIcon exports
The previous commit imported these from './icon' but they were
removed from icon.tsx during the codicon refactor on main. Restore
them as named exports — issueIcon uses the existing issue_webview.svg,
issueClosedIcon uses the pass codicon (checkmark in circle).
* Make linked issues clickable links to open in browser
Adds the issue url to the GraphQL query and through the IssueReference
type, then wraps the issue label in an <a href> in the sidebar. VS Code's
webview intercepts the click and opens the URL via openExternal, matching
the behavior of AuthorLink in the same view.
* Color and align linked issue icons
Wraps the issue state icon in a .section-icon span and adds two new
state classes (.issue-open, .issue-closed) coloured with the existing
--vscode-issues-open and --vscode-issues-closed tokens that this
extension contributes. Matches the colouring convention already used
for reviewer state icons (.section-icon.approved). The .section-icon
container also provides flex centering and 3px padding, which fixes
the icon-vs-link spacing in the row.
* Address PR feedback
Co-authored-by: Copilot <copilot@github.com>
---------
Co-authored-by: Alex Ross <38270282+alexr00@users.noreply.github.com>
Co-authored-by: Copilot <copilot@github.com>
0 commit comments