Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(eng-analytics): show skeletons on window reload (#103935)

Raúl Negrón-Oterode6c55a3fc81
diff --git a/frontend/snapshots.yml b/frontend/snapshots.yml
index ab5fbf88621b..beb3e84e8a9e 100644
--- a/frontend/snapshots.yml
+++ b/frontend/snapshots.yml
@@ -7917,21 +7917,25 @@ snapshots:
scenes-app-engineering-analytics-delivery-pipeline--without-deploys--light:
hash: v1.k794b7964.5eaee687a224ef9cd7d3707391948732cacb11769bdd619f315a101abcb85de1.ymQC-4XF77SeJ0AN5SrtlyYKs8Ve29MBfz4J8FGLWtg
scenes-app-engineering-analytics-health--health--dark:
- hash: v1.k794b7964.b44984309f95ae7f109b15a9fae848c4b4946590788e71a8e4387710dfb936d6.OoB3EM50krQphJ342Rw0f3OstTYHV2NjyjS7JCFrzuk
+ hash: v1.k794b7964.80df7e2e37430d0fe93982dcfa4c9b185910ecf4fc3f75674ac70b82bb450de8.Vq6Dgdy6guncYwFVFE3iorIwjJEs5hii1Tmf9yEwOhs
scenes-app-engineering-analytics-health--health--light:
- hash: v1.k794b7964.35c7ca733e40d8700368971cab0385c5c0e9299b7e2bdcdc959c4021d1e5dd9a.JY2t4yraYrMoI7dKNjGbOrOZoTLFYIrNqoyj9HTnxWs
+ hash: v1.k794b7964.be303ddc64c078325a87d57896ecee9b8b467e90e1f335d6a850ba5f4d903d6e.6-21IJhdAuY5h6iWzKTEARMFgwjRSjIebhXIpiCg2_k
+ scenes-app-engineering-analytics-health--health-narrow--dark:
+ hash: v1.k794b7964.a7a942a915d4e87308d54e8f8008ba9b7f5aee84be5a9d8d0b2b5031752d6761.lL961wqs_VyMW1cSyfTQAITrAog-VtlhVZPGYkmZq9I
+ scenes-app-engineering-analytics-health--health-narrow--light:
+ hash: v1.k794b7964.139aa696e702191baf401e842b50594954fcc56e4db65462c94968f5529adb17.DUxJjaQI5Tivd6Fzw1yid4iw_NUumF7Q_6NRbidJfcY
scenes-app-engineering-analytics-health--health-with-limited-deployment-coverage--dark:
- hash: v1.k794b7964.91d4d18da5f4bf6784bed887fd0a7e2ff10c278fd1c6ae2330911541aaeb9f1e.t7zP7abNW6GN2rtotpz5VGWkzKBbmaSqSqwLuoKbJ1I
+ hash: v1.k794b7964.ed19891c342e5f6081ceca2d1a4c7b5f004af7cc647565f680a56a0484c94310.MLb9W9NyoF5ohAscgY28E42Fu_pAeP7eJemYQTY80RY
scenes-app-engineering-analytics-health--health-with-limited-deployment-coverage--light:
- hash: v1.k794b7964.cea50b9a0c73e0868c0b4b59dbc0e0c8301fb8c08fb33bab1d2bfdfaa6c58143.4KlzrYv4MgqmhfXlrKavy5FXTDxsFa1A_T275D4jDIU
+ hash: v1.k794b7964.65b2ddfa6835b15f89994785798c3a3bd1402c7f9afb7eba98ed3d2c79f7ff04.LHR6eYOurd3bEQSJwfNOkoOfgm5KPNNu-oGZQlJPKIA
scenes-app-engineering-analytics-health--health-without-attributed-pull-requests--dark:
- hash: v1.k794b7964.712465012bc894bfbf77066f2b3287bbb28c684d8992bfb6e6824e04a4ff3d0f.AIi4PIwjarrVtkm9Rn9pSyAWRL7IITCCaAywR7a3p9A
+ hash: v1.k794b7964.21bfbd0040c9326720c50d2619d4fcae2cd366999aa1213c07042a66ecf32b68.Hg36NNstflQIefwLm1_mGVhQAme2ZOZOT6RnxASj6is
scenes-app-engineering-analytics-health--health-without-attributed-pull-requests--light:
- hash: v1.k794b7964.916a98ec25fe104a20e7364b41baad00b75c67456d07a457c96cf31cbefcd330.vm_ef_S4gyq4TggAyQQOsNQ2BUqZyNK1nYiDkdWF8UU
+ hash: v1.k794b7964.2f9fa7d06310b7a1552ef8a12a54e3f32b5f1a40d4bcf2e13cb808b3304ced07.PAL09veE49hCar6Ps8Qa26qWy60hXi3AvTvaLxw2esQ
scenes-app-engineering-analytics-health--health-without-deploy-data--dark:
- hash: v1.k794b7964.19d11f17e9a84ed24f41001e49e34211992af3fd06e22d3d8e4956ea54451692.bHLFcWqNX7duZvoYdWlAWdK6Hbf3hNcKuEofZN8Jeg4
+ hash: v1.k794b7964.6019225e8e81a65e07e21417be065c6ef1b36245720fb46c09292bd998eeda31.uqLvtsA8KMnTtyJSZtIx_nGTbGJ31TSqgZnr4oqQUl0
scenes-app-engineering-analytics-health--health-without-deploy-data--light:
- hash: v1.k794b7964.f61c143e7770fda3b369c4e5cb914147af2686af80214ae600d721540600da5d.1wwIy897x1GM2iIWDtAKgsh_c5DIB99fgGGjCxMmri0
+ hash: v1.k794b7964.f9d116280d2fc69f3ba391975df7f91f9a1dd0098b31a9c23cd0f0a6d7e5f71a.8jj1Mq450IL9dXTX5SalsjNY40agsfS1sELpJTOGNKg
scenes-app-engineering-analytics-lead-time-box-plot--default--dark:
hash: v1.k794b7964.a88a986e975778b0ad232c7e8f75211b0d66acb126082b2f781fd9d5641ff28d.P4_7HWOcC-Z8pGr_2GTGkAc_fzupx_TRaZdlauEmVQE
scenes-app-engineering-analytics-lead-time-box-plot--default--light:
diff --git a/products/engineering_analytics/frontend/components/PullRequestDayView.tsx b/products/engineering_analytics/frontend/components/PullRequestDayView.tsx
index 2c69f61a697e..7a801720f3cd 100644
--- a/products/engineering_analytics/frontend/components/PullRequestDayView.tsx
+++ b/products/engineering_analytics/frontend/components/PullRequestDayView.tsx
@@ -128,7 +128,7 @@ export function PullRequestDayView({
/>
</div>
</div>
- {loading && !timelines ? (
+ {loading ? (
<div className="flex flex-col gap-2">
{Array.from({ length: 6 }).map((_, index) => (
<LemonSkeleton key={index} className="h-3.5 w-full" />
diff --git a/products/engineering_analytics/frontend/components/Section.tsx b/products/engineering_analytics/frontend/components/Section.tsx
index 8f88c45c438d..a1dd0800cd95 100644
--- a/products/engineering_analytics/frontend/components/Section.tsx
+++ b/products/engineering_analytics/frontend/components/Section.tsx
@@ -31,11 +31,11 @@ export function Section({
}): JSX.Element {
return (
<section id={sectionDomId(id)} className="scroll-mt-14" aria-busy={busy}>
- <div className="mb-2 flex items-baseline gap-2.5">
+ <div className="mb-2 flex flex-wrap items-baseline gap-2.5">
<h2 className="m-0 text-base font-semibold">{title}</h2>
{note && <span className="text-xs text-tertiary">{note}</span>}
{busy && <Spinner className="text-sm text-secondary" />}
- {right && <span className="ml-auto text-xs">{right}</span>}
+ {right && <span className="ml-auto max-w-full text-xs">{right}</span>}
</div>
<div className={cn('transition-opacity', busy && 'pointer-events-none opacity-60')}>{children}</div>
</section>
diff --git a/products/engineering_analytics/frontend/scenes/DeliverySections.tsx b/products/engineering_analytics/frontend/scenes/DeliverySections.tsx
index f599fd3833ee..0eb4040e987d 100644
--- a/products/engineering_analytics/frontend/scenes/DeliverySections.tsx
+++ b/products/engineering_analytics/frontend/scenes/DeliverySections.tsx
@@ -39,7 +39,6 @@ export function DeliverySections({
return <CIAnalyticsLoadError onRetry={loadSummary} />
}
- const summaryPending = summaryLoading && !summary
const costEmpty =
summary && !summary.jobs_available
? 'Cost appears once the workflow jobs table on this GitHub source is synced.'
@@ -54,7 +53,7 @@ export function DeliverySections({
<Section id="delivery-spend" title="CI spend">
<div className="@container">
<div className="grid grid-cols-1 gap-2 @min-[36rem]:grid-cols-2 @min-[64rem]:grid-cols-4">
- <PullRequestCountsCard summary={summary} loading={summaryPending} />
+ <PullRequestCountsCard summary={summary} loading={summaryLoading} />
<ScopeComparisonCard
title="CI cost per merged PR"
tooltip="Median estimated CI cost of a merged pull request: every run linked to it, merge queue runs included, from up to 30 days before the window. Repo: the same median over every pull request merged in the repository, bots excluded."
@@ -66,7 +65,7 @@ export function DeliverySections({
? `${compactUsd(summary.total_cost_usd)} in total`
: undefined
}
- loading={summaryPending}
+ loading={summaryLoading}
emptyText={costEmpty}
/>
<ScopeComparisonCard
@@ -80,7 +79,7 @@ export function DeliverySections({
? `${compactMinutes(summary.total_billable_minutes)} billable in total`
: undefined
}
- loading={summaryPending}
+ loading={summaryLoading}
emptyText={costEmpty}
/>
<ScopeComparisonCard
@@ -90,7 +89,7 @@ export function DeliverySections({
figure={summary?.cost_per_push_usd}
formatValue={compactUsd}
caption={summary ? pluralize(summary.push_count, 'push', 'pushes') : undefined}
- loading={summaryPending}
+ loading={summaryLoading}
emptyText={costEmpty}
/>
</div>
@@ -112,7 +111,7 @@ export function DeliverySections({
: []
}
reviewsSynced={!!summary?.review_data_available}
- loading={summaryPending}
+ loading={summaryLoading}
emptyText={
summary && !summary.ready_data_available
? 'Ready time appears once the issue events table on this GitHub source is synced.'
@@ -127,7 +126,7 @@ export function DeliverySections({
scopeLabel={scopeLabel}
figure={summary?.pushes_after_approval_per_merged_pr}
formatValue={formatRatio}
- loading={summaryPending}
+ loading={summaryLoading}
emptyText={reviewsEmpty}
/>
<ScopeComparisonCard
@@ -141,7 +140,7 @@ export function DeliverySections({
? `${percent(summary.failed_merge_queue_share.scope)} had a failed attempt · repo ${percent(summary.failed_merge_queue_share.repo)}`
: undefined
}
- loading={summaryPending}
+ loading={summaryLoading}
emptyText="No merged pull requests went through the merge queue in the window."
/>
</div>
@@ -152,7 +151,7 @@ export function DeliverySections({
<LeadTimeComparisonCard
leadTime={summary?.lead_time}
scopeLabel={scopeLabel}
- loading={summaryPending}
+ loading={summaryLoading}
/>
</Section>
</>
diff --git a/products/engineering_analytics/frontend/scenes/DoraDeploymentFrequency.tsx b/products/engineering_analytics/frontend/scenes/DoraDeploymentFrequency.tsx
index 90a422fa97c5..36e254b731c9 100644
--- a/products/engineering_analytics/frontend/scenes/DoraDeploymentFrequency.tsx
+++ b/products/engineering_analytics/frontend/scenes/DoraDeploymentFrequency.tsx
@@ -20,9 +20,8 @@ export function DoraDeploymentFrequency(): JSX.Element {
id="deployment-frequency"
title="Deployments over time"
note={`Successful deployments per bucket in the ${environmentScopeLabel} scope.`}
- busy={doraLoading && !!dora}
>
- {doraLoading && !dora ? (
+ {doraLoading ? (
<LemonSkeleton className="h-40 w-full" />
) : frequencyCounts.length === 0 ? (
<div className="py-8 text-center text-sm text-secondary">No deploy data for this window.</div>
diff --git a/products/engineering_analytics/frontend/scenes/DoraDeploymentHealth.tsx b/products/engineering_analytics/frontend/scenes/DoraDeploymentHealth.tsx
index 5d997525be29..797a8920ae55 100644
--- a/products/engineering_analytics/frontend/scenes/DoraDeploymentHealth.tsx
+++ b/products/engineering_analytics/frontend/scenes/DoraDeploymentHealth.tsx
@@ -8,7 +8,6 @@ import { doraLogic } from './doraLogic'
export function DoraDeploymentHealth(): JSX.Element {
const { dora, doraLoading } = useValues(doraLogic)
- const firstLoad = doraLoading && !dora
return (
<Section id="dora-metrics" title="Deployment health">
@@ -22,7 +21,7 @@ export function DoraDeploymentHealth(): JSX.Element {
previousValue={dora?.deployments_per_day_prev}
formatValue={(value) => `${value.toFixed(1)}/day`}
emptyText="No successful deployments in this window."
- loading={firstLoad}
+ loading={doraLoading}
/>
<WindowComparisonCard
title="Failed deployment share"
@@ -34,7 +33,7 @@ export function DoraDeploymentHealth(): JSX.Element {
deltaUnit="pt"
goodWhenDown
emptyText="No deployments reached an outcome in this window."
- loading={firstLoad}
+ loading={doraLoading}
/>
<WindowComparisonCard
title="Failed deploy to next success"
@@ -45,7 +44,7 @@ export function DoraDeploymentHealth(): JSX.Element {
formatValue={compactAgeLabel}
goodWhenDown
emptyText="No failed deployment recovered in this window."
- loading={firstLoad}
+ loading={doraLoading}
/>
</div>
</div>
diff --git a/products/engineering_analytics/frontend/scenes/DoraLeadTimeDistributionContent.tsx b/products/engineering_analytics/frontend/scenes/DoraLeadTimeDistributionContent.tsx
index 6da9fe274e11..717b945614e1 100644
--- a/products/engineering_analytics/frontend/scenes/DoraLeadTimeDistributionContent.tsx
+++ b/products/engineering_analytics/frontend/scenes/DoraLeadTimeDistributionContent.tsx
@@ -1,7 +1,7 @@
import { useActions, useValues } from 'kea'
import { IconChevronDown, IconChevronRight } from '@posthog/icons'
-import { LemonButton, LemonSkeleton } from '@posthog/lemon-ui'
+import { LemonButton } from '@posthog/lemon-ui'
import { LeadTimeBoxPlot } from '../components/LeadTimeBoxPlot'
import { compactAgeLabel } from '../lib/format'
@@ -10,7 +10,6 @@ import { doraLogic } from './doraLogic'
export function DoraLeadTimeDistributionContent(): JSX.Element {
const {
dora,
- doraLoading,
githubTeam,
openToDeployBuckets,
openToMergeBuckets,
@@ -47,9 +46,6 @@ export function DoraLeadTimeDistributionContent(): JSX.Element {
]
const membershipDataMissing = !!githubTeam && !!dora && !dora.has_membership_data
- if (doraLoading && !dora) {
- return <LemonSkeleton className="h-40 w-full" />
- }
if (!openToDeployBuckets.some((bucket) => bucket.count > 0)) {
return (
<div
diff --git a/products/engineering_analytics/frontend/scenes/DoraLeadTimeDistributions.tsx b/products/engineering_analytics/frontend/scenes/DoraLeadTimeDistributions.tsx
deleted file mode 100644
index 88977117fdfa..000000000000
--- a/products/engineering_analytics/frontend/scenes/DoraLeadTimeDistributions.tsx
+++ /dev/null
@@ -1,34 +0,0 @@
-import { useActions, useValues } from 'kea'
-
-import { LemonSwitch } from '@posthog/lemon-ui'
-
-import { ScopePanel } from '../components/ScopePanel'
-import { Section } from '../components/Section'
-import { DoraLeadTimeDistributionContent } from './DoraLeadTimeDistributionContent'
-import { doraLogic } from './doraLogic'
-
-export function DoraLeadTimeDistributions(): JSX.Element {
- const { dora, doraLoading, excludeOutliers } = useValues(doraLogic)
- const { setExcludeOutliers } = useActions(doraLogic)
-
- return (
- <div data-attr="engineering-analytics-dora-grouped-charts">
- <ScopePanel
- controls={
- <LemonSwitch
- size="small"
- bordered
- label="Exclude outliers"
- checked={excludeOutliers}
- onChange={setExcludeOutliers}
- data-attr="engineering-analytics-dora-exclude-outliers"
- />
- }
- >
- <Section id="merge-to-deploy" title="Lead time distributions" busy={doraLoading && !!dora}>
- <DoraLeadTimeDistributionContent />
- </Section>
- </ScopePanel>
- </div>
- )
-}
diff --git a/products/engineering_analytics/frontend/scenes/DoraLeadTimeSection.tsx b/products/engineering_analytics/frontend/scenes/DoraLeadTimeSection.tsx
index 88b92052e5f8..783b8f2e9e8e 100644
--- a/products/engineering_analytics/frontend/scenes/DoraLeadTimeSection.tsx
+++ b/products/engineering_analytics/frontend/scenes/DoraLeadTimeSection.tsx
@@ -1,44 +1,60 @@
import { useActions, useValues } from 'kea'
-import { LemonBanner, LemonSelect } from '@posthog/lemon-ui'
+import { LemonBanner, LemonSelect, LemonSkeleton, LemonSwitch } from '@posthog/lemon-ui'
-import { ScopePanel } from '../components/ScopePanel'
+import { Section } from '../components/Section'
import { percent } from '../lib/format'
-import { DoraLeadTimeDistributions } from './DoraLeadTimeDistributions'
+import { DoraLeadTimeDistributionContent } from './DoraLeadTimeDistributionContent'
import { DoraLeadTimeSummary } from './DoraLeadTimeSummary'
import { UNATTRIBUTED_WARNING_SHARE, doraLogic } from './doraLogic'
export function DoraLeadTimeSection(): JSX.Element {
- const { dora, doraLoading, githubTeam, githubTeamOptions, showUnattributedWarning } = useValues(doraLogic)
- const { setGithubTeam } = useActions(doraLogic)
+ const { dora, doraLoading, githubTeam, githubTeamOptions, excludeOutliers, showUnattributedWarning } =
+ useValues(doraLogic)
+ const { setGithubTeam, setExcludeOutliers } = useActions(doraLogic)
return (
- <ScopePanel
- busy={doraLoading && !!dora}
- controls={
- <LemonSelect
- size="small"
- value={githubTeam}
- onChange={setGithubTeam}
- options={githubTeamOptions}
- disabledReason={
- dora?.has_membership_data ? undefined : 'Sync team membership to filter lead time by team'
- }
- data-attr="engineering-analytics-dora-team-select"
- />
+ <Section
+ id="lead-time"
+ title="Lead time"
+ right={
+ <div className="flex flex-wrap items-center justify-end gap-2">
+ <LemonSelect
+ size="small"
+ value={githubTeam}
+ onChange={setGithubTeam}
+ options={githubTeamOptions}
+ disabledReason={
+ dora?.has_membership_data ? undefined : 'Sync team membership to filter lead time by team'
+ }
+ data-attr="engineering-analytics-dora-team-select"
+ />
+ <LemonSwitch
+ size="small"
+ bordered
+ label="Exclude outliers"
+ checked={excludeOutliers}
+ onChange={setExcludeOutliers}
+ data-attr="engineering-analytics-dora-exclude-outliers"
+ />
+ </div>
}
>
- {showUnattributedWarning && (
- <div data-attr="engineering-analytics-dora-unattributed">
- <LemonBanner type="warning">
- More than {percent(UNATTRIBUTED_WARNING_SHARE)} of PRs merged in this window have no successful
- deployment attributed in the selected environments. Lead-time results exclude unmatched PRs.
- Check the source sync or allow more time for deployments.
- </LemonBanner>
+ <div className="flex flex-col gap-4">
+ {!doraLoading && showUnattributedWarning && (
+ <div data-attr="engineering-analytics-dora-unattributed">
+ <LemonBanner type="warning">
+ More than {percent(UNATTRIBUTED_WARNING_SHARE)} of PRs merged in this window have no
+ successful deployment attributed in the selected environments. Lead-time results exclude
+ unmatched PRs. Check the source sync or allow more time for deployments.
+ </LemonBanner>
+ </div>
+ )}
+ <DoraLeadTimeSummary />
+ <div data-attr="engineering-analytics-dora-grouped-charts">
+ {doraLoading ? <LemonSkeleton className="h-40 w-full" /> : <DoraLeadTimeDistributionContent />}
</div>
- )}
- <DoraLeadTimeSummary />
- <DoraLeadTimeDistributions />
- </ScopePanel>
+ </div>
+ </Section>
)
}
diff --git a/products/engineering_analytics/frontend/scenes/DoraLeadTimeSummary.tsx b/products/engineering_analytics/frontend/scenes/DoraLeadTimeSummary.tsx
index 69d3191644ea..1f3c265858ef 100644
--- a/products/engineering_analytics/frontend/scenes/DoraLeadTimeSummary.tsx
+++ b/products/engineering_analytics/frontend/scenes/DoraLeadTimeSummary.tsx
@@ -1,6 +1,5 @@
import { useValues } from 'kea'
-import { Section } from '../components/Section'
import { WindowComparisonCard } from '../components/WindowComparisonCard'
import { leadTimeBenchmark } from '../lib/doraBenchmark'
import { compactAgeLabel } from '../lib/format'
@@ -11,22 +10,20 @@ export function DoraLeadTimeSummary(): JSX.Element {
const membershipDataMissing = !!githubTeam && !!dora && !dora.has_membership_data
return (
- <Section id="lead-time" title="Lead time">
- <WindowComparisonCard
- title="Open to deploy"
- tooltip={`Median from a PR's open to the first successful deployment containing it in any selected environment, over ${dora?.deployed_pr_count ?? 0} deployed PRs (bots and drafts excluded). Each PR counts once. The box plots split it into open to merge and merge to deploy.`}
- value={dora?.median_open_to_deploy_seconds}
- benchmark={leadTimeBenchmark(dora?.median_open_to_deploy_seconds)}
- previousValue={dora?.median_open_to_deploy_seconds_prev}
- formatValue={compactAgeLabel}
- goodWhenDown
- emptyText={
- membershipDataMissing
- ? 'Sync team membership to apply this filter.'
- : 'No PRs could be matched to successful deployments in this window. Try a wider date range or check the source sync.'
- }
- loading={doraLoading && !dora}
- />
- </Section>
+ <WindowComparisonCard
+ title="Open to deploy"
+ tooltip={`Median from a PR's open to the first successful deployment containing it in any selected environment, over ${dora?.deployed_pr_count ?? 0} deployed PRs (bots and drafts excluded). Each PR counts once. The box plots split it into open to merge and merge to deploy.`}
+ value={dora?.median_open_to_deploy_seconds}
+ benchmark={leadTimeBenchmark(dora?.median_open_to_deploy_seconds)}
+ previousValue={dora?.median_open_to_deploy_seconds_prev}
+ formatValue={compactAgeLabel}
+ goodWhenDown
+ emptyText={
+ membershipDataMissing
+ ? 'Sync team membership to apply this filter.'
+ : 'No PRs could be matched to successful deployments in this window. Try a wider date range or check the source sync.'
+ }
+ loading={doraLoading}
+ />
)
}
diff --git a/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsAuthorScene.tsx b/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsAuthorScene.tsx
index 0a5f3c807605..fecdd96ac796 100644
--- a/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsAuthorScene.tsx
+++ b/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsAuthorScene.tsx
@@ -37,7 +37,9 @@ export const scene: SceneExport<AuthorLogicProps> = {
}
export function EngineeringAnalyticsAuthorScene(): JSX.Element {
- const { handle, sourceId, deliveryScope, workflowCosts, workflowCostsLoading } = useValues(authorLogic)
+ const { handle, sourceId, deliveryScope, workflowCosts, workflowCostsLoading, workflowCostsFailed } =
+ useValues(authorLogic)
+ const { loadWorkflowCosts } = useActions(authorLogic)
const { summary, summaryLoading } = useValues(deliverySummaryLogic({ scope: deliveryScope, sourceId }))
const { comparison, comparisonLoading, comparisonFailed } = useValues(
deliveryComparisonLogic({ author: handle, sourceId })
@@ -120,7 +122,7 @@ export function EngineeringAnalyticsAuthorScene(): JSX.Element {
<div className="flex flex-col gap-2">
<RedTimeByCauseCard
redTime={redTime}
- loading={timelinesLoading && !timelines}
+ loading={timelinesLoading}
jobsAvailable={!!timelines?.jobs_available}
/>
<PullRequestDayView
@@ -154,6 +156,8 @@ export function EngineeringAnalyticsAuthorScene(): JSX.Element {
</div>
))}
</LemonCard>
+ ) : workflowCostsFailed ? (
+ <CIAnalyticsLoadError onRetry={loadWorkflowCosts} />
) : workflowCosts.length > 0 ? (
<LemonCard hoverEffect={false} className="p-4">
<div className="mb-2 flex items-center justify-between gap-2">
diff --git a/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsHealth.stories.tsx b/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsHealth.stories.tsx
index d5f222b515c5..9ced38e779a1 100644
--- a/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsHealth.stories.tsx
+++ b/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsHealth.stories.tsx
@@ -187,6 +187,12 @@ export const Health: Story = {
parameters: { pageUrl: urls.engineeringAnalyticsHealth() },
}
+// A docked side panel leaves the scene about 520px wide, where the lead-time controls must wrap.
+export const HealthNarrow: Story = {
+ ...Health,
+ parameters: { ...Health.parameters, testOptions: { viewport: { width: 900, height: 1800 } } },
+}
+
export const HealthWithLimitedDeploymentCoverage: Story = {
...Health,
decorators: [
diff --git a/products/engineering_analytics/frontend/scenes/authorLogic.ts b/products/engineering_analytics/frontend/scenes/authorLogic.ts
index 75bdbeee5832..1560d79ff4c6 100644
--- a/products/engineering_analytics/frontend/scenes/authorLogic.ts
+++ b/products/engineering_analytics/frontend/scenes/authorLogic.ts
@@ -1,4 +1,4 @@
-import { MakeLogicType, afterMount, connect, kea, key, listeners, path, props, selectors } from 'kea'
+import { MakeLogicType, afterMount, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { ApiConfig } from 'lib/api'
@@ -26,6 +26,7 @@ export interface authorLogicValues {
handle: string
sourceId: string | null
workflowCosts: WorkflowCostApi[]
+ workflowCostsFailed: boolean
workflowCostsLoading: boolean
}
@@ -78,6 +79,10 @@ export const authorLogic = kea<authorLogicType>([
],
})),
+ reducers({
+ workflowCostsFailed: [false, { loadWorkflowCosts: () => false, loadWorkflowCostsFailure: () => true }],
+ }),
+
listeners(({ actions }) => ({
[engineeringAnalyticsFiltersLogic.actionTypes.setDateRange]: () => {
actions.loadWorkflowCosts()