Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a basic “upload files” flow to the PR/issue webviews, allowing users to pick local files, upload them via GitHub’s upload policy endpoint, and insert resulting Markdown links/images into comment textareas.
Changes:
- Add upload buttons to comment editors (new comment + edit comment) and wire them to a new
pr.upload-fileswebview message flow. - Implement extension-host upload handling (policy fetch → S3 form upload → GitHub confirm) and notify the webview as each file completes.
- Add shared styling and a new cloud-upload codicon SVG for the UI affordance.
Show a summary per file
| File | Description |
|---|---|
| webviews/editorWebview/index.css | Styles upload button in editor webview and adjusts textarea padding when button exists. |
| webviews/activityBarView/index.css | Adds textarea wrapper + upload button positioning/styles for the activity bar webview. |
| webviews/components/icon.tsx | Exports the new cloud upload icon for reuse in webview components. |
| webviews/components/comment.tsx | Adds upload buttons to Edit/Add comment UIs and hooks them into PRContext upload helpers. |
| webviews/common/context.tsx | Adds upload orchestration in the webview (placeholders + completion handlers + message routing). |
| src/github/views.ts | Introduces typed payloads for upload request/reply and completion notifications. |
| src/github/issueOverview.ts | Implements file picking + upload pipeline and posts per-file completion messages back to the webview. |
| resources/icons/codicons/cloud-upload.svg | Adds the new upload icon asset. |
Copilot's findings
Comments suppressed due to low confidence (2)
webviews/components/comment.tsx:550
- This icon-only upload button relies on
titlefor its accessible name. For screen readers and consistent accessibility, add an explicitaria-label(e.g., "Upload files") so the control is announced correctly even when tooltips are disabled or not read.
<button
type="button"
title="Upload files"
className="comment-upload-button icon-button"
onClick={() => uploadFilesIntoPendingComment()}
disabled={isBusy || busy}
>
{cloudUploadIcon}
</button>
webviews/components/comment.tsx:727
- This icon-only upload button relies on
titlefor its accessible name. For screen readers and consistent accessibility, add an explicitaria-label(e.g., "Upload files") so the control is announced correctly even when tooltips are disabled or not read.
<button
type="button"
title="Upload files"
className="comment-upload-button icon-button"
onClick={() => uploadFilesIntoPendingComment()}
disabled={isBusy || pr.busy}
>
{cloudUploadIcon}
</button>
- Files reviewed: 7/8 changed files
- Comments generated: 4
Contributor
There was a problem hiding this comment.
Copilot's findings
Comments suppressed due to low confidence (1)
src/github/issueOverview.ts:600
- The placeholder is embedded in an HTML comment and includes the raw basename. If the filename contains
-->or newlines (legal on some filesystems), it can break the comment delimiter and/or make placeholder matching unreliable. Consider sanitizing the displayed name (strip/replace problematic sequences) and/or keep the placeholder token separate from the human-readable filename.
const baseName = path.basename(uri.fsPath);
const count = used.get(baseName) ?? 0;
used.set(baseName, count + 1);
const placeholder = count === 0
? `<!-- Uploading ${baseName} -->`
: `<!-- Uploading ${baseName} (${count + 1}) -->`;
return { uri, name: baseName, placeholder };
- Files reviewed: 8/9 changed files
- Comments generated: 7
deepak1556
approved these changes
May 6, 2026
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #320