-
Notifications
You must be signed in to change notification settings - Fork 684
Add "View Session" button next to "Cancel Coding Agent" button #7086
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
alexr00
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot, one comment
webviews/components/header.tsx
Outdated
| }; | ||
|
|
||
| // Extract sessionLink from the coding agent event | ||
| const sessionLink = codingAgentEvent && 'sessionLink' in codingAgentEvent ? codingAgentEvent.sessionLink : undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't use an in check, instead cast to something that has the property then see if the property exists.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in commit 8b1c69e. Replaced the 'sessionLink' in codingAgentEvent check with proper type casting: (codingAgentEvent as CopilotStartedEvent)?.sessionLink.
alexr00
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot, also, put the button to the left of the "cancel" button.
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Done! Moved the "View Session" button to the left of the "Cancel Coding Agent" button in commit 58b4c9a. |
This PR adds a "View Session" button next to the existing "Cancel Coding Agent" button in the pull request header. The button uses the secondary button styling as requested and only appears when a session link is available from the coding agent event.
Changes Made
CancelCodingAgentButtoncomponent inwebviews/components/header.tsxopenSessionLogimport fromPullRequestContextsessionLinkfrom copilot events when availablesecondary small-buttonCSS classesImplementation Details
The button follows existing patterns in the codebase:
secondary small-button) as other header buttonsopenSessionLogfunctionality from the contextThe implementation is minimal and surgical, adding only the necessary code without modifying existing functionality.
Fixes #7085.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.