Skip to content

Maximize and sticky logs#319069

Merged
benibenj merged 1 commit into
mainfrom
benibenj/elaborate-bedbug
May 29, 2026
Merged

Maximize and sticky logs#319069
benibenj merged 1 commit into
mainfrom
benibenj/elaborate-bedbug

Conversation

@benibenj
Copy link
Copy Markdown
Contributor

Copilot Generated Description: Introduce functionality to toggle the maximized state of session views and the stickiness of sessions. Emit events after toggling these states to notify other components.

Copilot AI review requested due to automatic review settings May 29, 2026 22:38
@benibenj benibenj enabled auto-merge May 29, 2026 22:38
@benibenj benibenj self-assigned this May 29, 2026
@vs-code-engineering
Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

@sandy081

Matched files:

  • src/vs/sessions/services/sessions/browser/sessionsManagementService.ts
  • src/vs/sessions/services/sessions/browser/visibleSessions.ts
  • src/vs/sessions/services/sessions/common/sessionsManagement.ts
  • src/vs/sessions/services/sessions/test/browser/sessionNavigation.test.ts

@lszomoru

Matched files:

  • src/vs/sessions/services/sessions/browser/sessionsManagementService.ts
  • src/vs/sessions/services/sessions/browser/visibleSessions.ts
  • src/vs/sessions/services/sessions/common/sessionsManagement.ts
  • src/vs/sessions/services/sessions/test/browser/sessionNavigation.test.ts

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

This PR extends the Agents window sessions infrastructure to emit explicit events when (1) a session’s stickiness is toggled in the sessions grid and (2) a session view is maximized/restored, and then wires those events into sessions telemetry logging.

Changes:

  • Added ISessionsManagementService.onDidToggleSessionStickiness with a typed payload, and fired it from SessionsManagementService.toggleSessionStickiness.
  • Updated the visible-sessions model and sessions part to return the post-toggle state for stickiness/maximize operations, enabling accurate event payloads.
  • Logged new telemetry events for stickiness toggles and maximize toggles, driven by the newly introduced events.
Show a summary per file
File Description
src/vs/sessions/services/sessions/test/browser/sessionNavigation.test.ts Updates the ISessionsManagementService test mock to include the new stickiness-toggle event.
src/vs/sessions/services/sessions/common/sessionsManagement.ts Introduces IToggleSessionStickinessEvent and adds onDidToggleSessionStickiness to the service contract.
src/vs/sessions/services/sessions/browser/visibleSessions.ts Makes toggleStickiness return the post-toggle sticky state.
src/vs/sessions/services/sessions/browser/sessionsManagementService.ts Emits onDidToggleSessionStickiness after toggling, using the returned sticky state.
src/vs/sessions/contrib/sessions/browser/sessionsTelemetry.contribution.ts Adds telemetry for stickiness/maximize toggles; also removes command-based telemetry for agentSession.markAsDone.
src/vs/sessions/browser/parts/sessionsPartService.ts Adds onDidToggleMaximizeSession and emits it when a session view’s maximized state actually changes.
src/vs/sessions/browser/parts/sessionsPart.ts Makes toggleMaximizeSession return true/false for toggles and undefined for no-ops.

Copilot's findings

Comments suppressed due to low confidence (1)

src/vs/sessions/contrib/sessions/browser/sessionsTelemetry.contribution.ts:112

  • The telemetry for the agentSession.markAsDone command was removed from the onDidExecuteCommand switch, but the command still exists (it archives the active session). If existing telemetry pipelines/dashboards expect agents/sessionMarkedAsDone, this change silently drops that signal; if the intent is to de-duplicate with agents/sessionArchived, it should be called out explicitly (or keep a dedicated event / add a field on the archive event to preserve the distinction).
		this._register(commandService.onDidExecuteCommand(e => {
			// Commands fire very frequently. Match on the command id first
			// (cheap) and only resolve the session for matched ids.
			let log: ((session: ISession) => void) | undefined;
			switch (e.commandId) {
				case 'github.copilot.chat.createPullRequestCopilotCLIAgentSession.createPR':
				case 'workbench.action.agentSessions.runSkill.createPR':
					log = session => this._logCreatePullRequest(session);
					break;
				case 'workbench.action.agentSessions.runSkill.createDraftPR':
					log = session => this._logCreateDraftPullRequest(session);
					break;
				case 'workbench.action.agentSessions.runSkill.updatePR':
					log = session => this._logUpdatePullRequest(session);
					break;
				case 'github.copilot.chat.mergeCopilotCLIAgentSessionChanges.merge':
				case 'workbench.action.agentSessions.runSkill.merge':
					log = session => this._logMergePullRequest(session);
					break;
				case 'github.copilot.chat.checkoutPullRequestReroute':
				case 'pr.checkoutFromChat':
					log = session => this._logCheckoutPullRequest(session);
					break;
				case 'github.copilot.sessions.initializeRepository':
				case 'github.copilot.claude.sessions.initializeRepository':
					log = session => this._logInitializeRepository(session);
					break;
				case 'github.copilot.sessions.commit':
				case 'github.copilot.claude.sessions.commit':
					log = session => this._logCommit(session);
					break;
				case 'github.copilot.sessions.commitAndSync':
				case 'github.copilot.claude.sessions.commitAndSync':
					log = session => this._logCommitAndSync(session);
					break;
				case 'agentSession.restore':
					log = session => this._logSessionRestored(session);
					break;
				case 'sessions.action.fixCIChecks':
  • Files reviewed: 7/7 changed files
  • Comments generated: 1

Comment on lines 300 to 325
/**
* Toggle a session's stickiness in the grid. The session keeps its grid
* slot when toggled.
* - If the session is not currently visible, it is appended at the end as
* sticky.
*
* Returns the session's stickiness state after the toggle.
*/
toggleStickiness(session: ISession): void {
toggleStickiness(session: ISession): boolean {
const id = session.sessionId;
if (!this._visibleList.includes(id)) {
this._stickyIds.add(id);
this._getOrCreateVisibleSession(session);
this._visibleList.push(id);
} else if (this._stickyIds.has(id)) {
this._stickyIds.delete(id);
this._mostRecentNonStickySlot = id;
} else {
this._stickyIds.add(id);
if (this._mostRecentNonStickySlot === id) {
this._mostRecentNonStickySlot = this._findLastNonSticky();
}
}
this._refresh(undefined);
return this._stickyIds.has(id);
}
@benibenj benibenj merged commit e53b01b into main May 29, 2026
26 checks passed
@benibenj benibenj deleted the benibenj/elaborate-bedbug branch May 29, 2026 23:00
@vs-code-engineering vs-code-engineering Bot added this to the 1.123.0 milestone May 29, 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