Refactor button configuration and adjust CSS padding and gap for improved layout

This commit is contained in:
mrleemurray
2026-03-31 12:34:22 +01:00
parent c69a19a58b
commit b22143bb78
2 changed files with 13 additions and 10 deletions

View File

@@ -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 };
}
}
));

View File

@@ -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;
}