@@ -35,6 +35,7 @@ import { SessionStatus } from '../../services/sessions/common/session.js';
3535export class SessionView extends Disposable implements ISerializableView {
3636
3737 static readonly TYPE = 'sessions.sessionView' ;
38+ private static readonly CENTERED_CONTENT_MAX_WIDTH = 950 ;
3839 private static readonly ACTIVE_BACKGROUND = asCssVariable ( activeSessionViewBackground ) ;
3940 private static readonly ACTIVE_FOREGROUND = asCssVariable ( activeSessionViewForeground ) ;
4041 private static readonly INACTIVE_BACKGROUND = asCssVariable ( inactiveSessionViewBackground ) ;
@@ -53,6 +54,7 @@ export class SessionView extends Disposable implements ISerializableView {
5354 private readonly _header : SessionHeader ;
5455 private readonly _compositeBar : ChatCompositeBar ;
5556 private readonly _floatingToolbar : SessionViewFloatingToolbar ;
57+ private readonly _centeredContentContainer : HTMLElement ;
5658 private readonly _contentContainer : HTMLElement ;
5759
5860 private readonly _currentView = this . _register ( new MutableDisposable < AbstractChatView > ( ) ) ;
@@ -95,14 +97,17 @@ export class SessionView extends Disposable implements ISerializableView {
9597
9698 const scopedInstantiationService = this . _register ( instantiationService . createChild ( new ServiceCollection ( [ IContextKeyService , scopedContextKeyService ] ) ) ) ;
9799
100+ this . _centeredContentContainer = $ ( '.session-view-centered-content' ) ;
101+ this . element . appendChild ( this . _centeredContentContainer ) ;
102+
98103 this . _header = this . _register ( scopedInstantiationService . createInstance ( SessionHeader ) ) ;
99- this . element . appendChild ( this . _header . element ) ;
104+ this . _centeredContentContainer . appendChild ( this . _header . element ) ;
100105
101106 this . _compositeBar = this . _register ( scopedInstantiationService . createInstance ( ChatCompositeBar ) ) ;
102- this . element . appendChild ( this . _compositeBar . element ) ;
107+ this . _centeredContentContainer . appendChild ( this . _compositeBar . element ) ;
103108
104109 this . _contentContainer = $ ( '.session-view-content' ) ;
105- this . element . appendChild ( this . _contentContainer ) ;
110+ this . _centeredContentContainer . appendChild ( this . _contentContainer ) ;
106111
107112 this . _floatingToolbar = this . _register ( scopedInstantiationService . createInstance ( SessionViewFloatingToolbar ) ) ;
108113 this . element . appendChild ( this . _floatingToolbar . element ) ;
@@ -205,10 +210,13 @@ export class SessionView extends Disposable implements ISerializableView {
205210 return ;
206211 }
207212 const { width, height, top, left } = this . _lastLayout ;
213+ const centeredWidth = Math . min ( width , SessionView . CENTERED_CONTENT_MAX_WIDTH ) ;
214+ const centeredLeft = left + ( width - centeredWidth ) / 2 ;
215+ size ( this . _centeredContentContainer , centeredWidth , height ) ;
208216 const headerHeight = this . _header . visible ? this . _header . height : 0 ;
209217 const tabsHeight = this . _compositeBar . visible ? this . _compositeBar . height : 0 ;
210218 const barHeight = headerHeight + tabsHeight ;
211- this . _currentView . value ?. layout ( width , height - barHeight , top + barHeight , left ) ;
219+ this . _currentView . value ?. layout ( centeredWidth , height - barHeight , top + barHeight , centeredLeft ) ;
212220 }
213221
214222 toJSON ( ) : object {
0 commit comments