Skip to content

Commit aead179

Browse files
authored
Chromatic fix animation flakiness (#2109)
* use pauseAnimationAtEnd * use preload syntax instead of embedded fonts, i think we still weren't preloading our copy of typekit css
1 parent 21cd7f0 commit aead179

File tree

6 files changed

+26
-61
lines changed

6 files changed

+26
-61
lines changed

.chromatic/custom-addons/chromatic/chromatic.css

Lines changed: 0 additions & 57 deletions
This file was deleted.

.chromatic/custom-addons/chromatic/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import {locales, scales, themes} from '../../constants';
22
import {makeDecorator} from '@storybook/addons';
33
import {Provider, View} from '@adobe/react-spectrum';
44
import React, {useEffect} from 'react';
5-
import styles from './chromatic.css';
65

76
export const withChromaticProvider = makeDecorator({
87
name: 'withChromaticProvider',

.chromatic/preview-head.html

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,24 @@
1+
<link rel="preload" href="https://use.typekit.net/uma8ayv.css" as="style" />
2+
3+
<link rel="preload" href="https://use.typekit.net/af/cb695f/000000000000000000017701/27/l?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n4&v=3" as="font" crossorigin="anonymous" />
4+
<link rel="preload" href="https://use.typekit.net/af/cb695f/000000000000000000017701/27/d?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n4&v=3" as="font" crossorigin="anonymous" />
5+
<link rel="preload" href="https://use.typekit.net/af/cb695f/000000000000000000017701/27/a?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n4&v=3" as="font" crossorigin="anonymous" />
6+
7+
<link rel="preload" href="https://use.typekit.net/af/74ffb1/000000000000000000017702/27/l?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=i4&v=3" as="font" crossorigin="anonymous" />
8+
<link rel="preload" href="https://use.typekit.net/af/74ffb1/000000000000000000017702/27/d?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=i4&v=3" as="font" crossorigin="anonymous" />
9+
<link rel="preload" href="https://use.typekit.net/af/74ffb1/000000000000000000017702/27/a?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=i4&v=3" as="font" crossorigin="anonymous" />
10+
11+
<link rel="preload" href="https://use.typekit.net/af/eaf09c/000000000000000000017703/27/l?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n7&v=3" as="font" crossorigin="anonymous" />
12+
<link rel="preload" href="https://use.typekit.net/af/eaf09c/000000000000000000017703/27/d?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n4&v=3" as="font" crossorigin="anonymous" />
13+
<link rel="preload" href="https://use.typekit.net/af/eaf09c/000000000000000000017703/27/a?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n4&v=3" as="font" crossorigin="anonymous" />
14+
15+
<link rel="preload" href="https://use.typekit.net/af/40207f/0000000000000000000176ff/27/l?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n4&v=3" as="font" crossorigin="anonymous" />
16+
<link rel="preload" href="https://use.typekit.net/af/40207f/0000000000000000000176ff/27/d?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n4&v=3" as="font" crossorigin="anonymous" />
17+
<link rel="preload" href="https://use.typekit.net/af/40207f/0000000000000000000176ff/27/a?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n4&v=3" as="font" crossorigin="anonymous" />
18+
19+
<link rel="preload" href="https://use.typekit.net/af/505d17/00000000000000003b9aee44/27/l?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n4&v=3" as="font" crossorigin="anonymous" />
20+
<link rel="preload" href="https://use.typekit.net/af/505d17/00000000000000003b9aee44/27/d?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n4&v=3" as="font" crossorigin="anonymous" />
21+
<link rel="preload" href="https://use.typekit.net/af/505d17/00000000000000003b9aee44/27/a?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n4&v=3" as="font" crossorigin="anonymous" />
22+
23+
124
<link rel="stylesheet" href="https://use.typekit.net/uma8ayv.css" />

packages/@react-spectrum/menu/chromatic/MenuTrigger.chromatic.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const meta: Meta<SpectrumMenuTriggerProps> = {
3131
parameters: {
3232
chromaticProvider: {colorSchemes: ['light'], locales: ['en-US'], scales: ['medium'], disableAnimations: true},
3333
// chromatic needs a bit more time than disableAnimations allows
34-
chromatic: {delay: 2000}
34+
chromatic: {pauseAnimationAtEnd: true}
3535
},
3636
decorators: [Story => <div style={{display: 'flex', width: 'auto', margin: '250px 0'}}><Story /></div>]
3737
};

packages/@react-spectrum/menu/chromatic/MenuTriggerRTL.chromatic.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const meta: Meta = {
1919
parameters: {
2020
chromaticProvider: {colorSchemes: ['light'], locales: ['ar-AE'], scales: ['medium'], disableAnimations: true},
2121
// chromatic needs a bit more time than disableAnimations allows
22-
chromatic: {delay: 2000}
22+
chromatic: {pauseAnimationAtEnd: true}
2323
},
2424
decorators: [Story => <div style={{display: 'flex', width: 'auto', margin: '250px 0'}}><Story /></div>]
2525
};

packages/@react-spectrum/tooltip/chromatic/TooltipTrigger.chromatic.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const meta: Meta<SpectrumTooltipTriggerProps> = {
2222
parameters: {
2323
chromaticProvider: {colorSchemes: ['light'], locales: ['en-US'], scales: ['medium'], disableAnimations: true},
2424
// chromatic needs a bit more time than disableAnimations allows
25-
chromatic: {delay: 2000}
25+
chromatic: {pauseAnimationAtEnd: true}
2626
}
2727
};
2828

0 commit comments

Comments
 (0)