Strange UI behaviour when Show Agent Session sidebar (fix #286166) (#286327)

This commit is contained in:
Benjamin Pasero 2026-01-07 11:21:50 +01:00 committed by GitHub
parent 78444f420d
commit fc07512ec0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -716,6 +716,7 @@ abstract class UpdateChatViewWidthAction extends Action2 {
}
const newOrientation = this.getOrientation();
const lastWidthForOrientation = chatView?.getLastDimensions(newOrientation)?.width;
if ((!canResizeView || validatedConfiguredOrientation === 'sideBySide') && newOrientation === AgentSessionsViewerOrientation.Stacked) {
chatView.updateConfiguredSessionsViewerOrientation('stacked');
@ -723,21 +724,21 @@ abstract class UpdateChatViewWidthAction extends Action2 {
chatView.updateConfiguredSessionsViewerOrientation('sideBySide');
}
if (!canResizeView) {
return; // location does not allow for resize (panel top or bottom)
}
const part = getPartByLocation(chatLocation);
let currentSize = layoutService.getSize(part);
const sideBySideMinWidth = 600 + 1; // account for possible theme border
const stackedMaxWidth = sideBySideMinWidth - 1;
const chatViewDefaultWidth = 300;
const sideBySideMinWidth = (chatViewDefaultWidth * 2) + 1; // account for possible theme border
if (
(newOrientation === AgentSessionsViewerOrientation.SideBySide && currentSize.width >= sideBySideMinWidth) || // already wide enough to show side by side
newOrientation === AgentSessionsViewerOrientation.Stacked // always wide enough to show stacked
(newOrientation === AgentSessionsViewerOrientation.SideBySide && currentSize.width >= sideBySideMinWidth) || // already wide enough to show side by side
(newOrientation === AgentSessionsViewerOrientation.Stacked && chatLocation === ViewContainerLocation.AuxiliaryBar && layoutService.isAuxiliaryBarMaximized()) // try to not leave maximized state if maximized
) {
return; // size suffices
}
if (!canResizeView) {
return; // location does not allow for resize (panel top or bottom)
return;
}
if (chatLocation === ViewContainerLocation.AuxiliaryBar) {
@ -745,19 +746,14 @@ abstract class UpdateChatViewWidthAction extends Action2 {
currentSize = layoutService.getSize(part);
}
const lastWidthForOrientation = chatView?.getLastDimensions(newOrientation)?.width;
let newWidth: number;
if (newOrientation === AgentSessionsViewerOrientation.SideBySide) {
newWidth = Math.max(sideBySideMinWidth, lastWidthForOrientation || Math.round(layoutService.mainContainerDimension.width / 2));
} else {
newWidth = Math.min(stackedMaxWidth, lastWidthForOrientation || stackedMaxWidth);
newWidth = lastWidthForOrientation || chatViewDefaultWidth;
}
layoutService.setSize(part, {
width: newWidth,
height: currentSize.height
});
layoutService.setSize(part, { width: newWidth, height: currentSize.height });
}
abstract getOrientation(): AgentSessionsViewerOrientation;