← 输入框|github.com|刷新
Skip to content

Show the rendered description for REST-listed PRs in the overview - #9152

Draft
Alex Ross (alexr00) with Copilot wants to merge 3 commits into
mainfrom
copilot/dependabot-pr-description-fix
Draft

Alex Ross (alexr00) with Copilot wants to merge 3 commits into
mainfrom
copilot/dependabot-pr-description-fix

Conversation

Copilot AI commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

A PR opened from the "All Open" category showed its description as an empty card. That category is often the only place grouped Dependabot PRs appear. Since #8919, the overview renders the model it is given without fetching it again. Models listed through REST pulls.list have bodyHTML undefined, and CommentBody rendered bodyHTML ?? '' as HTML.

Changes

  • Extension host: load the rendered description after the page is shown (pullRequestOverview.ts)

    • After pr.initialize, if the model has a body but no bodyHTML, the new loadDescription loads the PR through GraphQL (getPullRequest(..., 'overview')).
    • It posts pr.update with { body, bodyHTML }, processed by processLinksInBodyHtml like the initial render.
    • The result is dropped if the panel was disposed or another update started (_updateSequence), the same check stack loading uses.
    • getPullRequest updates the cached model shared with the tree, so other views get the rendered description too.
  • Webview: show text instead of an empty body (comment.tsx)

    • bodyHTML === undefined (not loaded): render body as plain React text in a pre-wrap div, so it is not interpreted as HTML.
    • bodyHTML === '' (GitHub rendered nothing, e.g. a body that is only an HTML comment template): render empty, as before.
    • CommentPreview had its own copy of this fallback; it now calls CommentBody, so the preview and the full view render the same markup.
    const renderedBody = bodyHTML === undefined
    	? <div style={{ whiteSpace: 'pre-wrap' }}>{body}</div>
    	: <div dangerouslySetInnerHTML={{ __html: bodyHTML }} />;

Notes for review

  • Opening a REST-listed PR now costs one extra GraphQL request after the page is shown. Opening still isn't blocked.
  • The GraphQL update also fills in mergeable, which REST leaves unknown, so the panel reloads the stack and branch status once more. No refresh loop: bodyHTML is defined afterwards.
  • stubPanelServices in pullRequestOverview.test.ts now stubs repo.getPullRequest, keeping its rule that repo.query is never called. Two existing tests that stubbed getPullRequest themselves now override the shared stub.
  • New overview host tests have not been run locally (the VS Code test download is blocked in the sandbox), so they rely on CI.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI and others added 2 commits November 2, 2026 10:05
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix blank Dependabot PR description in VS Code extension Show the rendered description for REST-listed PRs in the overview Nov 2, 2026
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.

Dependabot PR description is blank in VS Code but renders correctly on GitHub

2 participants