Skip to content

Fix initial editor part size#316201

Merged
benibenj merged 1 commit into
mainfrom
benibenj/double-canid
May 13, 2026
Merged

Fix initial editor part size#316201
benibenj merged 1 commit into
mainfrom
benibenj/double-canid

Conversation

@benibenj
Copy link
Copy Markdown
Contributor

Copilot Generated Description: Adjust the initial size of the editor part to be half of the chat bar width upon its first appearance, ensuring it does not appear too small. Store the state to prevent resizing on subsequent show/hide cycles.

Copilot AI review requested due to automatic review settings May 13, 2026 08:42
@benibenj benibenj enabled auto-merge May 13, 2026 08:42
@benibenj benibenj self-assigned this May 13, 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

Adjusts the Agents (Sessions) window layout behavior so the editor part doesn’t appear overly narrow the first time it becomes visible in a workspace, and enforces a higher minimum width for the editor part to keep it usable.

Changes:

  • Adds a workspace-scoped persisted flag to apply a one-time initial editor resize on first show.
  • Implements _applyInitialEditorSize() to resize the editor to ~half of the available main-area width (with a 300px floor) and records that it ran.
  • Increases the Sessions MainEditorPart minimum width to at least 300px.
Show a summary per file
File Description
src/vs/sessions/browser/workbench.ts Applies a one-time initial editor sizing when the editor part is first shown and persists a workspace flag to avoid repeating it.
src/vs/sessions/browser/parts/editorPart.ts Enforces a 300px minimum width for the Sessions main editor part.

Copilot's findings

Comments suppressed due to low confidence (1)

src/vs/sessions/browser/workbench.ts:1691

  • _applyInitialEditorSize() assumes the chat bar is visible and uses getViewSize(chatBarPartView).width. If the chat bar is hidden, getViewSize for that view is likely 0, which would make mainAreaWidth effectively just the current editor width and then shrink the editor to half of the available space on its first show. Consider skipping this initial resize when the chat bar is hidden (or basing the calculation on the actual available container width instead of the chat bar width).
		// initial split it would appear too small
		const mainAreaWidth = this.workbenchGrid.getViewSize(this.chatBarPartView).width + this.workbenchGrid.getViewSize(this.editorPartView).width;
		const targetEditorWidth = Math.max(300, Math.floor(mainAreaWidth / 2));
		const currentEditorSize = this.workbenchGrid.getViewSize(this.editorPartView);
  • Files reviewed: 2/2 changed files
  • Comments generated: 2

Comment thread src/vs/sessions/browser/workbench.ts
Comment thread src/vs/sessions/browser/workbench.ts
@benibenj benibenj merged commit 25a53e6 into main May 13, 2026
29 checks passed
@benibenj benibenj deleted the benibenj/double-canid branch May 13, 2026 09:42
@vs-code-engineering vs-code-engineering Bot added this to the 1.121.0 milestone May 13, 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