feat: add commit and sync skill buttons to Changes View for agent-hos…#317951
Open
Nico0248 wants to merge 1 commit into
Open
feat: add commit and sync skill buttons to Changes View for agent-hos…#317951Nico0248 wants to merge 1 commit into
Nico0248 wants to merge 1 commit into
Conversation
…t sessions (microsoft#317937) Add Commit and Sync skill buttons to the Changes View toolbar for agent-host sessions, complementing the existing Merge/PR dropdown. - Commit button: visible when worktree has uncommitted changes, shows loading spinner during git operations - Sync button: visible when upstream exists with incoming/outgoing changes, shows outgoing count badge and loading spinner - Both buttons registered on AgentsChangesToolbar via new optional menuId field on IAgentHostSkillButtonSpec - Unit tests cover toolbar registration, context key gating, and exported ID validation Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Author
|
@microsoft-github-policy-service agree |
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds first-class Agent Host “Commit” and “Sync” skill buttons to the Changes toolbar and updates the Changes view + tests to recognize and validate these new commands.
Changes:
- Register new
commitandsyncskill buttons onMenuId.AgentsChangesToolbar(with worktree-related context conditions). - Export new command ID constants and update Changes view button rendering logic for these actions.
- Expand menu registration tests to cover the toolbar and the new exported IDs.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/vs/sessions/contrib/providers/agentHost/test/browser/agentHostSkillButtons.test.ts | Extends menu/command registration tests to validate Commit/Sync toolbar buttons and exported IDs. |
| src/vs/sessions/contrib/providers/agentHost/browser/agentHostSkillButtons.ts | Adds Commit/Sync skill specifications, optional per-skill menu targeting, and exports new command ID constants. |
| src/vs/sessions/contrib/changes/browser/changesView.ts | Adds special label/icon handling for Commit/Sync actions in the Changes toolbar widget. |
Comment on lines
+214
to
+223
| if (action.id === AGENT_HOST_SKILL_BUTTON_COMMIT_ID) { | ||
| if (!hasGitOperationInProgress) { | ||
| return { showIcon: true, showLabel: true, isSecondary: false }; | ||
| } | ||
| const customLabelObs = derived(reader => { | ||
| const running = runningLabelObs.read(reader); | ||
| return `$(loading) ${running ?? action.label}`; | ||
| }); | ||
| return { showIcon: false, showLabel: true, isSecondary: false, customLabelObs }; | ||
| } |
Comment on lines
+89
to
+96
| { | ||
| id: `${AGENT_HOST_SKILL_BUTTON_ID_PREFIX}commit`, | ||
| title: localize2('agentSessions.runSkill.commit', "Commit"), | ||
| skill: 'commit', | ||
| icon: Codicon.check, | ||
| group: 'navigation', | ||
| order: 0, | ||
| menuId: MenuId.AgentsChangesToolbar, |
Comment on lines
184
to
189
| * as the Copilot CLI extension's Sync PR button. Exported so the changes | ||
| * view can pick it out of the toolbar without re-deriving the ID. | ||
| */ | ||
| export const AGENT_HOST_SKILL_BUTTON_COMMIT_ID = `${AGENT_HOST_SKILL_BUTTON_ID_PREFIX}commit`; | ||
| export const AGENT_HOST_SKILL_BUTTON_SYNC_ID = `${AGENT_HOST_SKILL_BUTTON_ID_PREFIX}sync`; | ||
| export const AGENT_HOST_SKILL_BUTTON_UPDATE_PR_ID = `${AGENT_HOST_SKILL_BUTTON_ID_PREFIX}updatePR`; |
| skill: 'sync', | ||
| icon: Codicon.sync, | ||
| group: 'navigation', | ||
| order: 0, |
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 #317937
Description
Adds Commit and Sync skill buttons to the Changes View toolbar for agent-host sessions, complementing the existing Merge/Create PR/Update PR skill buttons in the dropdown submenu.
Changes
agentHostSkillButtons.tscommitskill button registered onAgentsChangesToolbar:/commitprompt to the agentsyncskill button registered onAgentsChangesToolbar:/syncprompt to the agentmenuIdfield toIAgentHostSkillButtonSpecto support registering buttons on either the toolbar directly or the dropdown submenuAGENT_HOST_SKILL_BUTTON_COMMIT_IDandAGENT_HOST_SKILL_BUTTON_SYNC_IDconstantschangesView.ts↑) and loading spinneragentHostSkillButtons.test.tsskillButtonItems()helper to accept a menu ID parameterHow to Test
Sync 2↑)scripts/test.sh --grep "agentHostSkillButtons"→ 13 tests passing