From b22143bb783a25489a17d2166c09265c6ce2fccd Mon Sep 17 00:00:00 2001 From: mrleemurray Date: Tue, 31 Mar 2026 12:34:22 +0100 Subject: [PATCH] Refactor button configuration and adjust CSS padding and gap for improved layout --- .../contrib/changes/browser/changesView.ts | 19 +++++++++++-------- .../changes/browser/media/changesView.css | 4 ++-- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/vs/sessions/contrib/changes/browser/changesView.ts b/src/vs/sessions/contrib/changes/browser/changesView.ts index 5d1466878e2..291786ebd25 100644 --- a/src/vs/sessions/contrib/changes/browser/changesView.ts +++ b/src/vs/sessions/contrib/changes/browser/changesView.ts @@ -1000,13 +1000,7 @@ export class ChangesViewPane extends ViewPane { menuOptions: sessionResource ? { args: [sessionResource, this.agentSessionsService.getSession(sessionResource)?.metadata] } : { shouldForwardArgs: true }, - buttonConfigProvider: (action) => { - if ( - action.id === 'chatEditing.viewAllSessionChanges' || - action.id === 'github.copilot.chat.openPullRequestCopilotCLIAgentSession.openPR' - ) { - return { showIcon: true, showLabel: false, isSecondary: true }; - } + buttonConfigProvider: (action, index) => { if (action.id === 'github.copilot.chat.createPullRequestCopilotCLIAgentSession.updatePR') { const customLabel = outgoingChanges > 0 ? `${action.label} ${outgoingChanges}↑` @@ -1022,6 +1016,12 @@ export class ChangesViewPane extends ViewPane { } return { showIcon: true, showLabel: false, isSecondary: true }; } + if ( + action.id === 'chatEditing.viewAllSessionChanges' || + action.id === 'github.copilot.chat.openPullRequestCopilotCLIAgentSession.openPR' + ) { + return { showIcon: true, showLabel: false, isSecondary: true }; + } if ( action.id === 'github.copilot.chat.createPullRequestCopilotCLIAgentSession.createPR' || action.id === 'github.copilot.chat.mergeCopilotCLIAgentSessionChanges.merge' || @@ -1032,7 +1032,10 @@ export class ChangesViewPane extends ViewPane { return { showIcon: true, showLabel: true, isSecondary: false }; } - return undefined; + // Unknown actions (e.g. extension-contributed): + // first action is primary, rest are icon-only secondary + const isSecondary = index > 0; + return { showIcon: true, showLabel: !isSecondary, isSecondary }; } } )); diff --git a/src/vs/sessions/contrib/changes/browser/media/changesView.css b/src/vs/sessions/contrib/changes/browser/media/changesView.css index 82cbc89c69d..46b8f35de3b 100644 --- a/src/vs/sessions/contrib/changes/browser/media/changesView.css +++ b/src/vs/sessions/contrib/changes/browser/media/changesView.css @@ -7,7 +7,7 @@ display: flex; flex-direction: column; height: 100%; - padding: 8px; + padding: 4px 8px 8px 8px; box-sizing: border-box; } @@ -136,7 +136,7 @@ display: flex; flex-direction: row; flex-wrap: nowrap; - gap: 6px; + gap: 4px; align-items: center; }