@@ -4,37 +4,39 @@ import {
44 resolveThreadDetailsCardLayout ,
55} from "./threadDetailsCardLayout" ;
66
7+ const lane = { padding : 20 , minChatWidth : 640 } ;
78const resolve = ( width : number , height : number , previewY : number | null = null ) =>
89 resolveThreadDetailsCardLayout ( {
910 container : { width, height } ,
10- chat : { left : ( width - 736 ) / 2 , width : 736 } ,
11+ lane ,
1112 frame : previewY === null ? null : { x : width - 332 , y : previewY , width : 320 , height : 240 } ,
1213 } ) ;
1314
14- describe ( "floating details card" , ( ) => {
15- it ( "uses the right margin without reserving chat space " , ( ) => {
15+ describe ( "workspace card" , ( ) => {
16+ it ( "pins to the top right at a fixed width " , ( ) => {
1617 expect ( resolve ( 1600 , 900 ) ) . toEqual ( {
1718 x : 1276 ,
1819 y : 12 ,
1920 width : 312 ,
2021 height : 876 ,
2122 } ) ;
22- expect ( resolve ( 1344 , 900 ) ?. width ) . toBe ( 280 ) ;
23+ expect ( resolve ( 1344 , 900 ) ) . toMatchObject ( { x : 1020 , width : 312 } ) ;
2324 } ) ;
24- it ( "hides when the margin cannot hold readable controls" , ( ) => {
25- expect ( resolve ( 1200 , 900 ) ) . toBeNull ( ) ;
25+ it ( "hides when a readable chat lane cannot fit beside it" , ( ) => {
26+ expect ( resolve ( 1016 , 900 ) ) . toMatchObject ( { x : 692 } ) ;
27+ expect ( resolve ( 1015 , 900 ) ) . toBeNull ( ) ;
2628 } ) ;
2729 it ( "keeps the card at the top right while the preview is freely dragged vertically" , ( ) => {
2830 for ( const y of [ 12 , 170 , 250 , 400 , 648 ] ) {
2931 expect ( resolve ( 1600 , 900 , y ) ) . toEqual ( { x : 1276 , y : 12 , width : 312 , height : 876 } ) ;
3032 }
3133 } ) ;
32- it ( "keeps width and height independent " , ( ) => {
33- expect ( resolve ( 1344 , 900 , 600 ) ) . toMatchObject ( { width : 280 , height : 876 } ) ;
34+ it ( "keeps full height while a preview stays clear of the card " , ( ) => {
35+ expect ( resolve ( 1344 , 900 , 600 ) ) . toMatchObject ( { width : 312 , height : 876 } ) ;
3436 expect (
3537 resolveThreadDetailsCardLayout ( {
3638 container : { width : 1600 , height : 900 } ,
37- chat : { left : 432 , width : 736 } ,
39+ lane ,
3840 frame : { x : 12 , y : 100 , width : 320 , height : 240 } ,
3941 } ) ?. height ,
4042 ) . toBe ( 876 ) ;
@@ -45,7 +47,7 @@ describe("card content fitting", () => {
4547 const place = ( previewY : number , previewHeight = 365 , overlapsDetailsCard = false ) =>
4648 resolveThreadDetailsCardLayout ( {
4749 container : { width : 1584 , height : 988 } ,
48- chat : { left : 424 , width : 736 } ,
50+ lane ,
4951 frame : { x : 1260 , y : previewY , width : 240 , height : previewHeight } ,
5052 overlapsDetailsCard,
5153 } ) ;
0 commit comments