Feature/adaptive crossfade window #50

Merged
ilia merged 7 commits from feature/adaptive-crossfade-window into main 2026-06-06 06:05:09 +00:00
Showing only changes of commit a2ec025a65 - Show all commits
+8 -4
View File
@@ -1,3 +1,4 @@
import { windowSizeForLine } from '../src/entities/Font/domain/windowSizeForLine/windowSizeForLine';
import {
expect,
test,
@@ -5,12 +6,15 @@ import {
test.describe('preview text', () => {
test('drives the slider character rendering', async ({ comparison }) => {
const text = 'Sphinx';
await comparison.pickPair('Inter', 'Roboto');
await comparison.setPreviewText('Sphinx');
await comparison.setPreviewText(text);
// Window chars render as `.char-wrap` cells for crossfade.
// With WINDOW_SIZE=5, "Sphinx" (6 chars) fits 5 in the window.
await expect(comparison.slider.locator('.char-wrap')).toHaveCount(5);
// Window chars render as `.char-wrap` cells for crossfade. The window
// size is a pure function of the line's grapheme count — assert against
// the rule, not a hardcoded constant, so tuning the policy can't silently
// break this. "Sphinx" is one unwrapped line of 6 graphemes.
await expect(comparison.slider.locator('.char-wrap')).toHaveCount(windowSizeForLine(text.length));
});
test('preserves the typed value in the input', async ({ comparison }) => {