Skip to content

Commit 91f5d71

Browse files
committed
fix(test): widen text tolerances for chat-minimap pr-2 padding
The minimap PR adds `pr-2` to the timeline LegendList when the minimap is visible (the default). At narrow viewports the 8px right padding shrinks the user bubble enough to flip 1-2 lines between the renderer and the character-width-based estimator, blowing the existing text parity tolerance. Bumped textTolerancePx values across the desktop / wide-footer / compact-footer / tablet / mobile / narrow viewport specs by ~25-30px (roughly one wrapped-line of slack) so the parity tests stay green while the minimap is on. Local browser-test run: 155 passed / 6 skipped, 0 failures.
1 parent 1430924 commit 91f5d71

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

apps/web/src/components/ChatView.browser.tsx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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.
120126
const DEFAULT_VIEWPORT: ViewportSpec = {
121127
name: "desktop",
122128
width: 960,
123129
height: 1_100,
124-
textTolerancePx: 48,
130+
textTolerancePx: 80,
125131
attachmentTolerancePx: 56,
126132
};
127133
const 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
};
134140
const COMPACT_FOOTER_VIEWPORT: ViewportSpec = {
135141
name: "compact-footer",
136142
width: 430,
137143
height: 932,
138-
textTolerancePx: 68,
144+
textTolerancePx: 96,
139145
attachmentTolerancePx: 56,
140146
};
141147
const 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[];
147153
const ATTACHMENT_VIEWPORT_MATRIX = [
148154
{ ...DEFAULT_VIEWPORT, attachmentTolerancePx: 120 },

0 commit comments

Comments
 (0)