From 1fe876e89c5c7f5f64227ac8be602e38ed6e4d49 Mon Sep 17 00:00:00 2001 From: Quinn Slack Date: Sun, 21 Jul 2024 18:37:02 -0700 Subject: [PATCH] finish removing chromatic (#63966) We removed Chromatic in https://github.com/sourcegraph/sourcegraph/pull/62228, but there were still some remnants. ## Test plan CI --- .eslintrc.js | 4 -- .../branded/src/components/Toggle.story.tsx | 6 --- .../panel/TabbedPanelContent.story.tsx | 6 +-- .../components/RepoMetadata.story.tsx | 9 +--- .../SyntaxHighlightedSearchQuery.story.tsx | 4 +- .../input/BaseCodeMirrorQueryInput.story.tsx | 4 +- .../src/search-ui/input/SearchBox.story.tsx | 4 +- .../input/SearchContextMenu.story.tsx | 1 - .../input/SearchContextMenuItem.story.tsx | 4 +- .../filters/NewSearchFilters.story.tsx | 4 +- .../progress/StreamingProgress.story.tsx | 1 - .../StreamingProgressSkippedPopover.story.tsx | 1 - .../AfterInstallPageContent.story.tsx | 7 +-- .../options-menu/OptionsPage.story.tsx | 7 --- .../shared/components/HoverOverlay.story.tsx | 7 +-- .../search/input/JetBrainsSearchBox.story.tsx | 6 --- .../search/results/SearchResultList.story.tsx | 6 --- .../shared/src/actions/ActionItem.story.tsx | 6 --- client/shared/src/symbols/SymbolTag.story.tsx | 4 +- client/storybook/BUILD.bazel | 21 +------- client/storybook/package.json | 1 - .../ChromaticRoot/ChromaticRoot.module.scss | 7 --- .../ChromaticRoot/ChromaticRoot.tsx | 30 ----------- .../ChromaticRoot/index.ts | 1 - .../decorators/withChromaticThemes/index.ts | 1 - .../withChromaticThemes.tsx | 32 ----------- client/storybook/src/environment-config.ts | 3 -- client/storybook/src/main.ts | 38 +------------ client/storybook/src/preview.ts | 28 +--------- client/web/src/auth/CloudSignUpPage.story.tsx | 4 +- .../web/src/auth/RequestAccessPage.story.tsx | 4 +- .../web/src/auth/ResetPasswordPage.story.tsx | 4 +- client/web/src/auth/SignInPage.story.tsx | 4 +- client/web/src/auth/SignUpPage.story.tsx | 4 +- client/web/src/auth/UnlockAccount.story.tsx | 4 +- .../web/src/auth/VsCodeSignUpPage.story.tsx | 4 +- .../src/codeintel/ReferencesPanel.story.tsx | 3 -- .../CommunitySearchContextPage.story.tsx | 1 - .../WebHoverOverlay/WebHoverOverlay.story.tsx | 4 -- .../AddExternalServicesPage.story.tsx | 7 +-- .../ExternalServiceEditPage.story.tsx | 7 +-- .../ExternalServiceSyncJobNode.story.tsx | 4 +- .../fuzzyFinder/FuzzyFinder.story.tsx | 6 +-- client/web/src/components/time/Duration.tsx | 2 +- .../batches/BatchSpecsPage.story.tsx | 7 +-- .../edit/editor/MonacoBatchSpecEditor.tsx | 6 +-- .../execute/ExecuteBatchSpecPage.story.tsx | 37 ++----------- .../close/BatchChangeCloseAlert.story.tsx | 6 +-- .../close/BatchChangeClosePage.story.tsx | 7 +-- .../create/ConfigurationForm.story.tsx | 6 +-- .../create/CreateBatchChangePage.story.tsx | 6 +-- .../detail/BatchChangeDetailsPage.story.tsx | 4 -- .../list/BatchChangeListPage.story.tsx | 7 +-- .../batches/list/BatchChangeNode.story.tsx | 8 +-- .../list/BatchChangesChangelogAlert.tsx | 5 +- .../batches/list/GettingStarted.story.tsx | 6 +-- .../preview/BatchChangePreviewPage.story.tsx | 7 +-- .../CreateUpdateBatchChangeAlert.story.tsx | 6 +-- .../preview/list/PreviewList.story.tsx | 6 --- .../repo/BatchChangeRepoPage.story.tsx | 7 +-- .../settings/AddCredentialModal.story.tsx | 7 +-- .../settings/RemoveCredentialModal.story.tsx | 7 +-- .../settings/ViewCredentialModal.story.tsx | 7 --- .../CodeMonitoringLogs.story.tsx | 6 +-- .../CodeMonitoringPage.story.tsx | 8 +-- .../CreateCodeMonitorPage.story.tsx | 4 +- .../ManageCodeMonitorPage.story.tsx | 1 - .../components/DeleteMonitorModal.story.tsx | 4 +- .../components/FormTriggerArea.story.tsx | 5 -- .../components/actions/EmailAction.story.tsx | 4 +- .../actions/SlackWebhookAction.story.tsx | 4 +- .../actions/WebhookAction.story.tsx | 4 +- .../secrets/AddSecretModal.story.tsx | 7 +-- .../secrets/ExecutorSecretsListPage.story.tsx | 7 +-- .../secrets/RemoveSecretModal.story.tsx | 7 +-- .../secrets/SecretAccessLogsModal.story.tsx | 7 +-- .../secrets/UpdateSecretModal.story.tsx | 7 +-- .../SmartInsightsViewGrid.story.tsx | 7 +-- .../backend-insight/BackendInsight.story.tsx | 6 +-- .../insights/modals/GaConfirmationModal.tsx | 4 +- .../InsightsDashboardCreationPage.story.tsx | 7 +-- .../EmptyInsightDashboard.story.tsx | 6 +-- .../CaptureGroupCreationPage.story.tsx | 7 +-- .../ComputeInsightCreationPage.story.tsx | 7 +-- .../intro/IntroCreationPage.story.tsx | 7 +-- .../intro/cards/InsightCards.story.tsx | 7 +-- .../LangStatsInsightCreationPage.story.tsx | 7 +-- .../SearchInsightCreationPage.story.tsx | 7 +-- .../own/RepositoryOwnEditPage.story.tsx | 4 +- .../own/admin-ui/OwnAnalyticsPage.story.tsx | 4 +- .../search-jobs/SearchJobsPage.story.tsx | 6 +-- .../DeleteSearchContextModal.story.tsx | 4 +- .../SearchContextForm.story.tsx | 4 +- .../SearchContextPage.story.tsx | 4 +- .../SearchContextsList.story.tsx | 4 +- .../site-admin/SiteAdminSidebar.story.tsx | 6 +-- client/web/src/global/GlobalAlert.story.tsx | 3 -- client/web/src/nav/GlobalNavbar.story.tsx | 10 +--- client/web/src/nav/StatusMessagesNavItem.tsx | 2 +- client/web/src/nav/UserNavItem.story.tsx | 4 -- .../StatusMessagesNavItem.test.tsx.snap | 4 +- .../listPage/NotebooksListPage.story.tsx | 4 +- .../notebook/NotebookComponent.story.tsx | 4 +- client/web/src/prompts/EditPage.story.tsx | 4 +- client/web/src/prompts/Form.story.tsx | 4 +- client/web/src/prompts/ListPage.story.tsx | 4 +- client/web/src/prompts/NewForm.story.tsx | 4 +- client/web/src/repo/RepoHeader.story.tsx | 7 --- .../repo/actions/GoToCodeHostAction.story.tsx | 18 ------- .../blob/own/FileOwnershipPanel.story.tsx | 4 +- .../repo/blob/own/HistoryAndOwnBar.story.tsx | 4 +- .../src/repo/commits/GitCommitNode.story.tsx | 4 +- .../web/src/savedSearches/EditPage.story.tsx | 4 +- client/web/src/savedSearches/Form.story.tsx | 4 +- .../web/src/savedSearches/ListPage.story.tsx | 4 +- .../web/src/savedSearches/NewForm.story.tsx | 4 +- .../results/StreamingSearchResults.story.tsx | 4 +- .../SearchAggregationResult.story.tsx | 4 +- .../results/sidebar/Revisions.story.tsx | 4 +- .../sidebar/SearchFiltersSidebar.story.tsx | 1 - .../search/suggestion/SmartSearch.story.tsx | 4 +- .../SiteAdminMigrationsPage.story.tsx | 6 +-- .../components/DateRangeSelect.story.tsx | 14 ----- .../site-admin/init/SiteInitPage.story.tsx | 4 +- .../webhooks/MessagePanel.story.tsx | 6 +-- .../webhooks/PerformanceGauge.story.tsx | 6 +-- .../site-admin/webhooks/StatusCode.story.tsx | 6 +-- .../webhooks/WebhookLogNode.story.tsx | 6 +-- .../webhooks/WebhookLogPageHeader.story.tsx | 6 +-- .../SearchPage/SearchPageContent.story.tsx | 1 - .../team/area/TeamChildTeamsPage.story.tsx | 4 +- .../src/team/area/TeamMembersPage.story.tsx | 4 +- .../src/team/area/TeamProfilePage.story.tsx | 4 +- .../web/src/team/list/TeamListPage.story.tsx | 4 +- client/web/src/team/new/NewTeamPage.story.tsx | 4 +- .../src/tour/components/Tour/Tour.story.tsx | 4 -- client/wildcard/BUILD.bazel | 3 -- .../src/components/Alert/Alert.story.tsx | 5 +- .../src/components/Badge/Badge.story.tsx | 5 +- .../Badge/ProductStatusBadge.story.tsx | 5 +- .../components/Button/story/Button.story.tsx | 13 ----- .../ButtonLink/ButtonLink.story.tsx | 5 +- .../src/components/Card/Card.story.tsx | 5 +- .../components/bar-chart/BarChart.story.tsx | 4 +- .../components/line-chart/LineChart.test.tsx | 1 - .../line-chart/story/LineChart.story.tsx | 4 +- .../components/pie-chart/PieChart.story.tsx | 4 +- .../stacked-meter/StackedMeter.story.tsx | 4 +- .../Charts/core/components/SvgRoot.story.tsx | 3 +- .../Combobox/MultiCombobox.story.tsx | 7 +-- .../components/Container/Container.story.tsx | 4 -- .../FeedbackBadge/FeedbackBadge.story.tsx | 5 +- .../FeedbackPrompt/FeedbackPrompt.story.tsx | 11 +--- .../FeedbackText/FeedbackText.story.tsx | 4 -- .../Form/Checkbox/Checkbox.story.tsx | 7 --- .../src/components/Form/Input/Input.story.tsx | 5 +- .../Form/RadioButton/RadioButton.story.tsx | 7 --- .../components/Form/Select/Select.story.tsx | 7 --- .../Form/TextArea/TextArea.story.tsx | 5 +- .../src/components/Icon/Icon.story.tsx | 5 +- .../src/components/Link/Link/Link.story.tsx | 4 -- .../LoadingSpinner/LoadingSpinner.story.tsx | 4 -- .../src/components/Menu/Menu.story.tsx | 4 -- .../src/components/Modal/Modal.story.tsx | 4 +- .../src/components/NavMenu/NavMenu.story.tsx | 4 -- .../PageHeader/PageHeader.story.tsx | 4 -- .../PageSelector/PageSelector.story.tsx | 7 --- .../PageSwitcher/PageSwitcher.story.tsx | 7 --- .../components/Panel/story/Panel.story.tsx | 5 +- .../Popover/story/Popover.story.tsx | 6 --- .../src/components/Tabs/Tabs.story.tsx | 4 -- .../src/components/Tooltip/Tooltip.story.tsx | 6 --- .../src/components/Tree/Tree.story.tsx | 4 -- .../Typography/Typography.story.tsx | 5 +- .../GlobalStylesStory/GlobalStyles.story.tsx | 6 +-- client/wildcard/src/stories/hooks/index.ts | 1 - .../src/stories/hooks/useChromaticTheme.ts | 13 ----- .../src/stories/hooks/useStorybookTheme.ts | 9 +--- client/wildcard/src/stories/index.ts | 2 - .../wildcard/src/stories/utils/isChromatic.ts | 7 --- dev/ci/internal/ci/config.go | 9 +--- dev/ci/internal/ci/operations.go | 1 - dev/ci/internal/ci/pipeline.go | 2 - doc/dev/background-information/web/styling.md | 2 - package.json | 4 -- pnpm-lock.yaml | 54 ++++++------------- third-party-licenses/ThirdPartyLicenses.csv | 2 - 187 files changed, 151 insertions(+), 1003 deletions(-) delete mode 100644 client/storybook/src/decorators/withChromaticThemes/ChromaticRoot/ChromaticRoot.module.scss delete mode 100644 client/storybook/src/decorators/withChromaticThemes/ChromaticRoot/ChromaticRoot.tsx delete mode 100644 client/storybook/src/decorators/withChromaticThemes/ChromaticRoot/index.ts delete mode 100644 client/storybook/src/decorators/withChromaticThemes/index.ts delete mode 100644 client/storybook/src/decorators/withChromaticThemes/withChromaticThemes.tsx delete mode 100644 client/wildcard/src/stories/hooks/useChromaticTheme.ts delete mode 100644 client/wildcard/src/stories/utils/isChromatic.ts diff --git a/.eslintrc.js b/.eslintrc.js index fa21d95bff5..3437d6d7326 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -114,10 +114,6 @@ const config = { importNames: ['Link'], message: 'Use the component from @sourcegraph/wildcard instead.', }, - { - name: 'chromatic/isChromatic', - message: 'Please use `isChromatic` from the `@sourcegraph/storybook` package.', - }, ], patterns: [ { diff --git a/client/branded/src/components/Toggle.story.tsx b/client/branded/src/components/Toggle.story.tsx index 72f992359e8..2fec69d3cdb 100644 --- a/client/branded/src/components/Toggle.story.tsx +++ b/client/branded/src/components/Toggle.story.tsx @@ -36,12 +36,6 @@ export const Interactive: StoryFn = () => { return } -Interactive.parameters = { - chromatic: { - disable: true, - }, -} - export const Variants: StoryFn = () => ( <> diff --git a/client/branded/src/components/panel/TabbedPanelContent.story.tsx b/client/branded/src/components/panel/TabbedPanelContent.story.tsx index f3120216f27..830e0b32205 100644 --- a/client/branded/src/components/panel/TabbedPanelContent.story.tsx +++ b/client/branded/src/components/panel/TabbedPanelContent.story.tsx @@ -13,11 +13,7 @@ const decorator: Decorator = story => ( const config: Meta = { title: 'branded/TabbedPanelContent', decorators: [decorator], - parameters: { - chromatic: { - viewports: [320, 576, 978, 1440], - }, - }, + parameters: {}, } export default config diff --git a/client/branded/src/search-ui/components/RepoMetadata.story.tsx b/client/branded/src/search-ui/components/RepoMetadata.story.tsx index f1cdb0d576d..2b450b6a451 100644 --- a/client/branded/src/search-ui/components/RepoMetadata.story.tsx +++ b/client/branded/src/search-ui/components/RepoMetadata.story.tsx @@ -7,9 +7,7 @@ import { type RepoMetadataItem, RepoMetadata } from './RepoMetadata' const config: Meta = { title: 'branded/search-ui/RepoMetadata', - parameters: { - chromatic: { viewports: [480] }, - }, + parameters: {}, } export default config @@ -50,8 +48,3 @@ export const RepoMetadataStory: StoryFn = () => ( ) RepoMetadataStory.storyName = 'RepoMetadata' -RepoMetadataStory.parameters = { - chromatic: { - disableSnapshot: false, - }, -} diff --git a/client/branded/src/search-ui/components/SyntaxHighlightedSearchQuery.story.tsx b/client/branded/src/search-ui/components/SyntaxHighlightedSearchQuery.story.tsx index ebd65461926..86963ef12d2 100644 --- a/client/branded/src/search-ui/components/SyntaxHighlightedSearchQuery.story.tsx +++ b/client/branded/src/search-ui/components/SyntaxHighlightedSearchQuery.story.tsx @@ -8,9 +8,7 @@ import { SyntaxHighlightedSearchQuery } from './SyntaxHighlightedSearchQuery' const config: Meta = { title: 'branded/search-ui/SyntaxHighlightedSearchQuery', - parameters: { - chromatic: { viewports: [480] }, - }, + parameters: {}, } export default config diff --git a/client/branded/src/search-ui/input/BaseCodeMirrorQueryInput.story.tsx b/client/branded/src/search-ui/input/BaseCodeMirrorQueryInput.story.tsx index 9567282edcc..0c82d0e27fc 100644 --- a/client/branded/src/search-ui/input/BaseCodeMirrorQueryInput.story.tsx +++ b/client/branded/src/search-ui/input/BaseCodeMirrorQueryInput.story.tsx @@ -10,9 +10,7 @@ import { BaseCodeMirrorQueryInput, type BaseCodeMirrorQueryInputProps } from './ const config: Meta = { title: 'branded/search-ui/input/BaseCodeMirrorQueryInput', - parameters: { - chromatic: { viewports: [500] }, - }, + parameters: {}, } export default config diff --git a/client/branded/src/search-ui/input/SearchBox.story.tsx b/client/branded/src/search-ui/input/SearchBox.story.tsx index 6becaea6b88..5afdba33218 100644 --- a/client/branded/src/search-ui/input/SearchBox.story.tsx +++ b/client/branded/src/search-ui/input/SearchBox.story.tsx @@ -16,9 +16,7 @@ import { SearchBox, type SearchBoxProps } from './SearchBox' const config: Meta = { title: 'branded/search-ui/input/SearchBox', - parameters: { - chromatic: { viewports: [575, 700], disableSnapshot: false }, - }, + parameters: {}, } export default config diff --git a/client/branded/src/search-ui/input/SearchContextMenu.story.tsx b/client/branded/src/search-ui/input/SearchContextMenu.story.tsx index f5a6de5950c..1f39ad30d84 100644 --- a/client/branded/src/search-ui/input/SearchContextMenu.story.tsx +++ b/client/branded/src/search-ui/input/SearchContextMenu.story.tsx @@ -22,7 +22,6 @@ const decorator: Decorator = story => ( const config: Meta = { title: 'branded/search-ui/input/SearchContextMenu', parameters: { - chromatic: { viewports: [500], disableSnapshot: false }, design: { type: 'figma', url: 'https://www.figma.com/file/4Fy9rURbfF2bsl4BvYunUO/RFC-261-Search-Contexts?node-id=581%3A4754', diff --git a/client/branded/src/search-ui/input/SearchContextMenuItem.story.tsx b/client/branded/src/search-ui/input/SearchContextMenuItem.story.tsx index 9abdd30fc07..25461a22e70 100644 --- a/client/branded/src/search-ui/input/SearchContextMenuItem.story.tsx +++ b/client/branded/src/search-ui/input/SearchContextMenuItem.story.tsx @@ -13,9 +13,7 @@ const decorator: Decorator = story => ( const config: Meta = { title: 'branded/search-ui/input/SearchContextMenuItem', - parameters: { - chromatic: { viewports: [1200], disableSnapshot: false }, - }, + parameters: {}, decorators: [decorator], } diff --git a/client/branded/src/search-ui/results/filters/NewSearchFilters.story.tsx b/client/branded/src/search-ui/results/filters/NewSearchFilters.story.tsx index 7ebdd4450ac..f6b06b0b0c6 100644 --- a/client/branded/src/search-ui/results/filters/NewSearchFilters.story.tsx +++ b/client/branded/src/search-ui/results/filters/NewSearchFilters.story.tsx @@ -11,9 +11,7 @@ const decorator: Decorator = story => {props => story()} { ) } - -JetBrainsSearchBoxStory.parameters = { - chromatic: { - disableSnapshot: false, - }, -} diff --git a/client/jetbrains/webview/src/search/results/SearchResultList.story.tsx b/client/jetbrains/webview/src/search/results/SearchResultList.story.tsx index 56013044c64..4a3138f939c 100644 --- a/client/jetbrains/webview/src/search/results/SearchResultList.story.tsx +++ b/client/jetbrains/webview/src/search/results/SearchResultList.story.tsx @@ -123,9 +123,3 @@ export const JetBrainsSearchResultListStory: StoryFn = () => { ) } - -JetBrainsSearchResultListStory.parameters = { - chromatic: { - disableSnapshot: false, - }, -} diff --git a/client/shared/src/actions/ActionItem.story.tsx b/client/shared/src/actions/ActionItem.story.tsx index 48fa8b1b33e..716fc565024 100644 --- a/client/shared/src/actions/ActionItem.story.tsx +++ b/client/shared/src/actions/ActionItem.story.tsx @@ -63,12 +63,6 @@ export const CommandAction: StoryFn = () => ( ) CommandAction.storyName = 'Command action' -CommandAction.parameters = { - chromatic: { - enableDarkMode: true, - disableSnapshot: false, - }, -} export const LinkAction: StoryFn = () => (
{story()}> = props => { - const { theme, children } = props - - const [rootReference, setElement] = useState(null) - const themeClass = theme === 'light' ? 'theme-light' : 'theme-dark' - - return ( - - {/* Required to render `Popover` inside of the `ChromaticRoot` component. */} - -
- {children} - -
-
- - - ) -} diff --git a/client/storybook/src/decorators/withChromaticThemes/ChromaticRoot/index.ts b/client/storybook/src/decorators/withChromaticThemes/ChromaticRoot/index.ts deleted file mode 100644 index 1b269a8aecf..00000000000 --- a/client/storybook/src/decorators/withChromaticThemes/ChromaticRoot/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './ChromaticRoot' diff --git a/client/storybook/src/decorators/withChromaticThemes/index.ts b/client/storybook/src/decorators/withChromaticThemes/index.ts deleted file mode 100644 index 63a7d1f940d..00000000000 --- a/client/storybook/src/decorators/withChromaticThemes/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './withChromaticThemes' diff --git a/client/storybook/src/decorators/withChromaticThemes/withChromaticThemes.tsx b/client/storybook/src/decorators/withChromaticThemes/withChromaticThemes.tsx deleted file mode 100644 index fb82bb917e3..00000000000 --- a/client/storybook/src/decorators/withChromaticThemes/withChromaticThemes.tsx +++ /dev/null @@ -1,32 +0,0 @@ -import type { ReactElement } from 'react' - -import type { Decorator } from '@storybook/react' - -import { ChromaticRoot } from './ChromaticRoot' - -/** - * The global Storybook decorator used to snapshot stories with multiple themes in Chromatic. - * - * It's a recommended way of achieving this goal: - * https://www.chromatic.com/docs/faq#do-you-support-taking-snapshots-of-a-component-with-multiple-the - * - * If the `chromatic.enableDarkMode` story parameter is set to `true`, the story will - * be rendered twice in Chromatic — in light and dark modes. - */ -export const withChromaticThemes: Decorator = (StoryFunc, { parameters }) => { - if (parameters?.chromatic?.enableDarkMode) { - return ( - <> - - - - - - - - - ) - } - - return -} diff --git a/client/storybook/src/environment-config.ts b/client/storybook/src/environment-config.ts index 6293146e512..ddfda8118bb 100644 --- a/client/storybook/src/environment-config.ts +++ b/client/storybook/src/environment-config.ts @@ -1,6 +1,3 @@ -import { getEnvironmentBoolean } from '@sourcegraph/build-config' - export const ENVIRONMENT_CONFIG = { STORIES_GLOB: process.env.STORIES_GLOB, - CHROMATIC: getEnvironmentBoolean('CHROMATIC'), } diff --git a/client/storybook/src/main.ts b/client/storybook/src/main.ts index 99decd25cf6..85d7c49887d 100644 --- a/client/storybook/src/main.ts +++ b/client/storybook/src/main.ts @@ -3,9 +3,8 @@ import path from 'path' import type { StorybookConfigVite } from '@storybook/builder-vite' import type { StorybookConfig as ReactViteStorybookConfig } from '@storybook/react-vite' import type { StorybookConfig } from '@storybook/types' -import turbosnap from 'vite-plugin-turbosnap' -import { ROOT_PATH, STATIC_ASSETS_PATH, getEnvironmentBoolean } from '@sourcegraph/build-config' +import { ROOT_PATH, STATIC_ASSETS_PATH } from '@sourcegraph/build-config' import { ENVIRONMENT_CONFIG } from './environment-config' @@ -26,12 +25,7 @@ const getStoriesGlob = (): string[] => { } const config: StorybookConfig & StorybookConfigVite & ReactViteStorybookConfig = { - // TODO: This has to be an object and not a string for now due to a bug in Chromatic - // that would cause the builder to not be identified correctly. - framework: { - name: '@storybook/react-vite', - options: {}, - }, + framework: '@storybook/react-vite', staticDirs: [path.resolve(__dirname, '../assets'), STATIC_ASSETS_PATH], stories: getStoriesGlob(), @@ -56,15 +50,6 @@ const config: StorybookConfig & StorybookConfigVite & ReactViteStorybookConfig = }, viteFinal: (config, { configType }) => { - const isChromatic = getEnvironmentBoolean('CHROMATIC') - config.define = { ...config.define, 'process.env.CHROMATIC': isChromatic } - if (isChromatic && configType === 'PRODUCTION') { - // eslint-disable-next-line no-console - console.log('Using TurboSnap plugin!') - config.plugins = config.plugins ?? [] - config.plugins.push(turbosnap({ rootDir: config.root ?? ROOT_PATH })) - } - config.build = { ...config.build, minify: false, @@ -114,23 +99,4 @@ const config: StorybookConfig & StorybookConfigVite & ReactViteStorybookConfig = }, } -// TODO: We need to replace the @storybook/addon-storysource plugin with an object -// definition to supply options here because chromatic CLI does not properly understand -// the configured addons otherwise. -const idx = config.addons?.findIndex(addon => addon === '@storybook/addon-storysource') -if (idx !== undefined && idx >= 0) { - config.addons![idx] = { - name: '@storybook/addon-storysource', - options: { - rule: { - test: /\.story\.tsx?$/, - }, - sourceLoaderOptions: { - injectStoryParameters: false, - prettierConfig: { printWidth: 80, singleQuote: false }, - }, - }, - } -} - module.exports = config diff --git a/client/storybook/src/preview.ts b/client/storybook/src/preview.ts index c96706cea19..420e8e83ea1 100644 --- a/client/storybook/src/preview.ts +++ b/client/storybook/src/preview.ts @@ -7,14 +7,12 @@ import { withConsole } from '@storybook/addon-console' import type { DecoratorFn, Parameters } from '@storybook/react' import { setLinkComponent, AnchorLink } from '@sourcegraph/wildcard' -import { isChromatic } from '@sourcegraph/wildcard/src/stories' -import { withChromaticThemes } from './decorators/withChromaticThemes' import { themeDark, themeLight, THEME_DARK_CLASS, THEME_LIGHT_CLASS } from './themes' const withConsoleDecorator: DecoratorFn = (storyFunc, context): ReactElement => withConsole()(storyFunc)(context) -export const decorators = [withConsoleDecorator, isChromatic() && withChromaticThemes].filter(Boolean) +export const decorators = [withConsoleDecorator].filter(Boolean) export const parameters: Parameters = { layout: 'fullscreen', @@ -31,36 +29,12 @@ export const parameters: Parameters = { light: themeLight, dark: themeDark, }, - // disables snapshotting for all stories by default - chromatic: { disableSnapshot: true }, } configureActions({ depth: 100, limit: 20 }) setLinkComponent(AnchorLink) -// Default to light theme for Chromatic and "Open canvas in new tab" button. -// addon-dark-mode will override this if it's running. -if (!document.body.classList.contains('theme-dark')) { - document.body.classList.add('theme-light') -} - -// Default to light theme for Chromatic and "Open canvas in new tab" button. -// addon-dark-mode will override this if it's running. -if (!document.body.classList.contains('theme-dark')) { - document.body.classList.add('theme-light') -} - -if (isChromatic()) { - const style = document.createElement('style') - style.innerHTML = ` - .monaco-editor .cursor { - visibility: hidden !important; - } - ` - document.head.append(style) -} - declare global { interface Window { STORYBOOK_ENV?: string diff --git a/client/web/src/auth/CloudSignUpPage.story.tsx b/client/web/src/auth/CloudSignUpPage.story.tsx index 35bab52b88e..ed9944d4547 100644 --- a/client/web/src/auth/CloudSignUpPage.story.tsx +++ b/client/web/src/auth/CloudSignUpPage.story.tsx @@ -11,9 +11,7 @@ import { CloudSignUpPage } from './CloudSignUpPage' const config: Meta = { title: 'web/auth/CloudSignUpPage', - parameters: { - chromatic: { disableSnapshot: false }, - }, + parameters: {}, } export default config diff --git a/client/web/src/auth/RequestAccessPage.story.tsx b/client/web/src/auth/RequestAccessPage.story.tsx index 0092e67a049..9a37892435a 100644 --- a/client/web/src/auth/RequestAccessPage.story.tsx +++ b/client/web/src/auth/RequestAccessPage.story.tsx @@ -8,9 +8,7 @@ import { RequestAccessPage } from './RequestAccessPage' const config: Meta = { title: 'web/auth/RequestAccessPage', - parameters: { - chromatic: { disableSnapshot: false }, - }, + parameters: {}, } export default config diff --git a/client/web/src/auth/ResetPasswordPage.story.tsx b/client/web/src/auth/ResetPasswordPage.story.tsx index 8c3188875bc..e4e41db637d 100644 --- a/client/web/src/auth/ResetPasswordPage.story.tsx +++ b/client/web/src/auth/ResetPasswordPage.story.tsx @@ -9,9 +9,7 @@ import { ResetPasswordPage } from './ResetPasswordPage' const config: Meta = { title: 'web/auth/ResetPasswordPage', - parameters: { - chromatic: { disableSnapshot: false }, - }, + parameters: {}, } export default config diff --git a/client/web/src/auth/SignInPage.story.tsx b/client/web/src/auth/SignInPage.story.tsx index dc7843ca270..3a58a71607a 100644 --- a/client/web/src/auth/SignInPage.story.tsx +++ b/client/web/src/auth/SignInPage.story.tsx @@ -9,9 +9,7 @@ import { SignInPage, type SignInPageProps } from './SignInPage' const config: Meta = { title: 'web/auth/SignInPage', - parameters: { - chromatic: { disableSnapshot: false }, - }, + parameters: {}, } export default config diff --git a/client/web/src/auth/SignUpPage.story.tsx b/client/web/src/auth/SignUpPage.story.tsx index fbed9d08fd7..b47ae1a84ab 100644 --- a/client/web/src/auth/SignUpPage.story.tsx +++ b/client/web/src/auth/SignUpPage.story.tsx @@ -10,9 +10,7 @@ import { SignUpPage } from './SignUpPage' const config: Meta = { title: 'web/auth/SignUpPage', - parameters: { - chromatic: { disableSnapshot: false }, - }, + parameters: {}, } export default config diff --git a/client/web/src/auth/UnlockAccount.story.tsx b/client/web/src/auth/UnlockAccount.story.tsx index 5328f488d94..2c9f237f8a2 100644 --- a/client/web/src/auth/UnlockAccount.story.tsx +++ b/client/web/src/auth/UnlockAccount.story.tsx @@ -9,9 +9,7 @@ import { UnlockAccountPage } from './UnlockAccount' const config: Meta = { title: 'web/auth/UnlockAccountPage', - parameters: { - chromatic: { disableSnapshot: false }, - }, + parameters: {}, } export default config diff --git a/client/web/src/auth/VsCodeSignUpPage.story.tsx b/client/web/src/auth/VsCodeSignUpPage.story.tsx index 6375a4ad9e9..337be445527 100644 --- a/client/web/src/auth/VsCodeSignUpPage.story.tsx +++ b/client/web/src/auth/VsCodeSignUpPage.story.tsx @@ -9,9 +9,7 @@ import { VsCodeSignUpPage, type VsCodeSignUpPageProps } from './VsCodeSignUpPage const config: Meta = { title: 'web/auth/VsCodeSignUpPage', - parameters: { - chromatic: { disableSnapshot: false }, - }, + parameters: {}, } export default config diff --git a/client/web/src/codeintel/ReferencesPanel.story.tsx b/client/web/src/codeintel/ReferencesPanel.story.tsx index 2484e7b5ade..1d04c6d54fa 100644 --- a/client/web/src/codeintel/ReferencesPanel.story.tsx +++ b/client/web/src/codeintel/ReferencesPanel.story.tsx @@ -14,9 +14,6 @@ const config: Meta = { parameters: { component: ReferencesPanel, - chromatic: { - disableSnapshot: false, - }, }, } diff --git a/client/web/src/communitySearchContexts/CommunitySearchContextPage.story.tsx b/client/web/src/communitySearchContexts/CommunitySearchContextPage.story.tsx index 582b5e8d3ca..321e63243d4 100644 --- a/client/web/src/communitySearchContexts/CommunitySearchContextPage.story.tsx +++ b/client/web/src/communitySearchContexts/CommunitySearchContextPage.story.tsx @@ -27,7 +27,6 @@ const config: Meta = { type: 'figma', url: 'https://www.figma.com/file/Xc4M24VTQq8itU0Lgb1Wwm/RFC-159-Visual-Design?node-id=66%3A611', }, - chromatic: { viewports: [769, 1200] }, }, } diff --git a/client/web/src/components/WebHoverOverlay/WebHoverOverlay.story.tsx b/client/web/src/components/WebHoverOverlay/WebHoverOverlay.story.tsx index da6eb1f046e..71ee08153d9 100644 --- a/client/web/src/components/WebHoverOverlay/WebHoverOverlay.story.tsx +++ b/client/web/src/components/WebHoverOverlay/WebHoverOverlay.story.tsx @@ -31,10 +31,6 @@ const config: Meta = { type: 'figma', url: 'https://www.figma.com/file/NIsN34NH7lPu04olBzddTw/Design-Refresh-Systemization-source-of-truth?node-id=2877%3A35469', }, - chromatic: { - enableDarkMode: true, - disableSnapshot: false, - }, }, decorators: [decorator], } diff --git a/client/web/src/components/externalServices/AddExternalServicesPage.story.tsx b/client/web/src/components/externalServices/AddExternalServicesPage.story.tsx index 8784fd330a7..6d690c217c8 100644 --- a/client/web/src/components/externalServices/AddExternalServicesPage.story.tsx +++ b/client/web/src/components/externalServices/AddExternalServicesPage.story.tsx @@ -13,12 +13,7 @@ const decorator: Decorator = story =>
{story()} ( const config: Meta = { title: 'web/External services/ExternalServiceEditPage', - parameters: { - chromatic: { - // Delay screenshot taking, so Monaco has some time to get syntax highlighting prepared. - delay: 2000, - }, - }, + parameters: {}, decorators: [decorator], } diff --git a/client/web/src/components/externalServices/ExternalServiceSyncJobNode.story.tsx b/client/web/src/components/externalServices/ExternalServiceSyncJobNode.story.tsx index 2eb2f21bd3a..55567a3bd38 100644 --- a/client/web/src/components/externalServices/ExternalServiceSyncJobNode.story.tsx +++ b/client/web/src/components/externalServices/ExternalServiceSyncJobNode.story.tsx @@ -11,9 +11,7 @@ const decorator: Decorator = story => {() =>
{story()} { public render(): JSX.Element | null { return ( of(mockWorkspaces(50, workspaceFields).node.workspaceResolution!.workspaces) -// A true executing batch spec wouldn't have a finishedAt set, but we need to have one so -// that Chromatic doesn't exhibit flakiness based on how long it takes to actually take -// the snapshot, since the timer in ExecuteBatchSpecPage is live in that case. -const EXECUTING_BATCH_SPEC_WITH_END_TIME = { - ...EXECUTING_BATCH_SPEC, - finishedAt: addMinutes(Date.parse(EXECUTING_BATCH_SPEC.startedAt!), 15).toISOString(), -} - export const Executing: StoryFn = () => ( {props => ( - + ( ) -// A true processing workspace wouldn't have a finishedAt set, but we need to have one so -// that Chromatic doesn't exhibit flakiness based on how long it takes to actually take -// the snapshot, since the timer in the workspace details section is live in that case. -const PROCESSING_WORKSPACE_WITH_END_TIMES = { - ...PROCESSING_WORKSPACE, - finishedAt: addMinutes(Date.parse(PROCESSING_WORKSPACE.startedAt!), 15).toISOString(), - steps: [ - PROCESSING_WORKSPACE.steps[0], - { - ...PROCESSING_WORKSPACE.steps[1], - startedAt: null, - }, - PROCESSING_WORKSPACE.steps[2], - ], -} - export const ExecuteWithAWorkspaceSelected: StoryFn = () => ( (
{story()}
{story()}
{story()} ( const config: Meta = { title: 'web/batches/create/CreateBatchChangePage', decorators: [decorator], - parameters: { - chromatic: { - disableSnapshot: false, - }, - }, + parameters: {}, } export default config diff --git a/client/web/src/enterprise/batches/detail/BatchChangeDetailsPage.story.tsx b/client/web/src/enterprise/batches/detail/BatchChangeDetailsPage.story.tsx index f541c23b74e..1040d0c92a9 100644 --- a/client/web/src/enterprise/batches/detail/BatchChangeDetailsPage.story.tsx +++ b/client/web/src/enterprise/batches/detail/BatchChangeDetailsPage.story.tsx @@ -37,10 +37,6 @@ const config: Meta = { title: 'web/batches/details/BatchChangeDetailsPage', decorators: [decorator], parameters: { - chromatic: { - viewports: [320, 576, 978, 1440], - disableSnapshot: false, - }, controls: { exclude: ['url', 'supersededBatchSpec'], }, diff --git a/client/web/src/enterprise/batches/list/BatchChangeListPage.story.tsx b/client/web/src/enterprise/batches/list/BatchChangeListPage.story.tsx index f556897ebb0..4f75bc01b65 100644 --- a/client/web/src/enterprise/batches/list/BatchChangeListPage.story.tsx +++ b/client/web/src/enterprise/batches/list/BatchChangeListPage.story.tsx @@ -30,12 +30,7 @@ const config: Meta = { title: 'web/batches/list/BatchChangeListPage', decorators: [decorator], - parameters: { - chromatic: { - viewports: [320, 576, 978, 1440], - disableSnapshot: false, - }, - }, + parameters: {}, } export default config diff --git a/client/web/src/enterprise/batches/list/BatchChangeNode.story.tsx b/client/web/src/enterprise/batches/list/BatchChangeNode.story.tsx index e961d2ebdcf..f9e1a21b868 100644 --- a/client/web/src/enterprise/batches/list/BatchChangeNode.story.tsx +++ b/client/web/src/enterprise/batches/list/BatchChangeNode.story.tsx @@ -1,13 +1,10 @@ -import type { Meta, Decorator, StoryFn, StoryObj } from '@storybook/react' +import type { Decorator, Meta, StoryFn, StoryObj } from '@storybook/react' import classNames from 'classnames' -import { subDays } from 'date-fns' - -import { isChromatic } from '@sourcegraph/wildcard/src/stories' import { WebStory } from '../../../components/WebStory' import { BatchChangeNode } from './BatchChangeNode' -import { nodes, now } from './testData' +import { nodes } from './testData' import styles from './BatchChangeListPage.module.scss' @@ -43,7 +40,6 @@ const Template: StoryFn /* <{ node: ListBatchChange }>*/ = ({ node, ...args }) = {...props} node={node} displayNamespace={args.displayNamespace} - now={isChromatic() ? () => subDays(now, 5) : undefined} isExecutionEnabled={false} /> )} diff --git a/client/web/src/enterprise/batches/list/BatchChangesChangelogAlert.tsx b/client/web/src/enterprise/batches/list/BatchChangesChangelogAlert.tsx index 0a6bc2a1df4..4edd038f1e7 100644 --- a/client/web/src/enterprise/batches/list/BatchChangesChangelogAlert.tsx +++ b/client/web/src/enterprise/batches/list/BatchChangesChangelogAlert.tsx @@ -2,7 +2,7 @@ import React from 'react' import classNames from 'classnames' -import { CardBody, Card, H3, H4, Link, Code, ProductStatusBadge } from '@sourcegraph/wildcard' +import { Card, CardBody, Code, H3, H4, Link, ProductStatusBadge } from '@sourcegraph/wildcard' import { DismissibleAlert } from '../../../components/DismissibleAlert' @@ -16,8 +16,7 @@ import styles from './BatchChangesListIntro.module.scss' const CURRENT_VERSION = '5.4' /** * SHOW_CHANGELOG has to be set to true when a changelog entry is added for a release. - * After every release, this will be set back to `false`. Chromatic will also verify - * changes to this variable via visual regression testing. + * After every release, this will be set back to `false`. */ const SHOW_CHANGELOG = false diff --git a/client/web/src/enterprise/batches/list/GettingStarted.story.tsx b/client/web/src/enterprise/batches/list/GettingStarted.story.tsx index 974ebe91235..f7c7775c6ca 100644 --- a/client/web/src/enterprise/batches/list/GettingStarted.story.tsx +++ b/client/web/src/enterprise/batches/list/GettingStarted.story.tsx @@ -11,11 +11,7 @@ const decorator: Decorator = story =>
{story()}
{story()} { ) } -DefaultStory.parameters = { - chromatic: { - viewports: [320, 576, 978, 1440], - }, -} - DefaultStory.storyName = 'default' diff --git a/client/web/src/enterprise/batches/repo/BatchChangeRepoPage.story.tsx b/client/web/src/enterprise/batches/repo/BatchChangeRepoPage.story.tsx index e6b70eb411e..5b3961c310a 100644 --- a/client/web/src/enterprise/batches/repo/BatchChangeRepoPage.story.tsx +++ b/client/web/src/enterprise/batches/repo/BatchChangeRepoPage.story.tsx @@ -96,12 +96,7 @@ const decorator: Decorator = story =>
{story()}
{story()} ( )} ) - -View.parameters = { - chromatic: { - // Delay screenshot taking, so the modal has opened by the time the screenshot is taken. - delay: 2000, - }, -} diff --git a/client/web/src/enterprise/code-monitoring/CodeMonitoringLogs.story.tsx b/client/web/src/enterprise/code-monitoring/CodeMonitoringLogs.story.tsx index 2438094b07a..1fdfab699f1 100644 --- a/client/web/src/enterprise/code-monitoring/CodeMonitoringLogs.story.tsx +++ b/client/web/src/enterprise/code-monitoring/CodeMonitoringLogs.story.tsx @@ -15,11 +15,7 @@ const decorator: Decorator = story =>
{story()} is ready to show content. - delay: 600, - disableSnapshot: false, - }, - }, + parameters: {}, } export default config diff --git a/client/web/src/enterprise/code-monitoring/CreateCodeMonitorPage.story.tsx b/client/web/src/enterprise/code-monitoring/CreateCodeMonitorPage.story.tsx index 06b1b2cb0f5..495f0b6b22e 100644 --- a/client/web/src/enterprise/code-monitoring/CreateCodeMonitorPage.story.tsx +++ b/client/web/src/enterprise/code-monitoring/CreateCodeMonitorPage.story.tsx @@ -10,9 +10,7 @@ import { CreateCodeMonitorPage } from './CreateCodeMonitorPage' const config: Meta = { title: 'web/enterprise/code-monitoring/CreateCodeMonitorPage', - parameters: { - chromatic: { disableSnapshot: false }, - }, + parameters: {}, } export default config diff --git a/client/web/src/enterprise/code-monitoring/ManageCodeMonitorPage.story.tsx b/client/web/src/enterprise/code-monitoring/ManageCodeMonitorPage.story.tsx index a694118a84d..6ee1cdd2eca 100644 --- a/client/web/src/enterprise/code-monitoring/ManageCodeMonitorPage.story.tsx +++ b/client/web/src/enterprise/code-monitoring/ManageCodeMonitorPage.story.tsx @@ -44,5 +44,4 @@ ManageCodeMonitorPageStory.parameters = { type: 'figma', url: 'https://www.figma.com/file/Krh7HoQi0GFxtO2k399ZQ6/RFC-227-%E2%80%93-Code-monitoring-actions-and-notifications?node-id=246%3A11', }, - chromatic: { disableSnapshot: false }, } diff --git a/client/web/src/enterprise/code-monitoring/components/DeleteMonitorModal.story.tsx b/client/web/src/enterprise/code-monitoring/components/DeleteMonitorModal.story.tsx index c550cb083c9..99ccb003d4e 100644 --- a/client/web/src/enterprise/code-monitoring/components/DeleteMonitorModal.story.tsx +++ b/client/web/src/enterprise/code-monitoring/components/DeleteMonitorModal.story.tsx @@ -10,9 +10,7 @@ import { DeleteMonitorModal } from './DeleteMonitorModal' const config: Meta = { title: 'web/enterprise/code-monitoring/DeleteMonitorModal', - parameters: { - chromatic: { disableSnapshot: false }, - }, + parameters: {}, } export default config diff --git a/client/web/src/enterprise/code-monitoring/components/FormTriggerArea.story.tsx b/client/web/src/enterprise/code-monitoring/components/FormTriggerArea.story.tsx index b6488680556..c0547f905ca 100644 --- a/client/web/src/enterprise/code-monitoring/components/FormTriggerArea.story.tsx +++ b/client/web/src/enterprise/code-monitoring/components/FormTriggerArea.story.tsx @@ -16,11 +16,6 @@ const config: Meta = { type: 'Figma', url: 'https://www.figma.com/file/Krh7HoQi0GFxtO2k399ZQ6/RFC-227-%E2%80%93-Code-monitoring-actions-and-notifications?node-id=3891%3A41568', }, - chromatic: { - delay: 600, // Delay screenshot for input validation debouncing - viewports: [720], - disableSnapshot: false, - }, }, } diff --git a/client/web/src/enterprise/code-monitoring/components/actions/EmailAction.story.tsx b/client/web/src/enterprise/code-monitoring/components/actions/EmailAction.story.tsx index b1cb5694567..a27eaaa5c6e 100644 --- a/client/web/src/enterprise/code-monitoring/components/actions/EmailAction.story.tsx +++ b/client/web/src/enterprise/code-monitoring/components/actions/EmailAction.story.tsx @@ -11,9 +11,7 @@ import { EmailAction } from './EmailAction' const config: Meta = { title: 'web/enterprise/code-monitoring/actions/EmailAction', - parameters: { - chromatic: { disableSnapshot: false }, - }, + parameters: {}, } export default config diff --git a/client/web/src/enterprise/code-monitoring/components/actions/SlackWebhookAction.story.tsx b/client/web/src/enterprise/code-monitoring/components/actions/SlackWebhookAction.story.tsx index bd6ff7dc5a9..682a754b273 100644 --- a/client/web/src/enterprise/code-monitoring/components/actions/SlackWebhookAction.story.tsx +++ b/client/web/src/enterprise/code-monitoring/components/actions/SlackWebhookAction.story.tsx @@ -11,9 +11,7 @@ import { SlackWebhookAction } from './SlackWebhookAction' const config: Meta = { title: 'web/enterprise/code-monitoring/actions/SlackWebhookAction', - parameters: { - chromatic: { disableSnapshot: false }, - }, + parameters: {}, } export default config diff --git a/client/web/src/enterprise/code-monitoring/components/actions/WebhookAction.story.tsx b/client/web/src/enterprise/code-monitoring/components/actions/WebhookAction.story.tsx index c7e448d5597..c44459b60a5 100644 --- a/client/web/src/enterprise/code-monitoring/components/actions/WebhookAction.story.tsx +++ b/client/web/src/enterprise/code-monitoring/components/actions/WebhookAction.story.tsx @@ -11,9 +11,7 @@ import { WebhookAction } from './WebhookAction' const config: Meta = { title: 'web/enterprise/code-monitoring/actions/WebhookAction', - parameters: { - chromatic: { disableSnapshot: false }, - }, + parameters: {}, } export default config diff --git a/client/web/src/enterprise/executors/secrets/AddSecretModal.story.tsx b/client/web/src/enterprise/executors/secrets/AddSecretModal.story.tsx index e01457f1e86..cc5dd5c880e 100644 --- a/client/web/src/enterprise/executors/secrets/AddSecretModal.story.tsx +++ b/client/web/src/enterprise/executors/secrets/AddSecretModal.story.tsx @@ -11,12 +11,7 @@ const decorator: Decorator = story =>
{story()}
{story()}
{story()}
{story()}
{story()} {() => story()}], - parameters: { - chromatic: { - viewports: [576, 1440], - enableDarkMode: true, - }, - }, + parameters: {}, } export default defaultStory diff --git a/client/web/src/enterprise/insights/components/insights-view-grid/components/backend-insight/BackendInsight.story.tsx b/client/web/src/enterprise/insights/components/insights-view-grid/components/backend-insight/BackendInsight.story.tsx index 30bad1f85ef..2dd47dcb378 100644 --- a/client/web/src/enterprise/insights/components/insights-view-grid/components/backend-insight/BackendInsight.story.tsx +++ b/client/web/src/enterprise/insights/components/insights-view-grid/components/backend-insight/BackendInsight.story.tsx @@ -24,11 +24,7 @@ import { BackendInsightView } from './BackendInsight' const defaultStory: Meta = { title: 'web/insights/BackendInsight', decorators: [story => {() => story()}], - parameters: { - chromatic: { - disableSnapshot: false, - }, - }, + parameters: {}, } export default defaultStory diff --git a/client/web/src/enterprise/insights/modals/GaConfirmationModal.tsx b/client/web/src/enterprise/insights/modals/GaConfirmationModal.tsx index 29a5e48407a..80eb0492fde 100644 --- a/client/web/src/enterprise/insights/modals/GaConfirmationModal.tsx +++ b/client/web/src/enterprise/insights/modals/GaConfirmationModal.tsx @@ -1,7 +1,7 @@ import type { FC } from 'react' import { useTemporarySetting } from '@sourcegraph/shared/src/settings/temporary/useTemporarySetting' -import { Button, Modal, Link, H1, Text } from '@sourcegraph/wildcard' +import { Button, H1, Link, Modal, Text } from '@sourcegraph/wildcard' import { useUiFeatures } from '../hooks' @@ -36,8 +36,6 @@ interface GaConfirmationModalContentProps { /** * Renders Code Insights Ga modal content component. - * Exported especially for storybook story component cause chromatic has a problem of rendering modals - * on CI. */ export const GaConfirmationModalContent: FC = props => { const { onAccept } = props diff --git a/client/web/src/enterprise/insights/pages/dashboards/creation/InsightsDashboardCreationPage.story.tsx b/client/web/src/enterprise/insights/pages/dashboards/creation/InsightsDashboardCreationPage.story.tsx index c633162d50e..72b45eace65 100644 --- a/client/web/src/enterprise/insights/pages/dashboards/creation/InsightsDashboardCreationPage.story.tsx +++ b/client/web/src/enterprise/insights/pages/dashboards/creation/InsightsDashboardCreationPage.story.tsx @@ -15,12 +15,7 @@ import { InsightsDashboardCreationPage } from './InsightsDashboardCreationPage' const config: Meta = { title: 'web/insights/InsightsDashboardCreationPage', decorators: [story => {() => story()}], - parameters: { - chromatic: { - viewports: [576, 1440], - disableSnapshot: false, - }, - }, + parameters: {}, } export default config diff --git a/client/web/src/enterprise/insights/pages/dashboards/dashboard-view/components/dashboards-content/components/empty-insight-dashboard/EmptyInsightDashboard.story.tsx b/client/web/src/enterprise/insights/pages/dashboards/dashboard-view/components/dashboards-content/components/empty-insight-dashboard/EmptyInsightDashboard.story.tsx index ce5ab3fc8e9..726eb8709d1 100644 --- a/client/web/src/enterprise/insights/pages/dashboards/dashboard-view/components/dashboards-content/components/empty-insight-dashboard/EmptyInsightDashboard.story.tsx +++ b/client/web/src/enterprise/insights/pages/dashboards/dashboard-view/components/dashboards-content/components/empty-insight-dashboard/EmptyInsightDashboard.story.tsx @@ -10,11 +10,7 @@ const decorator: Decorator = story => {() => story()} const config: Meta = { title: 'web/insights/EmptyInsightDashboard', decorators: [decorator], - parameters: { - chromatic: { - viewports: [576, 1440], - }, - }, + parameters: {}, } export default config diff --git a/client/web/src/enterprise/insights/pages/insights/creation/capture-group/CaptureGroupCreationPage.story.tsx b/client/web/src/enterprise/insights/pages/insights/creation/capture-group/CaptureGroupCreationPage.story.tsx index ac63a85741b..c5f373f3469 100644 --- a/client/web/src/enterprise/insights/pages/insights/creation/capture-group/CaptureGroupCreationPage.story.tsx +++ b/client/web/src/enterprise/insights/pages/insights/creation/capture-group/CaptureGroupCreationPage.story.tsx @@ -12,12 +12,7 @@ import { CaptureGroupCreationPage as CaptureGroupCreationPageComponent } from '. const meta: Meta = { title: 'web/insights/creation-ui/capture-group/CaptureGroupCreationPage', decorators: [story => {() =>
{story()}
}
], - parameters: { - chromatic: { - viewports: [576, 1440], - disableSnapshot: false, - }, - }, + parameters: {}, } export default meta diff --git a/client/web/src/enterprise/insights/pages/insights/creation/compute/ComputeInsightCreationPage.story.tsx b/client/web/src/enterprise/insights/pages/insights/creation/compute/ComputeInsightCreationPage.story.tsx index 4281767128e..3e3991ba3d1 100644 --- a/client/web/src/enterprise/insights/pages/insights/creation/compute/ComputeInsightCreationPage.story.tsx +++ b/client/web/src/enterprise/insights/pages/insights/creation/compute/ComputeInsightCreationPage.story.tsx @@ -13,12 +13,7 @@ import { ComputeInsightCreationPage as ComputeInsightCreationPageComponent } fro const defaultStory: Meta = { title: 'web/insights/creation-ui/compute/ComputeInsightCreationPage', decorators: [story => {() => story()}], - parameters: { - chromatic: { - viewports: [576, 1440], - disableSnapshot: false, - }, - }, + parameters: {}, } export default defaultStory diff --git a/client/web/src/enterprise/insights/pages/insights/creation/intro/IntroCreationPage.story.tsx b/client/web/src/enterprise/insights/pages/insights/creation/intro/IntroCreationPage.story.tsx index fc3dffc7add..930b8f15f0d 100644 --- a/client/web/src/enterprise/insights/pages/insights/creation/intro/IntroCreationPage.story.tsx +++ b/client/web/src/enterprise/insights/pages/insights/creation/intro/IntroCreationPage.story.tsx @@ -12,12 +12,7 @@ import { IntroCreationPage } from './IntroCreationPage' const config: Meta = { title: 'web/insights/creation-ui/IntroPage', decorators: [story => {() => story()}], - parameters: { - chromatic: { - viewports: [576, 978, 1440], - disableSnapshot: false, - }, - }, + parameters: {}, } export default config diff --git a/client/web/src/enterprise/insights/pages/insights/creation/intro/cards/InsightCards.story.tsx b/client/web/src/enterprise/insights/pages/insights/creation/intro/cards/InsightCards.story.tsx index b7b007fe676..039c6fdc49c 100644 --- a/client/web/src/enterprise/insights/pages/insights/creation/intro/cards/InsightCards.story.tsx +++ b/client/web/src/enterprise/insights/pages/insights/creation/intro/cards/InsightCards.story.tsx @@ -9,12 +9,7 @@ import { CaptureGroupInsightCard, LangStatsInsightCard, SearchInsightCard } from const meta: Meta = { title: 'web/insights/InsightCards', decorators: [story => {() => story()}], - parameters: { - chromatic: { - viewports: [576, 1440], - disableSnapshot: false, - }, - }, + parameters: {}, } export default meta diff --git a/client/web/src/enterprise/insights/pages/insights/creation/lang-stats/LangStatsInsightCreationPage.story.tsx b/client/web/src/enterprise/insights/pages/insights/creation/lang-stats/LangStatsInsightCreationPage.story.tsx index 9ba09eebc6f..a0294b11bca 100644 --- a/client/web/src/enterprise/insights/pages/insights/creation/lang-stats/LangStatsInsightCreationPage.story.tsx +++ b/client/web/src/enterprise/insights/pages/insights/creation/lang-stats/LangStatsInsightCreationPage.story.tsx @@ -19,12 +19,7 @@ import { LangStatsInsightCreationPage as LangStatsInsightCreationPageComponent } const defaultStory: Meta = { title: 'web/insights/creation-ui/lang-stats/LangStatsInsightCreationPage', decorators: [story => {() => story()}], - parameters: { - chromatic: { - viewports: [576, 1440], - disableSnapshot: false, - }, - }, + parameters: {}, } export default defaultStory diff --git a/client/web/src/enterprise/insights/pages/insights/creation/search-insight/SearchInsightCreationPage.story.tsx b/client/web/src/enterprise/insights/pages/insights/creation/search-insight/SearchInsightCreationPage.story.tsx index 51fa9d1c27d..cf16e622fd7 100644 --- a/client/web/src/enterprise/insights/pages/insights/creation/search-insight/SearchInsightCreationPage.story.tsx +++ b/client/web/src/enterprise/insights/pages/insights/creation/search-insight/SearchInsightCreationPage.story.tsx @@ -13,12 +13,7 @@ import { SearchInsightCreationPage as SearchInsightCreationPageComponent } from const defaultStory: Meta = { title: 'web/insights/creation-ui/search/SearchInsightCreationPage', decorators: [story => {() => story()}], - parameters: { - chromatic: { - viewports: [576, 1440], - disableSnapshot: false, - }, - }, + parameters: {}, } export default defaultStory diff --git a/client/web/src/enterprise/own/RepositoryOwnEditPage.story.tsx b/client/web/src/enterprise/own/RepositoryOwnEditPage.story.tsx index afffaa24f0e..e75bd77c8dc 100644 --- a/client/web/src/enterprise/own/RepositoryOwnEditPage.story.tsx +++ b/client/web/src/enterprise/own/RepositoryOwnEditPage.story.tsx @@ -21,9 +21,7 @@ import { RepositoryOwnEditPage } from './RepositoryOwnEditPage' const config: Meta = { title: 'web/enterprise/own/RepositoryOwnPage', - parameters: { - chromatic: { disableSnapshot: false }, - }, + parameters: {}, } export default config diff --git a/client/web/src/enterprise/own/admin-ui/OwnAnalyticsPage.story.tsx b/client/web/src/enterprise/own/admin-ui/OwnAnalyticsPage.story.tsx index 9642f7cab03..0a7b33134f0 100644 --- a/client/web/src/enterprise/own/admin-ui/OwnAnalyticsPage.story.tsx +++ b/client/web/src/enterprise/own/admin-ui/OwnAnalyticsPage.story.tsx @@ -17,9 +17,7 @@ import { GET_INSTANCE_OWN_STATS, GET_OWN_JOB_CONFIGURATIONS } from './query' const config: Meta = { title: 'web/enterprise/own/admin-ui/OwnAnalyticsPage', - parameters: { - chromatic: { disableSnapshot: false }, - }, + parameters: {}, } export default config diff --git a/client/web/src/enterprise/search-jobs/SearchJobsPage.story.tsx b/client/web/src/enterprise/search-jobs/SearchJobsPage.story.tsx index 2f79cc07f8f..2f62a6fa16b 100644 --- a/client/web/src/enterprise/search-jobs/SearchJobsPage.story.tsx +++ b/client/web/src/enterprise/search-jobs/SearchJobsPage.story.tsx @@ -24,11 +24,7 @@ type SearchJob = SearchJobsResult['searchJobs']['nodes'][number] const defaultStory: Meta = { title: 'web/search-jobs', decorators: [story => {() => story()}], - parameters: { - chromatic: { - disableSnapshot: false, - }, - }, + parameters: {}, } export default defaultStory diff --git a/client/web/src/enterprise/searchContexts/DeleteSearchContextModal.story.tsx b/client/web/src/enterprise/searchContexts/DeleteSearchContextModal.story.tsx index e23d1efb5e0..df2ccc99b61 100644 --- a/client/web/src/enterprise/searchContexts/DeleteSearchContextModal.story.tsx +++ b/client/web/src/enterprise/searchContexts/DeleteSearchContextModal.story.tsx @@ -19,9 +19,7 @@ const decorator: Decorator = story =>
{story()}
{story()}
{story()} ( const config: Meta = { title: 'web/enterprise/searchContexts/SearchContextsListTab', decorators: [decorator], - parameters: { - chromatic: { viewports: [1200, 767], disableSnapshot: false }, - }, + parameters: {}, } export default config diff --git a/client/web/src/enterprise/site-admin/SiteAdminSidebar.story.tsx b/client/web/src/enterprise/site-admin/SiteAdminSidebar.story.tsx index 5274dd0f683..5a8076cbde2 100644 --- a/client/web/src/enterprise/site-admin/SiteAdminSidebar.story.tsx +++ b/client/web/src/enterprise/site-admin/SiteAdminSidebar.story.tsx @@ -11,11 +11,7 @@ const decorator: Decorator = story =>
{story()}< const config: Meta = { title: 'web/site-admin/AdminSidebar', decorators: [decorator], - parameters: { - chromatic: { - disableSnapshot: false, - }, - }, + parameters: {}, } export default config diff --git a/client/web/src/global/GlobalAlert.story.tsx b/client/web/src/global/GlobalAlert.story.tsx index 6f96f9f3669..f9db8f2ea17 100644 --- a/client/web/src/global/GlobalAlert.story.tsx +++ b/client/web/src/global/GlobalAlert.story.tsx @@ -21,9 +21,6 @@ const config: Meta = { parameters: { component: GlobalAlert, - chromatic: { - disableSnapshot: false, - }, }, } diff --git a/client/web/src/nav/GlobalNavbar.story.tsx b/client/web/src/nav/GlobalNavbar.story.tsx index 474c8495213..ad02a6aa4e2 100644 --- a/client/web/src/nav/GlobalNavbar.story.tsx +++ b/client/web/src/nav/GlobalNavbar.story.tsx @@ -74,15 +74,7 @@ const decorator: Decorator = Story => { const config: Meta = { title: 'web/nav/GlobalNav', decorators: [decorator], - parameters: { - chromatic: { - disableSnapshot: false, - viewports: [ - // 320, // TODO: Mobile size detection is not working in Storybook - 576, 978, - ], - }, - }, + parameters: {}, } export default config diff --git a/client/web/src/nav/StatusMessagesNavItem.tsx b/client/web/src/nav/StatusMessagesNavItem.tsx index c4452ab64a0..8a4beee1128 100644 --- a/client/web/src/nav/StatusMessagesNavItem.tsx +++ b/client/web/src/nav/StatusMessagesNavItem.tsx @@ -376,7 +376,7 @@ export const StatusMessagesNavItem: React.FunctionComponent setIsOpen(event.isOpen)}> all messages 1`] = `