Skip to content

Commit b2e711c

Browse files
committed
Share the landing idle interval with its test helper
A hardcoded delay would still report no armed timer if the product cadence moved while reduced-motion skip stayed broken.
1 parent 0f67623 commit b2e711c

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

src/tui/landing.test.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
appendStreamRow,
1212
applyLandingSuggestion,
1313
createAppShell,
14+
LANDING_IDLE_REPAINT_INTERVAL_MS,
1415
noticeText,
1516
paintChrome,
1617
setChromeZones,
@@ -50,18 +51,16 @@ const NOTICE = "Anonymous usage telemetry is enabled. Disable in /settings.";
5051
const nativeSetInterval = globalThis.setInterval;
5152
const nativeClearInterval = globalThis.clearInterval;
5253

53-
/**
54-
* 125 is `LANDING_IDLE_REPAINT_INTERVAL_MS` in shell.ts. Hardcoded so a
55-
* cadence change fails these tests on purpose rather than tracking a product
56-
* export.
57-
*/
58-
const LANDING_IDLE_REPAINT_INTERVAL_MS = 125;
5954
const stripSnow = (text: string) => text.replaceAll(SNOW_CHAR, " ");
6055

6156
interface IdleTimerHandle {
6257
unref?: () => void;
6358
}
6459

60+
/**
61+
* Intercepts the product idle interval so a cadence change cannot hide a
62+
* still-armed timer from the reduced-motion assertion.
63+
*/
6564
function wrapLandingIdleTimer(): {
6665
armed: IdleTimerHandle[];
6766
cleared: IdleTimerHandle[];

src/tui/shell.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2812,7 +2812,7 @@ function clearLandingMark(shell: AppShell): void {
28122812
* The snow only needs to advance about half a row per second, so 8fps is
28132813
* comfortably enough to read as motion.
28142814
*/
2815-
const LANDING_IDLE_REPAINT_INTERVAL_MS = 125;
2815+
export const LANDING_IDLE_REPAINT_INTERVAL_MS = 125;
28162816

28172817
/**
28182818
* Repaint the landing mark for `nowMs`. `animating` runs the mountain's

0 commit comments

Comments
 (0)