feat(ui): display user tier in about command (#17400)

This commit is contained in:
Sehoon Shon
2026-01-23 16:03:53 -05:00
committed by GitHub
parent 2c0cc7b9a5
commit 5c649d8db1
18 changed files with 108 additions and 10 deletions
@@ -39,6 +39,7 @@ describe('aboutCommand', () => {
config: {
getModel: vi.fn(),
getIdeMode: vi.fn().mockReturnValue(true),
getUserTierName: vi.fn().mockReturnValue(undefined),
},
settings: {
merged: {
@@ -97,6 +98,7 @@ describe('aboutCommand', () => {
gcpProject: 'test-gcp-project',
ideClient: 'test-ide',
userEmail: 'test-email@example.com',
tier: undefined,
});
});
@@ -156,4 +158,21 @@ describe('aboutCommand', () => {
}),
);
});
it('should display the tier when getUserTierName returns a value', async () => {
vi.mocked(mockContext.services.config!.getUserTierName).mockReturnValue(
'Enterprise Tier',
);
if (!aboutCommand.action) {
throw new Error('The about command must have an action.');
}
await aboutCommand.action(mockContext, '');
expect(mockContext.ui.addItem).toHaveBeenCalledWith(
expect.objectContaining({
tier: 'Enterprise Tier',
}),
);
});
});
@@ -44,6 +44,8 @@ export const aboutCommand: SlashCommand = {
});
const userEmail = cachedAccount ?? undefined;
const tier = context.services.config?.getUserTierName();
const aboutItem: Omit<HistoryItemAbout, 'id'> = {
type: MessageType.ABOUT,
cliVersion,
@@ -54,6 +56,7 @@ export const aboutCommand: SlashCommand = {
gcpProject,
ideClient,
userEmail,
tier,
};
context.ui.addItem(aboutItem);