Skip to content

Cleanup chat status widget further#310177

Merged
lramos15 merged 1 commit intomainfrom
lramos15/compulsory-swift
Apr 15, 2026
Merged

Cleanup chat status widget further#310177
lramos15 merged 1 commit intomainfrom
lramos15/compulsory-swift

Conversation

@lramos15
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings April 15, 2026 16:26
@lramos15 lramos15 enabled auto-merge (squash) April 15, 2026 16:26
@lramos15 lramos15 self-assigned this Apr 15, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR continues the cleanup of the chat status tooltip UI, primarily by restructuring quota indicator markup/styling and removing the “Agent Sessions” section from the dashboard.

Changes:

  • Refactors quota indicator UI (new title/details layout, updated bar sizing, warning/error emphasis).
  • Adjusts quota reset formatting (separate date/time formatters; “Resets …” label integrated into quota header).
  • Removes agent sessions rendering and related service dependencies from the dashboard.
Show a summary per file
File Description
src/vs/workbench/contrib/chat/browser/chatStatus/media/chatStatus.css Updates quota indicator styling/layout and adds warning/error visual treatments.
src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.ts Simplifies dashboard dependencies, restructures quota indicator DOM, and updates reset/usage labeling logic.

Copilot's findings

  • Files reviewed: 2/2 changed files
  • Comments generated: 6

Comment on lines +485 to 499
const resetValue = $('span.quota-reset');

if (resetLabel) {
resetValue.textContent = resetLabel;
}

