feat: show sub-issues inline in the issue detail view by lmilbaum · Pull Request #9073 · microsoft/vscode-pull-request-github · GitHub
Skip to content

feat: show sub-issues inline in the issue detail view - #9073

Open
Liora Milbaum (lmilbaum) wants to merge 1 commit into
microsoft:mainfrom
lmilbaum:feat/sub-issues
Open

Liora Milbaum (lmilbaum) wants to merge 1 commit into
microsoft:mainfrom
lmilbaum:feat/sub-issues

Conversation

@lmilbaum

@lmilbaum Liora Milbaum (lmilbaum) commented Oct 16, 2026 •

Copy link
Copy Markdown

Summary

  • Fetch sub-issues via REST `listSubIssues` with `restPaginate` (no 100-item cap) and render them inline under the description when viewing a parent issue
  • Add `SubIssueReference` type, `convertRESTSubIssue()` converter, and `IssueModel.getSubIssues()` -- errors (404/410 for older GHES, other) return `[]` without blocking `pr.initialize`
  • Add `SubIssues` React component with open/closed state icons, title, `#N` / `owner/repo#N` label (cross-repo prefix), and assignee avatars with accessibility attributes
  • Sub-issue links resolve to `vscode://` in-editor links (clickable, open in a new issue panel); GHES remotes keep the original `html_url`
  • New: parent issue indicator -- when viewing a sub-issue, a "Part of #N - <title>" line appears above the description, also clickable via `vscode://` link
  • Fix `refreshTimeline` race: sub-issue link resolution now runs before `freshestTimeline()` captures the final event list
  • Fix case-insensitive repo comparison in cross-repo issue number label
  • Fix `repository_url` parsing in `convertRESTSubIssue` to use `URL.pathname` segments instead of fragile array pops
  • Add webview tests, `IssueModel` unit tests, and `IssueOverviewPanel` wiring tests (including GHES URL preservation and parent issue)

Partially addresses #6596 (display only; editing sub-issues is a follow-up)

How to test

  1. Open a GitHub issue that has sub-issues on any repo
  2. Open the issue in VS Code via the GitHub Issues panel
  3. Confirm: a "Sub-issues" section appears under the description showing each child's title, state icon, and assignees
  4. Click a sub-issue row -- it should open that sub-issue in a new issue webview inside VS Code
  5. In the newly opened sub-issue panel, confirm: a "Part of #N - <title>" line appears above the description; clicking it opens the parent issue
  6. Close one of the sub-issues on GitHub, then click "Refresh" -- the icon should flip to closed
  7. Open an issue with no sub-issues -- confirm no "Sub-issues" section appears
  8. Open a pull request -- confirm no "Sub-issues" / parent indicator sections appear

Reviewer notes

  • Only the issue panel fetches sub-issues and parent; PR code paths are untouched
  • 404/410 responses (older GHES or missing access) degrade silently -- the section is hidden
  • GHES remotes bypass the `vscode://` rewrite entirely and keep `html_url` for both sub-issues and parent issue (no host identity in `toOpenIssueWebviewUri`)
  • The feature is read-only; editing sub-issues is a natural follow-up
  • Open question for maintainers: placement under description (GitHub.com parity, chosen here) vs. a sidebar Section like "Linked Issues" -- happy to move it if preferred

🤖 Generated with Claude Code

@lmilbaum
Liora Milbaum (lmilbaum) marked this pull request as ready for review October 16, 2026 18:55
Copilot AI balanced review requested due to automatic review settings October 16, 2026 18:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Enterprise server links can resolve against GitHub.com, and child state and assignees lack accessible text.

2 open findings
What changed in this PR

Adds read-only sub-issues beneath issue descriptions in the extension, addressing the visualization portion of #6596.

Changes:

  • Fetches and converts sub-issues, returning an empty list on errors.
  • Displays child state, repository labels, assignees, and in-editor links.
  • Adds model, panel wiring, and rendering tests.
