fix(downloads): make package disclosure motion visible
Keep the explicitly requested 300 ms package transition active when Chromium reports reduced motion, and separate the prepared and active disclosure states by a painted frame. Add focused regression coverage and an opt-in motion mode for the visual harness while keeping normal captures deterministic.
This commit is contained in:
@@ -4,6 +4,22 @@ import { DOWNLOAD_FILE_ROW_HEIGHT } from "./download-virtualizer";
|
||||
export const DOWNLOAD_DISCLOSURE_DURATION_MS = 300;
|
||||
export const DOWNLOAD_DISCLOSURE_MAX_ANIMATED_ITEMS = 64;
|
||||
|
||||
export function scheduleDownloadDisclosureActivation(
|
||||
requestFrame: (callback: FrameRequestCallback) => number,
|
||||
cancelFrame: (frame: number) => void,
|
||||
activate: () => void
|
||||
): () => void {
|
||||
let paintFrame = 0;
|
||||
let activationFrame = 0;
|
||||
paintFrame = requestFrame(() => {
|
||||
activationFrame = requestFrame(activate);
|
||||
});
|
||||
return () => {
|
||||
cancelFrame(paintFrame);
|
||||
if (activationFrame) cancelFrame(activationFrame);
|
||||
};
|
||||
}
|
||||
|
||||
export type DownloadDisclosurePhase = "stable" | "entering" | "leaving";
|
||||
|
||||
export type DownloadDisclosureRow = DownloadLogicalRow & {
|
||||
|
||||
Reference in New Issue
Block a user