Fix initial editor part size#316201
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
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
MainEditorPartminimum 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
alexr00
approved these changes
May 13, 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: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.