const quotaIndicator = container.appendChild($('div.quota-indicator', undefined,
$('div.quota-label', undefined,
$('span', undefined, label),
quotaValue
$('div.quota-title', undefined, label),
$('div.quota-details', undefined,
$('div.quota-percentage', undefined,
quotaValue,
quotaValueSuffix
),
resetValue
),
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resetValueis always inserted into the flex row, even whenresetLabelis undefined. In cases like the “Limited” string quota path (noresetLabelpassed), this extra empty flex item can affect spacing/justify-content behavior. Prefer to only create/append the reset element whenresetLabelis present, or hide it when empty (e.g., conditional DOM or a CSS:empty { display: none; }rule for.quota-reset`).

Copilot uses AI. Check for mistakes.
Comment on lines +505 to +508
container.appendChild($('div.description', undefined, overageLabel));

if (supportsOverage && (this.chatEntitlementService.entitlement === ChatEntitlement.EDU || this.chatEntitlementService.entitlement === ChatEntitlement.Pro || this.chatEntitlementService.entitlement === ChatEntitlement.ProPlus)) {
const manageOverageButton = disposables.add(new Button(quotaIndicator, { ...defaultButtonStyles, secondary: true, hoverDelegate: nativeHoverDelegate }));
const manageOverageButton = disposables.add(new Button(container, { ...defaultButtonStyles, secondary: true, hoverDelegate: nativeHoverDelegate }));
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The overage description row is appended unconditionally, even when supportsOverage is false (or when no overage messaging will be set), leaving an always-present wrapper around an often-empty overageLabel. This can introduce blank vertical space in the tooltip. Create/append that description row only when supportsOverage is true (or when you actually set content), or remove/hide the row when the label ends up empty."

Copilot uses AI. Check for mistakes.
Comment on lines +528 to 533
quotaValue.textContent = `+${this.quotaOverageFormatter.value.format(quota.overageCount)}`;
quotaValueSuffix.textContent = ` ${localize('quotaOverageRequests', "requests")}`;
} else {
quotaValue.textContent = localize('quotaDisplay', "{0}%", this.quotaPercentageFormatter.value.format(usedPercentage));
quotaValueSuffix.textContent = ` ${localize('quotaUsed', "used")}`;
}
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The UI string is being split across quotaValue and quotaValueSuffix using manual string concatenation and leading spaces. This is fragile for localization (ordering/spacing can differ, and some locales may require different grammar), and it makes it harder to translate correctly. Prefer a single localized message with placeholders that covers the full rendered text (even if you still style parts differently, you can keep the full localized string in an attribute for a11y, or use a single localize value and split more safely without hardcoded spaces)."

Copilot uses AI. Check for mistakes.
const chatQuotaIndicator = chatQuota && (chatQuota.total > 0 || chatQuota.unlimited) ? this.createQuotaIndicator(container, this._store, chatQuota, localize('chatsLabel', "Chat messages"), false) : undefined;
const premiumChatLabel = premiumChatQuota?.overageEnabled && !premiumChatQuota?.unlimited ? localize('includedPremiumChatsLabel', "Included premium requests") : localize('premiumChatsLabel', "Premium requests");
const premiumChatQuotaIndicator = premiumChatQuota && (premiumChatQuota.total > 0 || premiumChatQuota.unlimited) ? this.createQuotaIndicator(container, this._store, premiumChatQuota, premiumChatLabel, true) : undefined;
const resetLabel = resetDate ? (resetDateHasTime ? localize('quotaResetsAt', "Resets {0} at {1}", this.dateFormatter.value.format(new Date(resetDate)), this.timeFormatter.value.format(new Date(resetDate))) : localize('quotaResets', "Resets {0}", this.dateFormatter.value.format(new Date(resetDate)))) : undefined;
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The resetLabel construction is duplicated in multiple places with the same localization keys and formatting. To keep future changes consistent (e.g., wording, date/time formatting, punctuation), factor this into a small helper method (e.g., getQuotaResetLabel() returning string | undefined) and reuse it."

See below for a potential fix:

	private getQuotaResetLabel(resetDate: number | string | Date | undefined, resetDateHasTime: boolean): string | undefined {
		if (!resetDate) {
			return undefined;
		}

		const date = new Date(resetDate);
		return resetDateHasTime
			? localize('quotaResetsAt', "Resets {0} at {1}", this.dateFormatter.value.format(date), this.timeFormatter.value.format(date))
			: localize('quotaResets', "Resets {0}", this.dateFormatter.value.format(date));
	}

	private renderUsageContent(container: HTMLElement, token: CancellationToken, updatePromise?: Promise<void>): void {
		const { chat: chatQuota, completions: completionsQuota, premiumChat: premiumChatQuota, resetDate, resetDateHasTime } = this.chatEntitlementService.quotas;

		if (chatQuota || premiumChatQuota) {
			const resetLabel = this.getQuotaResetLabel(resetDate, resetDateHasTime);

Copilot uses AI. Check for mistakes.
Comment on lines +356 to +357
const { completions: completionsQuota, resetDate, resetDateHasTime } = this.chatEntitlementService.quotas;
const resetLabel = resetDate ? (resetDateHasTime ? localize('quotaResetsAt', "Resets {0} at {1}", this.dateFormatter.value.format(new Date(resetDate)), this.timeFormatter.value.format(new Date(resetDate))) : localize('quotaResets', "Resets {0}", this.dateFormatter.value.format(new Date(resetDate)))) : undefined;
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The resetLabel construction is duplicated in multiple places with the same localization keys and formatting. To keep future changes consistent (e.g., wording, date/time formatting, punctuation), factor this into a small helper method (e.g., getQuotaResetLabel() returning string | undefined) and reuse it."

See below for a potential fix:

	private getQuotaResetLabel(resetDate: number | undefined, resetDateHasTime: boolean | undefined): string | undefined {
		if (!resetDate) {
			return undefined;
		}

		const date = new Date(resetDate);
		return resetDateHasTime
			? localize('quotaResetsAt', "Resets {0} at {1}", this.dateFormatter.value.format(date), this.timeFormatter.value.format(date))
			: localize('quotaResets', "Resets {0}", this.dateFormatter.value.format(date));
	}

	private renderInlineSuggestionsContent(container: HTMLElement, token: CancellationToken, updatePromise?: Promise<void>): void {
		// Completions quota
		{
			const { completions: completionsQuota, resetDate, resetDateHasTime } = this.chatEntitlementService.quotas;
			const resetLabel = this.getQuotaResetLabel(resetDate, resetDateHasTime);

Copilot uses AI. Check for mistakes.
Comment on lines 507 to 509
if (supportsOverage && (this.chatEntitlementService.entitlement === ChatEntitlement.EDU || this.chatEntitlementService.entitlement === ChatEntitlement.Pro || this.chatEntitlementService.entitlement === ChatEntitlement.ProPlus)) {
const manageOverageButton = disposables.add(new Button(quotaIndicator, { ...defaultButtonStyles, secondary: true, hoverDelegate: nativeHoverDelegate }));
const manageOverageButton = disposables.add(new Button(container, { ...defaultButtonStyles, secondary: true, hoverDelegate: nativeHoverDelegate }));
manageOverageButton.label = localize('enableAdditionalUsage', "Manage paid premium requests");
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The “Manage paid premium requests” button is now attached to container rather than the quota indicator block (quotaIndicator). This can make the layout/order harder to reason about when multiple quota indicators are rendered (button may visually group with the wrong indicator depending on surrounding DOM/CSS). Consider appending the button to the specific quota indicator (or to a dedicated actions container inside it) so the DOM structure matches the visual grouping."

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: 4b5765fe Current: d73f414b

Changed (2)

chat/aiCustomizations/aiCustomizationManagementEditor/McpBrowseMode/Light
Before After
before after
editor/inlineCompletions/other/JumpToHint/Dark
Before After
before after

@lramos15 lramos15 merged commit 138f4b6 into main Apr 15, 2026
30 checks passed
@lramos15 lramos15 deleted the lramos15/compulsory-swift branch April 15, 2026 17:34
@vs-code-engineering vs-code-engineering bot added this to the 1.117.0 milestone Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants