: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.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
fix(inbox): keep scout troop rows from breaking at narrow widths (#65500)
Andrew Maguire499be7e4fcf8
diff --git a/frontend/src/scenes/inbox/components/config/scouts/ScoutRowCard.tsx b/frontend/src/scenes/inbox/components/config/scouts/ScoutRowCard.tsxindex 38efe79ed746..bb47b6e79ca7 100644--- a/frontend/src/scenes/inbox/components/config/scouts/ScoutRowCard.tsx+++ b/frontend/src/scenes/inbox/components/config/scouts/ScoutRowCard.tsx@@ -50,52 +50,57 @@ export function ScoutRowCard({)}><div className="flex items-center gap-4">- {/* overflow-hidden clips the name group so a long name + badges never spill- onto the cadence/emitted column or the sparkline — the name truncates first. */}- <div className="flex items-center gap-2 min-w-0 flex-1 overflow-hidden">- {asHeader ? (- // min-w keeps the name from being squeezed to zero width by the- // trailing metadata (badges, cadence, emitted count) — truncate- // should clip to an ellipsis, never vanish entirely.- <span className="truncate font-medium text-sm min-w-[6rem]">{displayName}</span>- ) : (- <Tooltip title={`${config.skill_name} · view scout`}>- <Link- to={urls.inboxScout(config.skill_name)}- // The fleet list lives in the setup modal, which portals outside the- // (hidden) list subtree — close it so it doesn't cover the detail page.- onClick={() => closeSetupModal()}- subtle- className="truncate font-medium text-sm min-w-[6rem]"- >- {displayName}- </Link>- </Tooltip>- )}- <Tooltip title={`${config.skill_name} · open skill`}>- <Link- to={urls.skill(config.skill_name)}- target="_blank"- targetBlankIcon={false}- subtle- className="shrink-0 text-muted"- aria-label={`Open the ${config.skill_name} skill`}- >- <IconArrowUpRight className="size-3.5" />- </Link>- </Tooltip>- <ScoutOriginBadge skillName={config.skill_name} />- <DryRunBadge config={config} />- </div>- {/* Cadence + emitted count get their own non-shrinking column so they can't- overlap the sparkline (the name group absorbs any width pressure). */}- <div className="flex items-center gap-1 shrink-0 whitespace-nowrap text-[11px] text-muted">- <span>{formatRunIntervalShort(config.run_interval_minutes)}</span>- {rollup && rollup.emittedCount > 0 ? (- <span>· {pluralize(rollup.emittedCount, 'signal')} emitted</span>- ) : null}+ {/* Name + badges on top, cadence/emitted as a muted subtitle below — keeps the+ metadata off the main row so the sparkline and controls have room to breathe. */}+ <div className="flex flex-col gap-0.5 min-w-0 flex-1">+ <div className="flex items-center gap-2 min-w-0">+ {asHeader ? (+ // min-w keeps the name from being squeezed to zero width by the+ // trailing badges — truncate should clip to an ellipsis, never vanish.+ <span className="truncate font-medium text-sm min-w-[6rem] flex-1">{displayName}</span>+ ) : (+ <Tooltip title={`${config.skill_name} · view scout`}>+ <Link+ to={urls.inboxScout(config.skill_name)}+ // The fleet list lives in the setup modal, which portals outside the+ // (hidden) list subtree — close it so it doesn't cover the detail page.+ onClick={() => closeSetupModal()}+ subtle+ className="truncate font-medium text-sm min-w-[6rem] flex-1"+ >+ {displayName}+ </Link>+ </Tooltip>+ )}+ {/* Icon + badges never shrink: the name (flex-1) absorbs width pressure and+ truncates, so the Custom/Canonical pill is never sliced mid-badge. */}+ <div className="flex items-center gap-2 shrink-0">+ <Tooltip title={`${config.skill_name} · open skill`}>+ <Link+ to={urls.skill(config.skill_name)}+ target="_blank"+ targetBlankIcon={false}+ subtle+ className="text-muted"+ aria-label={`Open the ${config.skill_name} skill`}+ >+ <IconArrowUpRight className="size-3.5" />+ </Link>+ </Tooltip>+ <ScoutOriginBadge skillName={config.skill_name} />+ <DryRunBadge config={config} />+ </div>+ </div>+ <div className="flex items-center gap-1 whitespace-nowrap text-[11px] text-muted">+ <span>{formatRunIntervalShort(config.run_interval_minutes)}</span>+ {rollup && rollup.emittedCount > 0 ? (+ <span>· {pluralize(rollup.emittedCount, 'signal')} emitted</span>+ ) : null}+ </div></div>- <div className="shrink-0">+ {/* The sparkline is the flexible region: it shrinks and clips the oldest runs+ off the left so it can never push the controls column off the row. */}+ <div className="flex min-w-0 overflow-hidden"><ScoutRunBoxes runs={rollup?.runs ?? []} /></div><div className="flex items-center gap-2 shrink-0">diff --git a/frontend/src/scenes/inbox/components/config/scouts/ScoutRunBoxes.tsx b/frontend/src/scenes/inbox/components/config/scouts/ScoutRunBoxes.tsxindex 96a217f5643f..16147eb39695 100644--- a/frontend/src/scenes/inbox/components/config/scouts/ScoutRunBoxes.tsx+++ b/frontend/src/scenes/inbox/components/config/scouts/ScoutRunBoxes.tsx@@ -28,7 +28,7 @@ const OUTCOME_BOX_CLASS: Record<ScoutRunOutcome, string> = {}const MAX_BOXES = 24-const BOX_CLASS = 'block h-3 w-2 rounded-[2px] transition-transform duration-100 hover:scale-y-125'+const BOX_CLASS = 'block h-3 w-2 shrink-0 rounded-[2px] transition-transform duration-100 hover:scale-y-125'function runTooltip(run: SignalScoutRunSummary, now: Date): string {const parts = [scoutRunOutcomeLabel(run, now)]@@ -46,6 +46,11 @@ function runTooltip(run: SignalScoutRunSummary, now: Date): string {* One small box per run in the visible window, oldest on the left. Each box* links out to cloud's Tasks UI via the run's relative `task_url`; runs without* a task link are tooltip-only.+ *+ * Laid out with `flex-row-reverse` (newest first in the DOM) so that when the+ * row is too narrow for every box the container clips the oldest runs off the+ * left edge, keeping the most recent activity — and the controls column to the+ * right — always visible.*/export function ScoutRunBoxes({ runs }: { runs: SignalScoutRunSummary[] }): JSX.Element | null {const visible = useMemo(() => {@@ -62,31 +67,33 @@ export function ScoutRunBoxes({ runs }: { runs: SignalScoutRunSummary[] }): JSX.}const hidden = runs.length - visible.length+ // Newest first so flex-row-reverse renders them right-to-left; the oldest+ // runs (and the +N marker) sit at the left edge and clip away first.+ const newestFirst = visible.slice().reverse()+return (- <div className="flex items-center gap-2 shrink-0">- {hidden > 0 ? <span className="text-[10px] text-muted">+{hidden}</span> : null}- <div className="flex items-center gap-1">- {visible.map(({ run, outcome, tooltip }) => {- const boxClass = `${BOX_CLASS} ${OUTCOME_BOX_CLASS[outcome]}`- if (run.task_url) {- const linkTooltip = `${tooltip} · open task run`- return (- <Tooltip key={run.run_id} title={linkTooltip}>- <Link to={run.task_url} className={boxClass}>- <span className="sr-only">Run {linkTooltip}</span>- </Link>- </Tooltip>- )- }+ <div className="flex flex-row-reverse items-center gap-1 min-w-0 overflow-hidden">+ {newestFirst.map(({ run, outcome, tooltip }) => {+ const boxClass = `${BOX_CLASS} ${OUTCOME_BOX_CLASS[outcome]}`+ if (run.task_url) {+ const linkTooltip = `${tooltip} · open task run`return (- <Tooltip key={run.run_id} title={tooltip}>- <span className={boxClass}>- <span className="sr-only">Run {tooltip}</span>- </span>+ <Tooltip key={run.run_id} title={linkTooltip}>+ <Link to={run.task_url} className={boxClass}>+ <span className="sr-only">Run {linkTooltip}</span>+ </Link></Tooltip>)- })}- </div>+ }+ return (+ <Tooltip key={run.run_id} title={tooltip}>+ <span className={boxClass}>+ <span className="sr-only">Run {tooltip}</span>+ </span>+ </Tooltip>+ )+ })}+ {hidden > 0 ? <span className="shrink-0 text-[10px] text-muted">+{hidden}</span> : null}</div>)}