File Description
webviews/​editorWebview/​test/​overview.test.tsx Tests rendering and visibility rules.
webviews/​editorWebview/​test/​builder/​pullRequest.ts Adds sub-issue test data support.
webviews/​editorWebview/​overview.tsx Places sub-issues below issue descriptions.
webviews/​editorWebview/​index.css Styles rows and assignee avatars.
webviews/​components/​subIssues.tsx Adds the sub-issue list component.
src/​test/​github/​issueOverview.test.ts Tests initialization and in-editor links.
src/​test/​github/​issueModel.test.ts Tests REST conversion and unavailable endpoints.
src/​github/​views.ts Adds sub-issues to webview data.
src/​github/​utils.ts Converts REST sub-issue responses.
src/​github/​issueOverview.ts Fetches children and resolves links.
src/​github/​issueModel.ts Adds sub-issue retrieval.
src/​github/​interface.ts Defines sub-issue references.
src/​github/​common.ts Adds the REST response type.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/github/issueOverview.ts Outdated
Comment thread webviews/components/subIssues.tsx Outdated
@alexr00

Copy link
Copy Markdown
Member

Can you share some screenshots? Looks like there are conflicts, and the Copilot code review comments may need to be addressed.

Copilot AI balanced review requested due to automatic review settings October 29, 2026 07:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Unresolved issues can overwrite newer timeline events, route GHES sub-issues to the wrong server, and omit state and assignee information for screen-reader users.

3 open issues

Review effort: Balanced

Comment thread src/github/issueOverview.ts Outdated
Liora Milbaum (lmilbaum) added a commit to lmilbaum/vscode-pull-request-github that referenced this pull request Oct 29, 2026
- Guard resolveSubIssueLinks against GHES: keep html_url when isEnterprise is true
- Replace per_page:100 fetch with restPaginate in getSubIssues; skip malformed items
- Add bounds check in convertRESTSubIssue for malformed repository_url
- Add role/aria-label to sub-issue state icon and assignee avatars
- Retarget avatar overlap CSS to .sub-issue-assignee wrapper span
- Update issueModel tests for restPaginate page:1 arg; convert CRLF→LF
- Add Enterprise URL regression test in issueOverview tests; convert CRLF→LF
- Add aria-label assertions in webview overview tests

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 29, 2026 08:20
@lmilbaum

Copy link
Copy Markdown
Author

Screenshots generated locally showing sub-issues panel (dark and light themes):

  • Dark theme: 4 sub-issues displayed — 3 open (green dot), 1 closed (purple check). Cross-repo sub-issue shows owner/repo#N label. Assignee avatars overlap correctly.
  • Light theme: Same layout, VS Code light theme colours.

