Skip to content

Commit 1a94e85

Browse files
authored
Merge branch 'main' into zoomcontainer
2 parents 527f7a0 + 79637a6 commit 1a94e85

File tree

13 files changed

+95
-36
lines changed

13 files changed

+95
-36
lines changed

CHANGELOG.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,41 @@
1+
# v1.2.15 (Mon Mar 11 2024)
2+
3+
#### 🐛 Bug Fix
4+
5+
- Show shorter label on very small viewports [#211](https://github.com/chromaui/addon-visual-tests/pull/211) ([@ghengeveld](https://github.com/ghengeveld))
6+
7+
#### Authors: 1
8+
9+
- Gert Hengeveld ([@ghengeveld](https://github.com/ghengeveld))
10+
11+
---
12+
13+
# v1.2.14 (Mon Mar 11 2024)
14+
15+
#### 🐛 Bug Fix
16+
17+
- Automatically clear notification when connection is restored [#210](https://github.com/chromaui/addon-visual-tests/pull/210) ([@ghengeveld](https://github.com/ghengeveld))
18+
- Wrap all screens with ControlsProvider and ignore config warnings on Authentication screens [#209](https://github.com/chromaui/addon-visual-tests/pull/209) ([@ghengeveld](https://github.com/ghengeveld))
19+
- Fix 'Rerun tests' button sizing [#208](https://github.com/chromaui/addon-visual-tests/pull/208) ([@ghengeveld](https://github.com/ghengeveld))
20+
21+
#### Authors: 1
22+
23+
- Gert Hengeveld ([@ghengeveld](https://github.com/ghengeveld))
24+
25+
---
26+
27+
# v1.2.13 (Mon Mar 11 2024)
28+
29+
#### 🐛 Bug Fix
30+
31+
- Fix inlineGlow animation [#207](https://github.com/chromaui/addon-visual-tests/pull/207) ([@ghengeveld](https://github.com/ghengeveld))
32+
33+
#### Authors: 1
34+
35+
- Gert Hengeveld ([@ghengeveld](https://github.com/ghengeveld))
36+
37+
---
38+
139
# v1.2.12 (Fri Mar 08 2024)
240

341
#### 🐛 Bug Fix

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,5 +159,5 @@
159159
"react-native"
160160
]
161161
},
162-
"version": "1.2.12"
162+
"version": "1.2.15"
163163
}

src/Panel.tsx

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,13 @@ export const Panel = ({ active, api }: PanelProps) => {
8080
addonUninstalled={addonUninstalled}
8181
setAddonUninstalled={setAddonUninstalled}
8282
>
83-
<RunBuildProvider watchState={{ isRunning, startBuild, stopBuild }}>
84-
<div hidden={!active} style={{ containerType: "size", height: "100%" }}>
85-
{children}
86-
</div>
87-
</RunBuildProvider>
83+
<ControlsProvider>
84+
<RunBuildProvider watchState={{ isRunning, startBuild, stopBuild }}>
85+
<div hidden={!active} style={{ containerType: "size", height: "100%" }}>
86+
{children}
87+
</div>
88+
</RunBuildProvider>
89+
</ControlsProvider>
8890
</UninstallProvider>
8991
</AuthProvider>
9092
</Provider>
@@ -151,17 +153,15 @@ export const Panel = ({ active, api }: PanelProps) => {
151153

152154
const localBuildIsRightBranch = gitInfo.branch === localBuildProgress?.branch;
153155
return withProviders(
154-
<ControlsProvider>
155-
<VisualTests
156-
dismissBuildError={() => setLocalBuildProgress(undefined)}
157-
isOutdated={!!isOutdated}
158-
localBuildProgress={localBuildIsRightBranch ? localBuildProgress : undefined}
159-
setOutdated={setOutdated}
160-
updateBuildStatus={updateBuildStatus}
161-
projectId={projectId}
162-
gitInfo={gitInfo}
163-
storyId={storyId}
164-
/>
165-
</ControlsProvider>
156+
<VisualTests
157+
dismissBuildError={() => setLocalBuildProgress(undefined)}
158+
isOutdated={!!isOutdated}
159+
localBuildProgress={localBuildIsRightBranch ? localBuildProgress : undefined}
160+
setOutdated={setOutdated}
161+
updateBuildStatus={updateBuildStatus}
162+
projectId={projectId}
163+
gitInfo={gitInfo}
164+
storyId={storyId}
165+
/>
166166
);
167167
};

src/components/Screen.tsx

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,17 @@ const InfoSection = styled(Section)(({ theme }) => ({
2727

2828
interface ConfigSectionProps {
2929
hidden?: boolean;
30+
ignoreConfig?: boolean;
31+
ignoreSuggestions?: boolean;
3032
onOpen: (scrollTo?: keyof ConfigInfoPayload["configuration"]) => void;
3133
}
3234

33-
export const ConfigSection = ({ hidden, onOpen }: ConfigSectionProps) => {
35+
export const ConfigSection = ({
36+
hidden,
37+
ignoreConfig,
38+
ignoreSuggestions,
39+
onOpen,
40+
}: ConfigSectionProps) => {
3441
const [configInfo] = useSharedState<ConfigInfoPayload>(CONFIG_INFO);
3542
const problems = Object.keys(configInfo?.problems || {});
3643
const suggestions = Object.keys(configInfo?.suggestions || {});
@@ -48,7 +55,7 @@ export const ConfigSection = ({ hidden, onOpen }: ConfigSectionProps) => {
4855
</Link>
4956
);
5057

51-
if (problems.length > 0)
58+
if (problems.length > 0 && !ignoreConfig)
5259
return (
5360
<WarningSection hidden={hidden}>
5461
<Bar>
@@ -62,7 +69,7 @@ export const ConfigSection = ({ hidden, onOpen }: ConfigSectionProps) => {
6269
</WarningSection>
6370
);
6471

65-
if (suggestions.length > 0 && !dismissed)
72+
if (suggestions.length > 0 && !dismissed && !ignoreConfig && !ignoreSuggestions)
6673
return (
6774
<InfoSection hidden={hidden}>
6875
<Bar>
@@ -84,6 +91,8 @@ export const ConfigSection = ({ hidden, onOpen }: ConfigSectionProps) => {
8491
interface ScreenProps {
8592
children: ReactNode;
8693
footer?: ReactNode;
94+
ignoreConfig?: boolean;
95+
ignoreSuggestions?: boolean;
8796
}
8897

8998
const Container = styled.div({
@@ -122,6 +131,8 @@ export const Screen = ({
122131
</Col>
123132
</Footer>
124133
),
134+
ignoreConfig = false,
135+
ignoreSuggestions = !footer,
125136
}: ScreenProps) => {
126137
const { configVisible } = useControlsState();
127138
const { toggleConfig } = useControlsDispatch();
@@ -140,7 +151,12 @@ export const Screen = ({
140151

141152
return (
142153
<Container>
143-
<ConfigSection onOpen={openConfig} hidden={configVisible} />
154+
<ConfigSection
155+
onOpen={openConfig}
156+
hidden={configVisible}
157+
ignoreConfig={ignoreConfig}
158+
ignoreSuggestions={!footer}
159+
/>
144160
<Content hidden={configVisible}>{children}</Content>
145161
<Content hidden={!configVisible}>
146162
<Configuration onClose={() => toggleConfig(false)} />

src/components/SnapshotImageThumb.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,10 @@ export const SnapshotImageThumb = ({
4444
backgroundColor,
4545
status,
4646
thumbnailUrl,
47-
...imgProps
4847
}: SnapshotImageThumbProps & React.ImgHTMLAttributes<HTMLImageElement>) => {
4948
return (
5049
<Wrapper status={status} style={backgroundColor ? { backgroundColor } : {}}>
51-
<img alt="Snapshot thumbnail" src={thumbnailUrl} {...imgProps} />
50+
<img alt="Snapshot thumbnail" src={thumbnailUrl} />
5251
{status === "positive" && <CheckIcon />}
5352
</Wrapper>
5453
);

src/components/design-system/tooltip/ListItem.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import weakMemoize from "@emotion/weak-memoize";
22
import { styled, type Theme, useTheme } from "@storybook/theming";
33
import React, { ComponentProps, ReactNode } from "react";
44

5+
import { inlineGlow } from "../shared/animation";
6+
57
const Left = styled.span({});
68
const Title = styled.span(({ theme }) => ({
79
fontWeight: theme.typography.weight.bold,
@@ -116,10 +118,7 @@ const linkStyles = ({
116118

117119
...(isLoading && {
118120
".sbds-list-item-title": {
119-
animation: `${theme.animation.inlineGlow} 1.5s ease-in-out infinite`,
120-
background: "rgba(0, 0, 0, 0.05)", // theme.color.tr5,
121-
color: "transparent",
122-
cursor: "progress",
121+
...inlineGlow,
123122
flex: "0 1 auto",
124123
display: "inline-block",
125124
},

src/manager.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,15 @@ addons.register(ADDON_ID, (api) => {
3434
const channel = api.getChannel();
3535
if (!channel) return;
3636

37+
let notificationShown = false;
3738
channel.on(`${ADDON_ID}/heartbeat`, () => {
3839
clearTimeout(heartbeatTimeout);
40+
if (notificationShown) {
41+
notificationShown = false;
42+
api.clearNotification(`${ADDON_ID}/connection-lost`);
43+
}
3944
heartbeatTimeout = setTimeout(() => {
45+
notificationShown = true;
4046
api.addNotification({
4147
id: `${ADDON_ID}/connection-lost`,
4248
content: {

src/screens/Authentication/SetSubdomain.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export const SetSubdomain = ({ onBack, onSignIn }: SetSubdomainProps) => {
5656
);
5757

5858
return (
59-
<Screen footer={null}>
59+
<Screen footer={null} ignoreConfig>
6060
<Container>
6161
<BackButton onClick={onBack}>
6262
<ChevronLeftIcon color={theme.base === "light" ? "currentColor" : theme.color.medium} />

src/screens/Authentication/SignIn.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const Label = styled.span(({ theme }) => ({
2626
export const SignIn = ({ onBack, onSignIn, onSignInWithSSO }: SignInProps) => {
2727
const theme = useTheme();
2828
return (
29-
<Screen footer={null}>
29+
<Screen footer={null} ignoreConfig>
3030
<Container>
3131
{onBack && (
3232
<BackButton onClick={onBack}>

src/screens/Authentication/Verify.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ export const Verify = ({
139139
closeDialogRef.current = closeDialog;
140140

141141
return (
142-
<Screen footer={null}>
142+
<Screen footer={null} ignoreConfig>
143143
<Container>
144144
<BackButton onClick={onBack}>
145145
<ChevronLeftIcon color={theme.base === "light" ? "currentColor" : theme.color.medium} />

src/screens/Authentication/Welcome.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ interface WelcomeProps {
1616

1717
export const Welcome = ({ onNext, onUninstall }: WelcomeProps) => {
1818
return (
19-
<Screen footer={null}>
19+
<Screen footer={null} ignoreConfig>
2020
<Container>
2121
<Stack>
2222
<div>

src/screens/VisualTests/SnapshotControls.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ export const SnapshotControls = ({ isOutdated }: { isOutdated: boolean }) => {
117117
<Label>
118118
<Text>
119119
<b>
120-
{baselineImageVisible ? <span>Baseline snapshot</span> : <span>Latest snapshot</span>}
120+
{baselineImageVisible ? "Baseline" : "Latest"}
121+
<span> snapshot</span>
121122
</b>
122123
</Text>
123124
</Label>

src/screens/VisualTests/StoryInfo.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { styled } from "@storybook/theming";
44
import pluralize from "pluralize";
55
import React from "react";
66

7-
import { Button } from "../../components/Button";
7+
import { ActionButton } from "../../components/ActionButton";
88
import { AlertIcon } from "../../components/icons/AlertIcon";
99
import { ProgressIcon } from "../../components/icons/ProgressIcon";
1010
import { StatusIcon } from "../../components/icons/StatusIcon";
@@ -200,10 +200,10 @@ export const StoryInfo = ({
200200

201201
{showButton && (
202202
<Actions>
203-
<Button size="medium" variant="solid" onClick={startBuild} disabled={isRunning}>
203+
<ActionButton onClick={startBuild} disabled={isRunning}>
204204
{isRunning ? <ProgressIcon parentComponent="Button" /> : <PlayIcon />}
205205
{isErrored ? "Rerun tests" : "Run tests"}
206-
</Button>
206+
</ActionButton>
207207
</Actions>
208208
)}
209209
</>

0 commit comments

Comments
 (0)