From ae2ca229865c574112bd2f2d8656a2025382a438 Mon Sep 17 00:00:00 2001 From: Ogi <86684834+obostjancic@users.noreply.github.com> Date: Thu, 9 Oct 2025 11:37:38 +0200 Subject: [PATCH 1/3] fix(demo-mode): releases tour --- static/app/utils/demoMode/demoTours.spec.tsx | 42 +++-- static/app/utils/demoMode/demoTours.tsx | 22 +-- .../views/releases/detail/overview/index.tsx | 143 ++++++++++-------- .../detail/overview/releaseIssues.tsx | 3 +- static/app/views/releases/list/index.tsx | 44 +++--- .../views/releases/list/releaseCard/index.tsx | 16 +- 6 files changed, 138 insertions(+), 132 deletions(-) diff --git a/static/app/utils/demoMode/demoTours.spec.tsx b/static/app/utils/demoMode/demoTours.spec.tsx index ff0d2549b62183..fbdba7042be06b 100644 --- a/static/app/utils/demoMode/demoTours.spec.tsx +++ b/static/app/utils/demoMode/demoTours.spec.tsx @@ -55,7 +55,7 @@ describe('DemoTours', () => { [DemoTour.RELEASES]: { currentStepId: null, isCompleted: false, - orderedStepIds: [DemoTourStep.RELEASES_COMPARE, DemoTourStep.RELEASES_DETAILS], + orderedStepIds: [DemoTourStep.RELEASES_LIST, DemoTourStep.RELEASES_CHART], isRegistered: true, tourKey: DemoTour.RELEASES, }, @@ -122,8 +122,8 @@ describe('DemoTours', () => { expect(tour?.currentStepId).toBeNull(); expect(tour?.isCompleted).toBe(false); expect(tour?.orderedStepIds).toEqual([ - DemoTourStep.RELEASES_COMPARE, - DemoTourStep.RELEASES_DETAILS, + DemoTourStep.RELEASES_LIST, + DemoTourStep.RELEASES_CHART, ]); }); @@ -135,19 +135,17 @@ describe('DemoTours', () => { const tour = result.current; act(() => { - tour?.startTour(DemoTourStep.RELEASES_COMPARE); + tour?.startTour(DemoTourStep.RELEASES_LIST); }); - expect(mockState[DemoTour.RELEASES].currentStepId).toBe( - DemoTourStep.RELEASES_COMPARE - ); + expect(mockState[DemoTour.RELEASES].currentStepId).toBe(DemoTourStep.RELEASES_LIST); act(() => { - tour?.setStep(DemoTourStep.RELEASES_DETAILS); + tour?.setStep(DemoTourStep.RELEASES_CHART); }); expect(mockState[DemoTour.RELEASES].currentStepId).toBe( - DemoTourStep.RELEASES_DETAILS + DemoTourStep.RELEASES_CHART ); act(() => { @@ -180,29 +178,25 @@ describe('DemoTours', () => { const issuesTour = issuesResult.current; act(() => { - sidebarTour?.startTour(DemoTourStep.RELEASES_COMPARE); + sidebarTour?.startTour(DemoTourStep.RELEASES_LIST); }); - expect(mockState[DemoTour.RELEASES].currentStepId).toBe( - DemoTourStep.RELEASES_COMPARE - ); + expect(mockState[DemoTour.RELEASES].currentStepId).toBe(DemoTourStep.RELEASES_LIST); expect(mockState[DemoTour.ISSUES].currentStepId).toBeNull(); act(() => { issuesTour?.startTour(DemoTourStep.ISSUES_STREAM); }); - expect(mockState[DemoTour.RELEASES].currentStepId).toBe( - DemoTourStep.RELEASES_COMPARE - ); + expect(mockState[DemoTour.RELEASES].currentStepId).toBe(DemoTourStep.RELEASES_LIST); expect(mockState[DemoTour.ISSUES].currentStepId).toBe(DemoTourStep.ISSUES_STREAM); act(() => { - sidebarTour?.setStep(DemoTourStep.RELEASES_DETAILS); + sidebarTour?.setStep(DemoTourStep.RELEASES_CHART); }); expect(mockState[DemoTour.RELEASES].currentStepId).toBe( - DemoTourStep.RELEASES_DETAILS + DemoTourStep.RELEASES_CHART ); expect(mockState[DemoTour.ISSUES].currentStepId).toBe(DemoTourStep.ISSUES_STREAM); @@ -226,17 +220,15 @@ describe('DemoTours', () => { const sidebarTour = result.current; act(() => { - sidebarTour?.startTour(DemoTourStep.RELEASES_COMPARE); + sidebarTour?.startTour(DemoTourStep.RELEASES_LIST); }); - expect(mockState[DemoTour.RELEASES].currentStepId).toBe( - DemoTourStep.RELEASES_COMPARE - ); + expect(mockState[DemoTour.RELEASES].currentStepId).toBe(DemoTourStep.RELEASES_LIST); act(() => { - sidebarTour?.setStep(DemoTourStep.RELEASES_DETAILS); + sidebarTour?.setStep(DemoTourStep.RELEASES_CHART); }); expect(mockState[DemoTour.RELEASES].currentStepId).toBe( - DemoTourStep.RELEASES_DETAILS + DemoTourStep.RELEASES_CHART ); act(() => { @@ -252,7 +244,7 @@ describe('DemoTours', () => { render( diff --git a/static/app/utils/demoMode/demoTours.tsx b/static/app/utils/demoMode/demoTours.tsx index 9c95aa9331a591..574b3f4b49ef08 100644 --- a/static/app/utils/demoMode/demoTours.tsx +++ b/static/app/utils/demoMode/demoTours.tsx @@ -30,9 +30,10 @@ export const enum DemoTourStep { ISSUES_EVENT_DETAILS = 'demo-tour-issues-event-details', ISSUES_DETAIL_SIDEBAR = 'demo-tour-issues-detail-sidebar', // Releases steps - RELEASES_COMPARE = 'demo-tour-releases-compare', - RELEASES_DETAILS = 'demo-tour-releases-details', - RELEASES_STATES = 'demo-tour-releases-states', + RELEASES_LIST = 'demo-tour-releases-list', + RELEASES_CHART = 'demo-tour-releases-chart', + RELEASES_ISSUES = 'demo-tour-releases-issues', + RELEASES_STATS = 'demo-tour-releases-stats', // Performance steps PERFORMANCE_TABLE = 'demo-tour-performance-table', PERFORMANCE_USER_MISERY = 'demo-tour-performance-user-misery', @@ -72,9 +73,10 @@ const TOUR_STEPS: Record = { DemoTourStep.ISSUES_DETAIL_SIDEBAR, ], [DemoTour.RELEASES]: [ - DemoTourStep.RELEASES_COMPARE, - DemoTourStep.RELEASES_DETAILS, - DemoTourStep.RELEASES_STATES, + DemoTourStep.RELEASES_LIST, + DemoTourStep.RELEASES_CHART, + DemoTourStep.RELEASES_ISSUES, + DemoTourStep.RELEASES_STATS, ], [DemoTour.PERFORMANCE]: [ DemoTourStep.PERFORMANCE_TABLE, @@ -175,13 +177,13 @@ export function DemoToursProvider({children}: {children: React.ReactNode}) { return {children}; } -const getTourFromStep = (step: DemoTourStep): DemoTour => { +const getTourFromStep = (step: DemoTourStep): DemoTour | null => { for (const [category, steps] of Object.entries(TOUR_STEPS)) { if (steps.includes(step)) { return category as DemoTour; } } - throw new Error(`Unknown tour step: ${step}`); + return null; }; type DemoTourElementProps = Omit< @@ -199,9 +201,9 @@ export function DemoTourElement({ ...props }: DemoTourElementProps) { const tourKey = getTourFromStep(id); - const tourContextValue = useDemoTour(tourKey); + const tourContextValue = useDemoTour(tourKey as DemoTour); - if (!isDemoModeActive() || !tourContextValue || disabled) { + if (!isDemoModeActive() || !tourKey || !tourContextValue || disabled) { return children; } diff --git a/static/app/views/releases/detail/overview/index.tsx b/static/app/views/releases/detail/overview/index.tsx index f35d077abecfc9..aa4ad0e0fd3425 100644 --- a/static/app/views/releases/detail/overview/index.tsx +++ b/static/app/views/releases/detail/overview/index.tsx @@ -24,6 +24,7 @@ import type {NewQuery, Organization} from 'sentry/types/organization'; import {SessionFieldWithOperation} from 'sentry/types/organization'; import {browserHistory} from 'sentry/utils/browserHistory'; import {getUtcDateString} from 'sentry/utils/dates'; +import {DemoTourElement, DemoTourStep} from 'sentry/utils/demoMode/demoTours'; import type {TableDataRow} from 'sentry/utils/discover/discoverQuery'; import EventView from 'sentry/utils/discover/eventView'; import {decodeScalar} from 'sentry/utils/queryString'; @@ -354,20 +355,29 @@ function ReleaseOverview() { /> {(hasDiscover || hasPerformance || hasHealthData) && ( - + + + )} - - - {hasHealthData && ( - + + - )} - - {commitCount > 0 && ( - - )} - {releaseMeta.projects.length > 1 && ( - p.slug !== project.slug)} - location={location} - version={version} - organization={organization} - /> - )} - {hasHealthData && ( - - )} - {deploys.length > 0 && ( - + )} + - )} - + {commitCount > 0 && ( + + )} + {releaseMeta.projects.length > 1 && ( + p.slug !== project.slug)} + location={location} + version={version} + organization={organization} + /> + )} + {hasHealthData && ( + + )} + {deploys.length > 0 && ( + + )} + + ); diff --git a/static/app/views/releases/detail/overview/releaseIssues.tsx b/static/app/views/releases/detail/overview/releaseIssues.tsx index bd9d3f28c42d29..01ebf66f44754e 100644 --- a/static/app/views/releases/detail/overview/releaseIssues.tsx +++ b/static/app/views/releases/detail/overview/releaseIssues.tsx @@ -370,11 +370,12 @@ class ReleaseIssues extends Component { - - - + ) : ( - + + + )} diff --git a/static/app/views/releases/list/releaseCard/index.tsx b/static/app/views/releases/list/releaseCard/index.tsx index 45b0d54562cb31..c73e21556c09c7 100644 --- a/static/app/views/releases/list/releaseCard/index.tsx +++ b/static/app/views/releases/list/releaseCard/index.tsx @@ -129,19 +129,9 @@ function ReleaseCard({ query: {project: getReleaseProjectId(release, selection)}, }} > - 1} - title={t('Release-specific trends')} - description={t( - 'Select the latest release to review new and regressed issues, and business critical metrics like crash rate, and user adoption.' - )} - position="bottom-start" - > - - - - + + + {commitCount > 0 && ( From 84505a586ab514f7e052495f2abaeea7a2a6cb8e Mon Sep 17 00:00:00 2001 From: Ogi <86684834+obostjancic@users.noreply.github.com> Date: Thu, 9 Oct 2025 11:46:04 +0200 Subject: [PATCH 2/3] remove import --- static/app/views/releases/list/releaseCard/index.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/static/app/views/releases/list/releaseCard/index.tsx b/static/app/views/releases/list/releaseCard/index.tsx index c73e21556c09c7..e12374a9332526 100644 --- a/static/app/views/releases/list/releaseCard/index.tsx +++ b/static/app/views/releases/list/releaseCard/index.tsx @@ -22,7 +22,6 @@ import {space} from 'sentry/styles/space'; import type {PageFilters} from 'sentry/types/core'; import type {Organization} from 'sentry/types/organization'; import type {Release} from 'sentry/types/release'; -import {DemoTourElement, DemoTourStep} from 'sentry/utils/demoMode/demoTours'; import {useUser} from 'sentry/utils/useUser'; import useFinalizeRelease from 'sentry/views/releases/components/useFinalizeRelease'; import type {ReleasesDisplayOption} from 'sentry/views/releases/list/releasesDisplayOptions'; From 330c1dfbb47e12d0f015ba65c6d3e9031d822561 Mon Sep 17 00:00:00 2001 From: Ogi <86684834+obostjancic@users.noreply.github.com> Date: Thu, 9 Oct 2025 11:48:26 +0200 Subject: [PATCH 3/3] fix type --- static/app/utils/demoMode/demoTours.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/static/app/utils/demoMode/demoTours.tsx b/static/app/utils/demoMode/demoTours.tsx index 574b3f4b49ef08..876b8890bb4208 100644 --- a/static/app/utils/demoMode/demoTours.tsx +++ b/static/app/utils/demoMode/demoTours.tsx @@ -55,10 +55,12 @@ export function useDemoTours(): DemoToursContextType | null { return tourContext; } -export function useDemoTour(tourKey: DemoTour): TourContextType | null { +export function useDemoTour( + tourKey: DemoTour | null +): TourContextType | null { const tourContext = useDemoTours(); - if (!tourContext) { + if (!tourContext || !tourKey) { return null; } @@ -201,9 +203,9 @@ export function DemoTourElement({ ...props }: DemoTourElementProps) { const tourKey = getTourFromStep(id); - const tourContextValue = useDemoTour(tourKey as DemoTour); + const tourContextValue = useDemoTour(tourKey); - if (!isDemoModeActive() || !tourKey || !tourContextValue || disabled) { + if (!isDemoModeActive() || !tourContextValue || disabled) { return children; }