(Screenshots are in the PR's local working copy; will attach via the UI.)

@lmilbaum

Copy link
Copy Markdown
Author

Liora Milbaum (lmilbaum) added a commit to lmilbaum/vscode-pull-request-github that referenced this pull request Oct 29, 2026
- Guard resolveSubIssueLinks against GHES: keep html_url when isEnterprise is true
- Replace per_page:100 fetch with restPaginate in getSubIssues; skip malformed items
- Add bounds check in convertRESTSubIssue for malformed repository_url
- Add role/aria-label to sub-issue state icon and assignee avatars
- Retarget avatar overlap CSS to .sub-issue-assignee wrapper span
- Update issueModel tests for restPaginate page:1 arg; convert CRLF→LF
- Add Enterprise URL regression test in issueOverview tests; convert CRLF→LF
- Add aria-label assertions in webview overview tests

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The repository comparison is case-sensitive, causing same-repository sub-issues to show an incorrect cross-repository prefix when Git remote and REST response casing differ.

2 open issues
2 resolved since last review

Review effort: Balanced

Comment thread webviews/components/subIssues.tsx Outdated
Copilot AI balanced review requested due to automatic review settings October 29, 2026 08:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Initialization can overwrite newer timeline events with stale data because sub-issue links are resolved after the timeline freshness check.

2 open issues

Review effort: Balanced

@alexr00 Alex Ross (alexr00) added the info-needed Issue requires more information from poster label Oct 29, 2026
Liora Milbaum (lmilbaum) added a commit to lmilbaum/vscode-pull-request-github that referenced this pull request Oct 29, 2026
- Guard resolveSubIssueLinks against GHES: keep html_url when isEnterprise is true
- Replace per_page:100 fetch with restPaginate in getSubIssues; skip malformed items
- Add bounds check in convertRESTSubIssue for malformed repository_url
- Add role/aria-label to sub-issue state icon and assignee avatars
- Retarget avatar overlap CSS to .sub-issue-assignee wrapper span
- Update issueModel tests for restPaginate page:1 arg; convert CRLF→LF
- Add Enterprise URL regression test in issueOverview tests; convert CRLF→LF
- Add aria-label assertions in webview overview tests
- Fix refreshTimeline race: call resolveSubIssueLinks before freshestTimeline so concurrent timeline refreshes are not overwritten by pr.initialize

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 29, 2026 08:33

@lmilbaum Liora Milbaum (lmilbaum) left a comment •

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

sub-issue-view-light sub-issue-view-dark sub-issues-light sub-issues-dark

Liora Milbaum (lmilbaum) added a commit to lmilbaum/vscode-pull-request-github that referenced this pull request Oct 29, 2026
- Guard resolveSubIssueLinks against GHES: keep html_url when isEnterprise is true
- Replace per_page:100 fetch with restPaginate in getSubIssues; skip malformed items
- Add bounds check in convertRESTSubIssue for malformed repository_url
- Add role/aria-label to sub-issue state icon and assignee avatars
- Retarget avatar overlap CSS to .sub-issue-assignee wrapper span
- Update issueModel tests for restPaginate page:1 arg; convert CRLF→LF
- Add Enterprise URL regression test in issueOverview tests; convert CRLF→LF
- Add aria-label assertions in webview overview tests
- Fix refreshTimeline race: call resolveSubIssueLinks before freshestTimeline so concurrent timeline refreshes are not overwritten by pr.initialize

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Liora Milbaum (lmilbaum) added a commit to lmilbaum/vscode-pull-request-github that referenced this pull request Oct 29, 2026
- Guard resolveSubIssueLinks against GHES: keep html_url when isEnterprise is true
- Replace per_page:100 fetch with restPaginate in getSubIssues; skip malformed items
- Add bounds check in convertRESTSubIssue for malformed repository_url
- Add role/aria-label to sub-issue state icon and assignee avatars
- Retarget avatar overlap CSS to .sub-issue-assignee wrapper span
- Update issueModel tests for restPaginate page:1 arg; convert CRLF→LF
- Add Enterprise URL regression test in issueOverview tests; convert CRLF→LF
- Add aria-label assertions in webview overview tests
- Fix refreshTimeline race: call resolveSubIssueLinks before freshestTimeline so concurrent timeline refreshes are not overwritten by pr.initialize

- Fix case-insensitive isSameRepo comparison in subIssues.tsx to match getIssueNumberLabel behaviour

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Repository identities are compared case-sensitively, causing sub-issues from the same repository to display an unnecessary owner/repository prefix when remote and API casing differ.

1 open issue
2 resolved since last review

Review effort: Balanced

Comment thread webviews/components/subIssues.tsx Outdated
Copilot AI balanced review requested due to automatic review settings October 29, 2026 08:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues block the read-only sub-issue display change.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

…rosoft#9073

Audit fixes:
- Replace per_page:100 cap with restPaginate in getSubIssues() to handle
  issues with more than 100 sub-issues
- Add try/catch per sub-issue in getSubIssues() so one malformed entry
  does not abort the whole list
- Fix repository_url parsing in convertRESTSubIssue to use URL.pathname
  segments instead of brittle repositoryPath.pop() calls
- Fix refreshTimeline race: resolve sub-issue links before calling
  freshestTimeline() so concurrent refreshes see the final URLs
- Fix GHES sub-issue links: skip vscode:// rewrite for Enterprise remotes,
  preserving original html_url
- Fix case-insensitive repo comparison in issueNumberLabel (use toLowerCase)
- Add role="img" + aria-label to state icon span and assignee Avatar
  wrapper for screen-reader accessibility
- Fix avatar overlap CSS: retarget from img.avatar:first-child to
  .sub-issue-assignee + .sub-issue-assignee selector
- Correct log message from "sub-issue link" to "issue reference link"
- Rename GHES test to cover both sub-issues and parent issue

New feature - parent issue indicator:
- Add IssueModel.getParentIssue() using GET /repos/{o}/{r}/issues/{n}/parent
- Expose parentIssue?: SubIssueReference on the Issue interface (views.ts)
- Resolve parent issue link to vscode:// URI (same as sub-issues, with GHES guard)
- Render "Part of #N - <title>" above the issue description via new
  ParentIssue component in subIssues.tsx
- Add CSS for .parent-issue and .parent-issue-link
- Add getParentIssue tests in issueModel.test.ts and issueOverview.test.ts
- Add ParentIssue component tests in overview.test.tsx

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 29, 2026 09:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are recorded for the read-only issue hierarchy change.

No open issues 🎉

Review effort: Balanced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

info-needed Issue requires more information from poster

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants