Skip to content

Revert "sessions: hide disabled chat input pickers (#307494)"#308173

Merged
sandy081 merged 2 commits intomainfrom
sandy081/long-alligator
Apr 7, 2026
Merged

Revert "sessions: hide disabled chat input pickers (#307494)"#308173
sandy081 merged 2 commits intomainfrom
sandy081/long-alligator

Conversation

@sandy081
Copy link
Copy Markdown
Member

@sandy081 sandy081 commented Apr 7, 2026

This reverts commit c2f1a6e.

Copilot AI review requested due to automatic review settings April 7, 2026 08:56
@sandy081 sandy081 enabled auto-merge (squash) April 7, 2026 08:56
@sandy081 sandy081 self-assigned this Apr 7, 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

Reverts prior sessions UI behavior that hid certain chat input “picker” controls when they were disabled, restoring visibility (with disabled styling/behavior) and removing the CSS that suppressed shared workbench pickers in the sessions app.

Changes:

  • Switch multiple picker widgets from dom.setVisibility(...)/aria-hidden behavior to a disabled state via CSS class toggling.
  • Remove sessions CSS that hid .chat-sessionPicker-container in the sessions workbench.
  • Remove/adjust menu when gating and delete picker-specific browser tests that no longer match the updated behavior.
Show a summary per file
File Description
src/vs/sessions/contrib/copilotChatSessions/test/browser/branchPicker.test.ts Removes BranchPicker tests (previous expectations no longer apply).
src/vs/sessions/contrib/copilotChatSessions/browser/modePicker.ts Stops hiding mode picker; uses disabled styling instead.
src/vs/sessions/contrib/copilotChatSessions/browser/modelPicker.ts Stops hiding model picker; uses disabled styling instead.
src/vs/sessions/contrib/copilotChatSessions/browser/isolationPicker.ts Stops hiding isolation picker; uses disabled styling instead.
src/vs/sessions/contrib/copilotChatSessions/browser/copilotChatSessionsActions.ts Removes IsNewChatSessionContext gating for some new-session menus.
src/vs/sessions/contrib/copilotChatSessions/browser/branchPicker.ts Disables branch picker in more cases instead of hiding it.
src/vs/sessions/contrib/chat/test/browser/sessionTypePicker.test.ts Removes SessionTypePicker tests (previous hide/show expectations no longer apply).
src/vs/sessions/contrib/chat/browser/sessionTypePicker.ts Stops hiding session type picker; uses disabled styling instead.
src/vs/sessions/browser/media/style.css Removes CSS rule that hid shared chat session pickers in sessions workbench.

Copilot's findings

Comments suppressed due to low confidence (1)

src/vs/sessions/contrib/chat/browser/sessionTypePicker.ts:134

  • The PR changes picker behavior (e.g. SessionTypePicker no longer uses dom.setVisibility and relies on a disabled state instead), but the corresponding browser tests for these pickers were removed rather than updated. Please add/adjust unit tests to cover the new disabled/visible behavior and the associated accessibility attributes (aria-disabled, tabIndex) to prevent regressions.
	private _updateTriggerLabel(): void {
		if (!this._triggerElement) {
			return;
		}

		dom.clearNode(this._triggerElement);

		const currentType = this._sessionTypes.find(t => t.id === this._sessionType);
		const modeIcon = currentType?.icon ?? Codicon.terminal;
		const modeLabel = currentType?.label ?? this._sessionType ?? '';

		dom.append(this._triggerElement, renderIcon(modeIcon));
		const labelSpan = dom.append(this._triggerElement, dom.$('span.sessions-chat-dropdown-label'));
		labelSpan.textContent = modeLabel;

		const hasMultipleTypes = this._sessionTypes.length > 1;
		this._slotElement?.classList.toggle('disabled', !hasMultipleTypes);
		dom.append(this._triggerElement, renderIcon(Codicon.chevronDown));
	}
  • Files reviewed: 9/9 changed files
  • Comments generated: 4

this._slotElement.classList.toggle('disabled', false);
this._triggerElement.setAttribute('aria-hidden', String(!visible));
this._triggerElement.tabIndex = visible ? 0 : -1;
this._slotElement?.classList.toggle('disabled', modes.length <= 1);
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

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

_updateTriggerLabel marks the picker as disabled when modes.length <= 1, but the trigger remains focusable (tabIndex stays 0) and _showPicker() doesn’t check this disabled condition. Because .disabled only sets pointer-events: none, keyboard users can still open the picker (and it will open) despite the UI indicating it’s disabled. Consider setting aria-disabled + tabIndex=-1 when disabled and/or early-returning in _showPicker() when there’s no selectable mode choice (to keep behavior consistent across mouse/keyboard and for accessibility).

Suggested change
this._slotElement?.classList.toggle('disabled', modes.length <= 1);
const isDisabled = modes.length <= 1;
this._slotElement?.classList.toggle('disabled', isDisabled);
this._triggerElement.setAttribute('aria-disabled', isDisabled ? 'true' : 'false');
this._triggerElement.tabIndex = isDisabled ? -1 : 0;

Copilot uses AI. Check for mistakes.
Comment on lines +212 to +213
this._slotElement?.classList.toggle('disabled', this._models.length === 0);
this._triggerElement.setAttribute('aria-disabled', String(this._models.length === 0));
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

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

When there are no models, the slot gets the disabled class and aria-disabled is set, but the trigger remains in the tab order (tabIndex is never updated). Since the disabled styling uses pointer-events: none, the element can still receive focus via keyboard, which is inconsistent with a disabled control. Consider setting tabIndex=-1 when this._models.length === 0 (and restoring to 0 when models exist).

Suggested change
this._slotElement?.classList.toggle('disabled', this._models.length === 0);
this._triggerElement.setAttribute('aria-disabled', String(this._models.length === 0));
const isDisabled = this._models.length === 0;
this._slotElement?.classList.toggle('disabled', isDisabled);
this._triggerElement.setAttribute('aria-disabled', String(isDisabled));
this._triggerElement.tabIndex = isDisabled ? -1 : 0;

Copilot uses AI. Check for mistakes.
this._slotElement.classList.toggle('disabled', false);
this._triggerElement.setAttribute('aria-hidden', String(!hasMultipleTypes));
this._triggerElement.tabIndex = hasMultipleTypes ? 0 : -1;
this._slotElement?.classList.toggle('disabled', !hasMultipleTypes);
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

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

_updateTriggerLabel now only toggles the disabled class when there’s a single session type, but it no longer sets aria-disabled or removes the trigger from the tab order. This makes the control appear disabled while still being keyboard-focusable. Consider updating aria-disabled and tabIndex alongside the disabled class to match the behavior in other pickers (e.g. BranchPicker/IsolationPicker).

This issue also appears on line 116 of the same file.

Suggested change
this._slotElement?.classList.toggle('disabled', !hasMultipleTypes);
this._slotElement?.classList.toggle('disabled', !hasMultipleTypes);
this._triggerElement.setAttribute('aria-disabled', String(!hasMultipleTypes));
this._triggerElement.tabIndex = hasMultipleTypes ? 0 : -1;

Copilot uses AI. Check for mistakes.
Comment on lines 162 to 194
@@ -187,11 +187,9 @@ export class IsolationPicker extends Disposable {
labelSpan.textContent = modeLabel;
dom.append(this._triggerElement, renderIcon(Codicon.chevronDown));

const visible = this._isolationOptionEnabled && this._hasGitRepo;
dom.setVisibility(visible, this._slotElement);
this._slotElement.classList.toggle('disabled', false);
this._triggerElement.setAttribute('aria-hidden', String(!visible));
this._triggerElement.setAttribute('aria-disabled', String(!visible));
this._triggerElement.tabIndex = visible ? 0 : -1;
const isDisabled = !this._hasGitRepo;
this._slotElement?.classList.toggle('disabled', isDisabled);
this._triggerElement.setAttribute('aria-disabled', String(isDisabled));
this._triggerElement.tabIndex = isDisabled ? -1 : 0;
}
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

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

The picker’s interaction is gated on both _hasGitRepo and _isolationOptionEnabled in _showPicker(), but _updateTriggerLabel() only disables the UI when _hasGitRepo is false. If the isolation option gets disabled via configuration while the widget is rendered, the control can appear enabled yet do nothing. Consider including !this._isolationOptionEnabled in the disabled state (class, aria-disabled, and tabIndex) to keep the UI consistent with behavior.

Copilot uses AI. Check for mistakes.
@sandy081 sandy081 merged commit 2bdd526 into main Apr 7, 2026
23 checks passed
@sandy081 sandy081 deleted the sandy081/long-alligator branch April 7, 2026 09:16
@vs-code-engineering vs-code-engineering bot added this to the 1.116.0 milestone Apr 7, 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