Maximize and sticky logs#319069
Merged
Merged
Conversation
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: @sandy081Matched files:
@lszomoruMatched files:
|
Contributor
There was a problem hiding this comment.
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.onDidToggleSessionStickinesswith a typed payload, and fired it fromSessionsManagementService.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.markAsDonecommand was removed from theonDidExecuteCommandswitch, but the command still exists (it archives the active session). If existing telemetry pipelines/dashboards expectagents/sessionMarkedAsDone, this change silently drops that signal; if the intent is to de-duplicate withagents/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); | ||
| } |
kycutler
approved these changes
May 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.