From 668704983a3f6c810219943ea97e0b0f418bb93d Mon Sep 17 00:00:00 2001 From: Ryan Albrecht Date: Sun, 14 Jun 2026 12:05:32 -0700 Subject: [PATCH] docs(seer): Add simple stories for the two AutofixRepositories components, aka "Connected Repos" lists --- .../legacy/autofixRepositories.stories.tsx | 32 ++++++++++ .../autofixRepositoriesList.stories.tsx | 60 +++++++++++++++++++ 2 files changed, 92 insertions(+) create mode 100644 static/app/components/seer/legacy/autofixRepositories.stories.tsx create mode 100644 static/app/components/seer/projectDetails/autofixRepositoriesList.stories.tsx diff --git a/static/app/components/seer/legacy/autofixRepositories.stories.tsx b/static/app/components/seer/legacy/autofixRepositories.stories.tsx new file mode 100644 index 00000000000000..4bb711293cc2a8 --- /dev/null +++ b/static/app/components/seer/legacy/autofixRepositories.stories.tsx @@ -0,0 +1,32 @@ +import {parseAsString, useQueryState} from 'nuqs'; + +import {Flex} from '@sentry/scraps/layout'; +import {Text} from '@sentry/scraps/text'; + +import {AutofixRepositories} from 'sentry/components/seer/legacy/autofixRepositories'; +import * as Storybook from 'sentry/stories'; +import {useProjects} from 'sentry/utils/useProjects'; + +export default Storybook.story('AutofixRepositories (Legacy)', story => { + story('Default', () => { + const [projectSlug, setProjectSlug] = useQueryState('project', parseAsString); + const {projects} = useProjects(); + const project = projects.find(p => p.slug === projectSlug); + + return ( + + + {project ? ( + + ) : ( + + Select a project to view the story + + )} + + ); + }); +}); diff --git a/static/app/components/seer/projectDetails/autofixRepositoriesList.stories.tsx b/static/app/components/seer/projectDetails/autofixRepositoriesList.stories.tsx new file mode 100644 index 00000000000000..b91ec598d815c5 --- /dev/null +++ b/static/app/components/seer/projectDetails/autofixRepositoriesList.stories.tsx @@ -0,0 +1,60 @@ +import {parseAsString, useQueryState} from 'nuqs'; + +import {Flex} from '@sentry/scraps/layout'; +import {Text} from '@sentry/scraps/text'; + +import {useProjectSeerPreferences} from 'sentry/components/events/autofix/preferences/hooks/useProjectSeerPreferences'; +import type {ProjectSeerPreferences} from 'sentry/components/events/autofix/types'; +import {LoadingIndicator} from 'sentry/components/loadingIndicator'; +import {AutofixRepositories} from 'sentry/components/seer/projectDetails/autofixRepositoriesList'; +import * as Storybook from 'sentry/stories'; +import type {Project} from 'sentry/types/project'; +import {useProjects} from 'sentry/utils/useProjects'; + +const DEFAULT_PREFERENCE: ProjectSeerPreferences = { + repositories: [], + automated_run_stopping_point: 'root_cause', + automation_handoff: undefined, +}; + +export default Storybook.story('AutofixRepositoriesList', story => { + story('Default', () => { + const [projectSlug, setProjectSlug] = useQueryState('project', parseAsString); + const {projects} = useProjects(); + const project = projects.find(p => p.slug === projectSlug); + + return ( + + + {project ? ( + + ) : ( + + Select a project to view the story + + )} + + ); + }); +}); + +function Example({project}: {project: Project}) { + const {data, isPending} = useProjectSeerPreferences(project); + const {preference, code_mapping_repos: codeMappingRepos} = data ?? {}; + + if (isPending) { + return ; + } + + return ( + + ); +}