@@ -102,17 +102,16 @@ describe("chat canvas layout", () => {
102102 } ) ;
103103 expect ( result . frame ) . toEqual ( { x : 1260 , y : 351 , width : 240 , height : 365 } ) ;
104104 expect ( result . overlapsDetailsCard ) . toBe ( false ) ;
105- expect ( result . chat ) . toEqual ( { left : 330 , width : 736 , insetStart : 0 , insetEnd : 188 } ) ;
105+ expect ( result . chat ) . toEqual ( { left : 424 , width : 736 , insetStart : 0 , insetEnd : 0 } ) ;
106106 } ) ;
107- it ( "centers the chat beside a details card it would crowd" , ( ) => {
107+ it ( "moves the chat left only as far as a details card it would crowd requires " , ( ) => {
108108 const { chat } = resolveChatCanvasLayout ( {
109109 container : { width : 1344 , height : 988 } ,
110110 maxChatWidth : 736 ,
111111 detailsCard : { left : 1052 , right : 1332 , bottom : 339 } ,
112112 preview : null ,
113113 } ) ;
114- // Equal space on both sides of the chat.
115- expect ( chat ) . toMatchObject ( { left : ( 1052 - 736 ) / 2 , width : 736 } ) ;
114+ expect ( chat ) . toMatchObject ( { left : 1052 - 32 - 736 , width : 736 } ) ;
116115 } ) ;
117116 it ( "keeps the chat canvas-centered when it clears the details card" , ( ) => {
118117 const result = resolveChatCanvasLayout ( {
@@ -255,7 +254,7 @@ describe("chat canvas layout", () => {
255254 const compact = layout ( 460 ) ;
256255 expect ( compact . frame ! . x + compact . frame ! . width ) . toBe ( 1572 ) ;
257256 expect ( compact . frame ! . width ) . toBe ( 460 ) ;
258- expect ( compact . chat . left ) . toBe ( 330 ) ;
257+ expect ( compact . chat . left ) . toBe ( 364 ) ;
259258 expect ( compact . overlapsDetailsCard ) . toBe ( true ) ;
260259 expect ( density ( compact ) ) . toBe ( "compact" ) ;
261260 expectClear ( compact ) ;
@@ -295,6 +294,9 @@ describe("workspace card beside chat", () => {
295294 detailsCard : { left : width - 292 , right : width - 12 , bottom : 400 } ,
296295 preview : player ,
297296 } ) ;
297+ it ( "keeps chat centered while the card fits beside it" , ( ) => {
298+ expect ( withCard ( 1500 ) . chat ) . toEqual ( { left : 382 , width : 736 , insetStart : 0 , insetEnd : 0 } ) ;
299+ } ) ;
298300 it ( "narrows chat only after it reaches the left padding" , ( ) => {
299301 expect ( withCard ( 1108 ) . chat ) . toMatchObject ( { left : 48 , width : 736 } ) ;
300302 expect ( withCard ( 1028 ) . chat ) . toEqual ( { left : 48 , width : 656 , insetStart : 0 , insetEnd : 276 } ) ;
0 commit comments