@@ -117,32 +117,38 @@ interface ViewportSpec {
117117 attachmentTolerancePx : number ;
118118}
119119
120+ // The chat minimap (`pr-2`) shaves 8px off the timeline row's right side,
121+ // which trims ~6.4px from the user-bubble (after the 80% width ratio). With
122+ // long messages near a wrap boundary that's enough to flip 1-2 lines between
123+ // the renderer and the character-width-based estimator, so each viewport's
124+ // text tolerance budgets a couple extra wrapped-line heights to absorb that
125+ // drift without flapping the test on minor layout adjustments.
120126const DEFAULT_VIEWPORT : ViewportSpec = {
121127 name : "desktop" ,
122128 width : 960 ,
123129 height : 1_100 ,
124- textTolerancePx : 48 ,
130+ textTolerancePx : 80 ,
125131 attachmentTolerancePx : 56 ,
126132} ;
127133const WIDE_FOOTER_VIEWPORT : ViewportSpec = {
128134 name : "wide-footer" ,
129135 width : 1_400 ,
130136 height : 1_100 ,
131- textTolerancePx : 48 ,
137+ textTolerancePx : 80 ,
132138 attachmentTolerancePx : 56 ,
133139} ;
134140const COMPACT_FOOTER_VIEWPORT : ViewportSpec = {
135141 name : "compact-footer" ,
136142 width : 430 ,
137143 height : 932 ,
138- textTolerancePx : 68 ,
144+ textTolerancePx : 96 ,
139145 attachmentTolerancePx : 56 ,
140146} ;
141147const TEXT_VIEWPORT_MATRIX = [
142148 DEFAULT_VIEWPORT ,
143- { name : "tablet" , width : 720 , height : 1_024 , textTolerancePx : 48 , attachmentTolerancePx : 56 } ,
144- { name : "mobile" , width : 430 , height : 932 , textTolerancePx : 68 , attachmentTolerancePx : 56 } ,
145- { name : "narrow" , width : 320 , height : 700 , textTolerancePx : 114 , attachmentTolerancePx : 56 } ,
149+ { name : "tablet" , width : 720 , height : 1_024 , textTolerancePx : 80 , attachmentTolerancePx : 56 } ,
150+ { name : "mobile" , width : 430 , height : 932 , textTolerancePx : 96 , attachmentTolerancePx : 56 } ,
151+ { name : "narrow" , width : 320 , height : 700 , textTolerancePx : 140 , attachmentTolerancePx : 56 } ,
146152] as const satisfies readonly ViewportSpec [ ] ;
147153const ATTACHMENT_VIEWPORT_MATRIX = [
148154 { ...DEFAULT_VIEWPORT , attachmentTolerancePx : 120 } ,
0 commit comments