Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 29, 2025

The @githubpr chat participant was outputting issue numbers like #7280 as plain text that users couldn't click to navigate to the corresponding GitHub issues or pull requests.

This PR implements automatic conversion of issue/PR references in chat output to clickable markdown links. The solution processes chat content in the participant where responses are streamed to users and converts them to proper markdown links using repository context.

Changes Made

Modified src/lm/participants.ts:

  • Added RepositoriesManager dependency to access repository context
  • Added processIssueReferences() method that uses existing findLinksInIssue utility
  • Process text before calling stream.markdown() for both direct responses and tool outputs
  • Uses active pull request or first available repository as context

Modified src/github/markdownUtils.ts:

  • Exported findLinksInIssue function to make it available for reuse

Modified src/extension.ts:

  • Updated ChatParticipant instantiation to pass RepositoriesManager

Features

Example

Before:

This PR addresses issue #7280.

After:

This PR addresses issue [microsoft/vscode-pull-request-github#7280](https://github.com/microsoft/vscode-pull-request-github/issues/7280).

The implementation reuses existing utilities from the codebase and processes references at the correct location where chat responses are streamed to users.

Fixes #7333.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

@Copilot Copilot AI changed the title [WIP] Issue link should be clickable in @githubpr chat output Make issue links clickable in @githubpr chat output Aug 29, 2025
Copilot finished work on behalf of alexr00 August 29, 2025 10:29
@Copilot Copilot AI requested a review from alexr00 August 29, 2025 10:29
Copy link
Member

@alexr00 alexr00 left a comment

Choose a reason for hiding this comment

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

@copilot wrong track. No changes need to be made in sessionView.tsx. Changes need to be made in participant.ts.

Copy link
Contributor Author

Copilot AI commented Aug 29, 2025

@copilot wrong track. No changes need to be made in sessionView.tsx. Changes need to be made in participant.ts.

You're absolutely right! I've moved the implementation to the correct location in src/lm/participants.ts where the @githubpr chat responses are actually processed and streamed. The changes now:

  1. Process issue references in participants.ts at lines 158 and 213 where stream.markdown() is called
  2. Revert all changes to sessionView.tsx (which was for session logs, not live chat)
  3. Use the existing findLinksInIssue utility from markdownUtils.ts
  4. Access repository context through the RepositoriesManager dependency

This ensures issue references are converted to clickable links at the point where chat content is streamed to users, not in the session log viewer. Thank you for the guidance! (commit 8ca8f29)

@Copilot Copilot AI requested a review from alexr00 August 29, 2025 10:57
Copilot finished work on behalf of alexr00 August 29, 2025 10:57
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.

Issue link should be clickable in @githubpr chat output Problems setting up extension Use arrow key instead of tab to navigate inside a comment thread
2 participants