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.

feat(today): list recent objects on home and move home colors to quill (#113516)

Adam Leith97c3ba50e568
diff --git a/frontend/src/layout/today/TodayPreviewCardProvider.tsx b/frontend/src/layout/today/TodayPreviewCardProvider.tsx
index 807b6f21e22b..a67cf288f386 100644
--- a/frontend/src/layout/today/TodayPreviewCardProvider.tsx
+++ b/frontend/src/layout/today/TodayPreviewCardProvider.tsx
@@ -1,10 +1,11 @@
import { PreviewCard } from '@base-ui/react/preview-card'
-import { ReactNode, Suspense, useCallback, useMemo, useRef, useState } from 'react'
+import { ReactNode, Suspense, useCallback, useEffect, useMemo, useRef, useState } from 'react'
import { Card, Skeleton } from '@posthog/quill'
import { lazyWithRetry } from 'lib/utils/retryImport'
+import { cardSideForPointer, trackPointer } from './todayPointer'
import { TodayPreviewCard, TodayPreviewCardContext } from './todayPreviewCardContext'
import { TodayPreviewPayload } from './todayPreviewCards'
@@ -21,12 +22,36 @@ const TodaySpaceHoverCard = lazyWithRetry(() =>
import('./TodaySpaceHoverCard').then((m) => ({ default: m.TodaySpaceHoverCard }))
)
-/** Beside a row, centered on it, so the path to a tall card is short from any row. Under a link in the
- * briefing text instead, so the card does not cover the line. */
-function placement(payload: TodayPreviewPayload): Pick<PreviewCard.Positioner.Props, 'side' | 'align' | 'sideOffset'> {
+function isInTextLink(payload: TodayPreviewPayload): boolean {
return payload.kind === 'report' && payload.surface === 'briefing'
- ? { side: 'bottom', align: 'start', sideOffset: 6 }
+}
+
+/** Beside a row, centered on it, so the path to a tall card is short from any row. On a link in the
+ * home page text, above or below it on the side the pointer came from, so the card does not cover
+ * the next link the pointer moves to. */
+function TodayPreviewPositioner({
+ payload,
+ children,
+}: {
+ payload: TodayPreviewPayload
+ children: ReactNode
+}): JSX.Element {
+ // Fixed per link: the direction at the moment the card moves to this link, not while the pointer rests on it.
+ const textSide = useMemo(() => (isInTextLink(payload) ? cardSideForPointer() : null), [payload])
+ const placement: Pick<PreviewCard.Positioner.Props, 'side' | 'align' | 'sideOffset'> = textSide
+ ? { side: textSide, align: 'start', sideOffset: 6 }
: { side: 'right', align: 'center', sideOffset: 10 }
+ return (
+ <PreviewCard.Positioner
+ data-quill
+ data-quill-portal="popover"
+ // Quill's portal rule reads this token and wins over a z-index utility class.
+ className="[--quill-z-popover:var(--z-popover-with-chart)]"
+ {...placement}
+ >
+ {children}
+ </PreviewCard.Positioner>
+ )
}
/**
@@ -59,6 +84,7 @@ export function TodayPreviewCardProvider({
}),
[handle]
)
+ useEffect(trackPointer, [])
const close = useCallback(() => {
setSubmenuOpen(false)
setOpen(false)
@@ -76,13 +102,7 @@ export function TodayPreviewCardProvider({
{({ payload }) =>
payload ? (
<PreviewCard.Portal>
- <PreviewCard.Positioner
- data-quill
- data-quill-portal="popover"
- // Quill's portal rule reads this token and wins over a z-index utility class.
- className="[--quill-z-popover:var(--z-popover-with-chart)]"
- {...placement(payload)}
- >
+ <TodayPreviewPositioner payload={payload}>
{/* Inside the popup, not its `render`: on React 18 quill's Card takes no ref. */}
<PreviewCard.Popup className="outline-none">
<Card
@@ -108,7 +128,7 @@ export function TodayPreviewCardProvider({
</Suspense>
</Card>
</PreviewCard.Popup>
- </PreviewCard.Positioner>
+ </TodayPreviewPositioner>
</PreviewCard.Portal>
) : null
}
diff --git a/frontend/src/layout/today/todayPointer.ts b/frontend/src/layout/today/todayPointer.ts
new file mode 100644
index 000000000000..037339ed3e9a
--- /dev/null
+++ b/frontend/src/layout/today/todayPointer.ts
@@ -0,0 +1,38 @@
+const RECENT_MOVE_MS = 1000
+// Small jitters while the pointer rests on a link must not flip the direction.
+const DIRECTION_THRESHOLD_PX = 6
+
+let tracking = false
+let lastMoveAt = Number.NEGATIVE_INFINITY
+let anchorY: number | null = null
+let movingUp = false
+
+/** Starts the listener. Call it before the first card can open, so the first card already knows the pointer. */
+export function trackPointer(): void {
+ if (tracking) {
+ return
+ }
+ tracking = true
+ window.addEventListener(
+ 'pointermove',
+ (event) => {
+ lastMoveAt = performance.now()
+ const delta = event.clientY - (anchorY ?? event.clientY)
+ if (anchorY === null || Math.abs(delta) >= DIRECTION_THRESHOLD_PX) {
+ movingUp = delta < 0
+ anchorY = event.clientY
+ }
+ },
+ { passive: true }
+ )
+}
+
+/** Whether a hover comes from the pointer moving, not from the page scrolling under a resting pointer. */
+export function pointerMovedRecently(): boolean {
+ return performance.now() - lastMoveAt < RECENT_MOVE_MS
+}
+
+/** Above a link when the pointer comes down the text, below when it goes up, so the card leaves the next link free. */
+export function cardSideForPointer(): 'top' | 'bottom' {
+ return movingUp ? 'bottom' : 'top'
+}
diff --git a/frontend/src/scenes/library/libraryUtils.ts b/frontend/src/scenes/library/libraryUtils.ts
index dda8a2d38613..4cf4e16f1cc5 100644
--- a/frontend/src/scenes/library/libraryUtils.ts
+++ b/frontend/src/scenes/library/libraryUtils.ts
@@ -115,6 +115,18 @@ export function libraryObjectName(entry: Pick<FileSystemEntry, 'path'>): string
return (segments[segments.length - 1] || entry.path).replace(/\\\//g, '/')
}
+/** The type's name in lower case, for a label beside an object: "feature flag", but "SQL insight" keeps its acronym. */
+export function libraryTypeLabel(type: string | undefined): string | null {
+ const baseType = baseObjectType(type)
+ const name = Object.hasOwn(fileSystemTypes, baseType)
+ ? (fileSystemTypes[baseType as keyof typeof fileSystemTypes] as FileSystemType).name
+ : null
+ if (!name) {
+ return null
+ }
+ return /^[A-Z]{2}/.test(name) ? name : name.charAt(0).toLowerCase() + name.slice(1)
+}
+
export function sortLibraryTypes(types: LibraryObjectType[]): LibraryObjectType[] {
const rank = (type: LibraryObjectType): number => {
const index = LIBRARY_TYPE_ORDER.indexOf(type.value)
diff --git a/frontend/src/scenes/project-homepage/today/Today.scss b/frontend/src/scenes/project-homepage/today/Today.scss
index df55463f9fa5..00b573cb68f0 100644
--- a/frontend/src/scenes/project-homepage/today/Today.scss
+++ b/frontend/src/scenes/project-homepage/today/Today.scss
@@ -1,16 +1,22 @@
-// The Today layout keeps its own "paper" palette. Colours that also appear on tinted surfaces stay literal,
-// the rest switch with the app theme. The app layout shares it so the page behind the rail matches.
+// The Today palette names the quill tokens the layout uses. Quill defines its tokens only inside
+// [data-quill], and a custom property resolves where it is declared, so every [data-quill] root that uses
+// the palette declares it again. Each token falls back for the app layout behind the rail: the paper to the
+// app token quill's background is matched to, and the rest to their former literal values.
+// Colours with no quill counterpart (body text, input borders, the button, the accents) stay literal.
.Today,
+.Today__page,
.TodayAppLayout,
.TodayHoverMark__popup,
.TodayImplementMenu {
- --today-ink: #151515;
- --today-muted: #8d8d88;
- --today-faint: #a3a39e;
- --today-paper: #f7f7f5;
- --today-line: #e5e5e0;
- --today-card: #fff;
- --today-soft: #efefeb;
+ --today-ink: var(--foreground, #151515);
+ --today-muted: var(--muted-foreground, #8d8d88);
+ --today-faint: var(--subtle-foreground, #a3a39e);
+
+ // `--color-bg-primary` cannot be the first choice: inside [data-quill], quill-bridge rebinds it to the brand color.
+ --today-paper: var(--background, var(--color-bg-primary));
+ --today-line: var(--border, #e5e5e0);
+ --today-card: var(--card, #fff);
+ --today-soft: var(--muted, #efefeb);
--today-body-text: #454541;
--today-input-border: #deded8;
--today-focus-border: #a7a7a0;
@@ -24,13 +30,12 @@
--today-key-clause: rgb(29 74 255 / 75%);
[theme='dark'] & {
- --today-ink: #f1f1ee;
- --today-muted: #a6a6a0;
- --today-faint: #82827c;
- --today-paper: #161615;
- --today-line: #2c2c2a;
- --today-card: #1f1f1d;
- --today-soft: #262624;
+ --today-ink: var(--foreground, #f1f1ee);
+ --today-muted: var(--muted-foreground, #a6a6a0);
+ --today-faint: var(--subtle-foreground, #82827c);
+ --today-line: var(--border, #2c2c2a);
+ --today-card: var(--card, #1f1f1d);
+ --today-soft: var(--muted, #262624);
--today-body-text: #d4d4ce;
--today-input-border: #353532;
--today-focus-border: #5c5c57;
@@ -139,13 +144,13 @@
}
.TodayNavItem[data-state='done'] .TodayNavItem__title,
-.TodayReportLink[data-state='done'] {
+.TodayInlineLink[data-state='done'] {
text-decoration: line-through;
}
// Dismissed is not done: it stays readable, only quieter, and the left bar says why.
.TodayNavItem[data-state='dismissed'] .quill-item__content,
-.TodayReportLink[data-state='dismissed'] {
+.TodayInlineLink[data-state='dismissed'] {
opacity: 0.55;
}
@@ -167,9 +172,16 @@
}
}
+.TodayHome {
+ padding-block: 60px;
+}
+
.TodayHome__meta {
+ display: flex;
+ flex-wrap: wrap;
+ align-items: center;
font-family: var(--font-mono);
- font-size: 11px;
+ font-size: 13px;
color: var(--today-faint);
letter-spacing: 0.02em;
@@ -180,12 +192,16 @@
}
}
-.TodayHome__intro {
+.TodayPartyPopper {
+ flex-shrink: 0;
+ margin-right: 8px;
+}
+
+// The running text of the home: the brief and the recent objects.
+.TodayHome__prose {
max-width: 680px;
- margin-top: clamp(72px, 12vh, 120px);
font-size: 16px;
line-height: 1.7;
- color: var(--today-muted);
letter-spacing: -0.005em;
p {
@@ -197,15 +213,16 @@
}
}
+.TodayHome__intro {
+ margin-top: clamp(72px, 12vh, 120px);
+ color: var(--today-faint);
+}
+
.TodayHome__greeting {
display: flex;
gap: 10px;
align-items: center;
margin-bottom: 10px;
- font-size: 21px;
- font-weight: 560;
- color: var(--today-ink);
- letter-spacing: -0.015em;
}
.TodayHome__badge {
@@ -272,19 +289,19 @@
}
}
-.TodayReportLink {
- padding: 0;
- color: inherit;
- text-align: inherit;
+// A link inside running text. A container sets `--today-link` to change its resting colour.
+.TodayInlineLink {
+ color: var(--today-link, var(--today-muted));
text-decoration: underline;
text-decoration-thickness: 1.5px;
- text-decoration-color: color-mix(in sRGB, var(--today-ink) 18%, transparent);
+ text-decoration-color: color-mix(in oklab, currentColor 50%, transparent);
text-underline-offset: 5px;
transition:
color 0.16s,
text-decoration-color 0.16s;
&:hover,
+ &:active,
&[data-active='true'] {
color: var(--today-ink);
text-decoration-color: var(--today-ink);
@@ -294,32 +311,24 @@
.TodayHome__highlight {
padding: 0.02em 0.2em 0.08em;
margin: 0 -0.03em;
- background: #ffbda380;
+
+ // `--primary-light` is the brand orange in both themes; `--primary` turns yellow in dark mode.
+ background: color-mix(in oklab, var(--primary-light) 22%, transparent);
border-radius: 0.26em;
box-decoration-break: clone;
- .TodayReportLink,
- .TodayReportLink:hover,
- .TodayReportLink[data-active='true'] {
+ .TodayInlineLink,
+ .TodayInlineLink:hover,
+ .TodayInlineLink[data-active='true'] {
font-weight: 500;
- color: #ff4800;
+ color: var(--primary-light);
text-decoration: none;
}
// The strike outlives the reset above, so a resolved item reads the same here as in the rail.
- .TodayReportLink[data-state='done'] {
+ .TodayInlineLink[data-state='done'] {
text-decoration: line-through;
}
-
- [theme='dark'] & {
- background: #ff48002e;
-
- .TodayReportLink,
- .TodayReportLink:hover,
- .TodayReportLink[data-active='true'] {
- color: #ff9e7a;
- }
- }
}
.TodayHome__progress {
@@ -330,24 +339,97 @@
.TodayHome__foot {
margin-top: 48px;
+}
- button {
- color: var(--today-ink);
- text-decoration: underline;
- text-decoration-color: color-mix(in sRGB, var(--today-ink) 20%, transparent);
- text-underline-offset: 5px;
+.TodayInboxLink {
+ color: var(--primary);
+}
+
+// A button inside running text that reads as a link.
+.TodayInlineAction {
+ color: var(--today-ink);
+ text-decoration: underline;
+ text-decoration-color: color-mix(in oklab, var(--today-ink) 45%, transparent);
+ text-underline-offset: 5px;
+
+ &:hover {
+ color: var(--primary);
+ }
+}
+
+// Recent work on the home
+
+.TodayHome__recents {
+ margin-top: 56px;
+ color: var(--today-muted);
+}
+
+.TodayRecentList {
+ padding: 0;
+ margin: 0 0 10px;
+ list-style: none;
+}
+
+.TodayRecentRow {
+ --today-link: var(--today-ink);
+
+ display: flex;
+ gap: 10px;
+ align-items: center;
+ min-width: 0;
+ padding: 3px 0;
+
+ .TodayRecentIcon {
+ flex-shrink: 0;
+ margin-right: 0;
- &:hover {
- color: #ff5c1c;
+ > span {
+ transition: transform 0.18s;
}
}
+
+ &:hover .TodayRecentIcon > span,
+ &:focus-within .TodayRecentIcon > span {
+ transform: rotate(-6deg) scale(1.08);
+
+ @media (prefers-reduced-motion: reduce) {
+ transform: none;
+ }
+ }
+}
+
+.TodayRecentRow__meta {
+ flex-shrink: 0;
+ font-size: 14px;
+ white-space: pre;
+}
+
+.TodayRecentRow__time {
+ color: var(--today-faint);
}
-// Ask box
+// A small type tile before each recent object, in the style of the report chips above it.
+.TodayRecentIcon {
+ display: inline-flex;
+ margin-right: 5px;
+ vertical-align: -3px;
+
+ // The product icon wrapper sets `color` to the product's color, so the tile fills with it.
+ > span {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ width: 18px;
+ height: 18px;
+ background: currentColor;
+ border-radius: 5px;
+ }
-.TodayAsk {
- max-width: 760px;
- margin-top: 76px;
+ svg {
+ width: 11px;
+ height: 11px;
+ color: #fff;
+ }
}
.TodayHoverMark {
@@ -593,10 +675,6 @@
.TodayHome__intro {
margin-top: 32px;
}
-
- .TodayAsk {
- margin-top: 40px;
- }
}
@media (prefers-reduced-motion: reduce) {
diff --git a/frontend/src/scenes/project-homepage/today/Today.stories.tsx b/frontend/src/scenes/project-homepage/today/Today.stories.tsx
index b43481c2b786..db75c576fbbd 100644
--- a/frontend/src/scenes/project-homepage/today/Today.stories.tsx
+++ b/frontend/src/scenes/project-homepage/today/Today.stories.tsx
@@ -233,6 +233,44 @@ const LIBRARY = [
{ id: 'fs-3', path: 'Unfiled/Feature flags/one-page-checkout', type: 'feature_flag', ref: '7' },
]
+const RECENTLY_VIEWED = [
+ {
+ id: 'fs-recent-1',
+ path: 'Unfiled/Insights/Checkout funnel',
+ type: 'insight',
+ ref: 'abc123',
+ href: '/insights/abc123',
+ last_viewed_at: '2026-09-28T16:20:00Z',
+ created_at: '2026-08-12T10:00:00Z',
+ },
+ {
+ id: 'fs-recent-2',
+ path: 'Unfiled/Dashboards/Growth overview',
+ type: 'dashboard',
+ ref: '12',
+ href: '/dashboard/12',
+ last_viewed_at: '2026-09-28T11:05:00Z',
+ created_at: '2026-07-02T10:00:00Z',
+ },
+ {
+ id: 'fs-recent-3',
+ path: 'Unfiled/Feature flags/one-page-checkout',
+ type: 'feature_flag',
+ ref: '7',
+ href: '/feature_flags/7',
+ last_viewed_at: '2026-09-27T15:40:00Z',
+ created_at: '2026-09-01T10:00:00Z',
+ },
+ {
+ id: 'fs-recent-4',
+ path: 'Unfiled/Cohorts/Power users',
+ type: 'cohort',
+ ref: '3',
+ href: '/cohorts/3',
+ last_viewed_at: '2026-09-26T09:10:00Z',
+ created_at: '2026-06-20T10:00:00Z',
+ },
+]
const USER = { id: 1, uuid: 'user-1', first_name: 'Ada', email: '[email protected]' }
const VIEW_CANVASES = [
@@ -665,7 +703,11 @@ const meta: Meta = {
},
'/api/environments/:team_id/conversations/': { results: CONVERSATIONS, next: null },
'/api/environments/:team_id/file_system/': ({ request }) => {
- const type = new URL(request.url).searchParams.get('type')
+ const params = new URL(request.url).searchParams
+ if (params.get('order_by') === '-last_viewed_at') {
+ return [200, { results: RECENTLY_VIEWED, count: RECENTLY_VIEWED.length }]
+ }
+ const type = params.get('type')
const results = type ? LIBRARY.filter((entry) => entry.type === type) : LIBRARY
return [200, { results, count: results.length }]
},
diff --git a/frontend/src/scenes/project-homepage/today/TodayAskBox.tsx b/frontend/src/scenes/project-homepage/today/TodayAskBox.tsx
deleted file mode 100644
index fa7dfbabc420..000000000000
--- a/frontend/src/scenes/project-homepage/today/TodayAskBox.tsx
+++ /dev/null
@@ -1,43 +0,0 @@
-import { useActions } from 'kea'
-import { useRef, useState } from 'react'
-
-import { Composer, QuillComposerLayout, QuillComposerSendButton } from 'products/posthog_ai/frontend/api/composer'
-
-import { todayLogic } from './todayLogic'
-
-/** Sends the question to PostHog AI with the briefing as context. PostHog AI answers in a new chat under Spaces. */
-export function TodayAskBox(): JSX.Element {
- const { askAi } = useActions(todayLogic)
- const [question, setQuestion] = useState('')
- const groupRef = useRef<HTMLDivElement>(null)
- const textAreaRef = useRef<HTMLTextAreaElement>(null)
-
- return (
- <div className="TodayAsk" data-quill>
- <Composer.Root
- value={question}
- onChange={setQuestion}
- onSubmit={() => {
- const trimmed = question.trim()
- if (trimmed) {
- askAi(trimmed, 'ask_box')
- setQuestion('')
- }
- }}
- textAreaRef={textAreaRef}
- >
- <QuillComposerLayout
- groupRef={groupRef}
- textAreaRef={textAreaRef}
- field={
- <Composer.Field>
- <Composer.Placeholder>What would you like to know?</Composer.Placeholder>
- <Composer.Textarea aria-label="Ask PostHog AI" data-attr="today-ask-input" />
- </Composer.Field>
- }
- send={<QuillComposerSendButton data-attr="today-ask-send" />}
- />
- </Composer.Root>
- </div>
- )
-}
diff --git a/frontend/src/scenes/project-homepage/today/TodayBriefing.tsx b/frontend/src/scenes/project-homepage/today/TodayBriefing.tsx
index 63b4a5422567..8cf48cb29cfe 100644
--- a/frontend/src/scenes/project-homepage/today/TodayBriefing.tsx
+++ b/frontend/src/scenes/project-homepage/today/TodayBriefing.tsx
@@ -2,19 +2,21 @@ import { useActions, useValues } from 'kea'
import { IconRefresh } from '@posthog/icons'
import { LemonBanner, LemonButton } from '@posthog/lemon-ui'
+import { Text } from '@posthog/quill'
-import { Link } from 'lib/lemon-ui/Link'
+import { LinkPrimitive } from 'lib/lemon-ui/Link'
import { Spinner } from 'lib/lemon-ui/Spinner/Spinner'
import { urls } from 'scenes/urls'
import { TodayPreviewTrigger } from '~/layout/today/TodayPreviewTrigger'
-import { TodayAskBox } from './TodayAskBox'
import { WALK_THROUGH_QUESTION } from './todayAskPrompt'
import { TodayChipStack } from './TodayChipStack'
import { TodayIcon } from './TodayIcon'
import { todayLogic } from './todayLogic'
+import { TodayPartyPopper } from './TodayPartyPopper'
import { TodayPersonalBriefing } from './TodayPersonalBriefing'
+import { TodayRecents } from './TodayRecents'
import { TodaySampleBanner } from './TodaySampleBanner'
import { TodayBriefingSegment, reportIcon, reportSource } from './todaySignalReports'
@@ -26,8 +28,11 @@ function TodayMetaLine(): JSX.Element {
const date = new Date(now)
return (
<div className="TodayHome__meta">
- <span>{`${currentTeam?.name ?? 'Your project'} · ${DATE_FORMAT.format(date)} · `}</span>
- <time translate="no">{TIME_FORMAT.format(date)}</time>
+ <TodayPartyPopper />
+ <span className="whitespace-pre">{`${currentTeam?.name ?? 'Your project'} · ${DATE_FORMAT.format(date)} · `}</span>
+ <time translate="no" dateTime={date.toISOString()}>
+ {TIME_FORMAT.format(date)}
+ </time>
</div>
)
}
@@ -42,10 +47,9 @@ function BriefingSegment({ segment }: { segment: TodayBriefingSegment }): JSX.El
// A briefing can link a report outside the top five, which has no row to open it from.
const report = reports.find((candidate) => candidate.id === reportId)
const link = (
- <Link
+ <LinkPrimitive
to={urls.todayReport(reportId)}
- subtle
- className="TodayReportLink"
+ className="TodayInlineLink"
data-active={hoveredReportId === reportId}
data-state={reportStateOverrides[reportId] ?? 'open'}
data-attr="today-briefing-report"
@@ -54,7 +58,7 @@ function BriefingSegment({ segment }: { segment: TodayBriefingSegment }): JSX.El
onMouseLeave={() => setHoveredReportId(null)}
>
{segment.text}
- </Link>
+ </LinkPrimitive>
)
const preview = teamReportPreviews.briefing[reportId]
const linkWithCard = preview ? (
@@ -98,15 +102,16 @@ function TodayBriefingReports(): JSX.Element {
<p className="TodayHome__foot">
{moreReportCount > 0 && (
<>
- <Link to={urls.inbox()} data-attr="today-briefing-inbox">
+ <LinkPrimitive to={urls.inbox()} className="TodayInboxLink" data-attr="today-briefing-inbox">
{`${moreReportCount} more for you in the Inbox`}
- </Link>
+ </LinkPrimitive>
<span>. </span>
</>
)}
<span>Or </span>
<button
type="button"
+ className="TodayInlineAction"
data-attr="today-ask-about-edition"
onClick={() => askAi(WALK_THROUGH_QUESTION, 'walk_through')}
>
@@ -132,12 +137,14 @@ export function TodayBriefing(): JSX.Element {
const { loadTopReports, refreshBriefing } = useActions(todayLogic)
return (
- <div className="TodayHome Today__page">
+ <div className="TodayHome Today__page" data-quill>
<TodaySampleBanner />
<TodayMetaLine />
- <section className="TodayHome__intro" aria-label="Daily brief">
+ <section className="TodayHome__prose TodayHome__intro" aria-label="Daily brief">
<div className="TodayHome__greeting">
- <span>{greeting}</span>
+ <Text render={<h1 />} className="m-0 text-[21px] font-[560] tracking-[-0.015em]">
+ {greeting}
+ </Text>
{briefingWaiting ? (
<span className="TodayHome__badge" data-attr="today-briefing-writing">
<Spinner textColored />
@@ -177,9 +184,9 @@ export function TodayBriefing(): JSX.Element {
Self-driving turns signals from across PostHog into reports worth acting on. New ones
show up here as it finds them.{' '}
</span>
- <Link to={urls.inbox()} data-attr="today-empty-inbox">
+ <LinkPrimitive to={urls.inbox()} className="TodayInboxLink" data-attr="today-empty-inbox">
Open the Inbox
- </Link>
+ </LinkPrimitive>
<span> to see everything it’s tracking.</span>
</p>
</>
@@ -187,7 +194,7 @@ export function TodayBriefing(): JSX.Element {
<TodayBriefingReports />
)}
</section>
- <TodayAskBox />
+ <TodayRecents />
</div>
)
}
diff --git a/frontend/src/scenes/project-homepage/today/TodayHoverMark.tsx b/frontend/src/scenes/project-homepage/today/TodayHoverMark.tsx
index b60fa0aa16c5..02e99b2a5863 100644
--- a/frontend/src/scenes/project-homepage/today/TodayHoverMark.tsx
+++ b/frontend/src/scenes/project-homepage/today/TodayHoverMark.tsx
@@ -3,26 +3,12 @@ import { type ReactNode, useCallback, useState } from 'react'
import { Card, cn } from '@posthog/quill'
+import { pointerMovedRecently, trackPointer } from '~/layout/today/todayPointer'
+
const OPEN_DELAY_MS = 250
const CLOSE_DELAY_MS = 120
const CARD_GAP_PX = 10
-const RECENT_MOVE_MS = 1000
-let lastPointerMove = Number.NEGATIVE_INFINITY
-let tracksPointer = false
-
-function trackPointerMoves(): void {
- if (tracksPointer) {
- return
- }
- tracksPointer = true
- window.addEventListener('pointermove', () => (lastPointerMove = performance.now()), { passive: true })
-}
-
-function pointerMovedRecently(): boolean {
- return performance.now() - lastPointerMove < RECENT_MOVE_MS
-}
-
function cardAnchor(trigger: HTMLElement | null): Element | undefined {
return trigger?.closest('[data-today-figures]') ?? trigger?.closest('li, p') ?? undefined
}
@@ -43,7 +29,7 @@ export function TodayHoverMark({
const [trigger, setTrigger] = useState<HTMLElement | null>(null)
const [open, setOpen] = useState(false)
const triggerRef = useCallback((node: HTMLElement | null): void => {
- trackPointerMoves()
+ trackPointer()
setTrigger(node)
}, [])
return (
diff --git a/frontend/src/scenes/project-homepage/today/TodayPartyPopper.tsx b/frontend/src/scenes/project-homepage/today/TodayPartyPopper.tsx
new file mode 100644
index 000000000000..3edd1aef06a3
--- /dev/null
+++ b/frontend/src/scenes/project-homepage/today/TodayPartyPopper.tsx
@@ -0,0 +1,23 @@
+export function TodayPartyPopper(): JSX.Element {
+ return (
+ <svg className="TodayPartyPopper" width="17" height="17" viewBox="0 0 17 17" fill="none" aria-hidden>
+ <g strokeWidth="1.01037" strokeLinecap="round" strokeLinejoin="round">
+ <path
+ d="M11.4847 10.1154C11.8337 10.4639 11.7022 11.0568 11.2388 11.2252L2.70407 14.3257C2.16645 14.5211 1.64545 13.9997 1.84113 13.4622L4.94442 4.93839C5.1129 4.47563 5.7048 4.34421 6.05329 4.69217L11.4847 10.1154Z"
+ stroke="#FFA81C"
+ />
+ <path
+ d="M9.46262 1.17871C9.46262 1.17871 9.58582 1.89818 9.46262 2.56228C9.32999 3.27755 8.76978 3.94585 8.76978 3.94585"
+ stroke="#1490E8"
+ />
+ <path d="M10.5037 5.67518L11.1964 4.9834" stroke="#FFA81C" />
+ <path d="M12.4429 3.08116L12.7546 2.21643" stroke="#FF5C1C" />
+ <path d="M13.6216 5.32929L14.3144 4.9834" stroke="#1490E8" />
+ <path
+ d="M12.2349 7.40479C12.2349 7.40479 12.7587 7.42688 13.2741 7.59157C13.7386 7.73996 14.3133 8.09655 14.3133 8.09655"
+ stroke="#FF5C1C"
+ />
+ </g>
+ </svg>
+ )
+}
diff --git a/frontend/src/scenes/project-homepage/today/TodayPersonalBriefing.tsx b/frontend/src/scenes/project-homepage/today/TodayPersonalBriefing.tsx
index f5367df18e65..b3226e129630 100644
--- a/frontend/src/scenes/project-homepage/today/TodayPersonalBriefing.tsx
+++ b/frontend/src/scenes/project-homepage/today/TodayPersonalBriefing.tsx
@@ -1,6 +1,6 @@
import { useActions, useValues } from 'kea'
-import { Link } from 'lib/lemon-ui/Link'
+import { LinkPrimitive } from 'lib/lemon-ui/Link'
import { pluralize } from 'lib/utils/strings'
import { urls } from 'scenes/urls'
@@ -23,11 +23,10 @@ function PersonalBriefingSegment({ segment }: { segment: BriefingSegmentApi }):
}
const href = itemHref(item)
const link = (
- <Link
+ <LinkPrimitive
to={href}
target={isExternalHref(href) ? '_blank' : undefined}
- subtle
- className="TodayReportLink"
+ className="TodayInlineLink"
data-active={hoveredItemKey === item.key}
data-state={item.state}
data-attr="today-briefing-item"
@@ -36,7 +35,7 @@ function PersonalBriefingSegment({ segment }: { segment: BriefingSegmentApi }):
onMouseLeave={() => setHoveredItemKey(null)}
>
{segment.text}
- </Link>
+ </LinkPrimitive>
)
const preview = reportPreviews.briefing[item.key]
const linkWithCard = preview ? (
@@ -87,9 +86,9 @@ export function TodayPersonalBriefing(): JSX.Element | null {
Reports that wait for you, that you claimed or review, and urgent reports nobody owns show up
here. Your briefing updates every morning at 8:00.{' '}
</span>
- <Link to={urls.inbox()} data-attr="today-empty-briefing-inbox">
+ <LinkPrimitive to={urls.inbox()} className="TodayInboxLink" data-attr="today-empty-briefing-inbox">
Open the Inbox
- </Link>
+ </LinkPrimitive>
<span> to see every report.</span>
</p>
</>
@@ -116,17 +115,18 @@ export function TodayPersonalBriefing(): JSX.Element | null {
<p className="TodayHome__foot">
{inboxMore && (
<>
- <Link to={urls.inbox()} data-attr="today-briefing-inbox">
+ <LinkPrimitive to={urls.inbox()} className="TodayInboxLink" data-attr="today-briefing-inbox">
{inboxMore.scope === 'for_you'
? `${inboxMore.count} more for you in the Inbox`
: `${inboxMore.count} other open ${pluralize(inboxMore.count, 'report', undefined, false)} in the Inbox`}
- </Link>
+ </LinkPrimitive>
<span>. </span>
</>
)}
<span>Or </span>
<button
type="button"
+ className="TodayInlineAction"
data-attr="today-ask-about-edition"
onClick={() => askAi(WALK_THROUGH_QUESTION, 'walk_through')}
>
diff --git a/frontend/src/scenes/project-homepage/today/TodayRecents.tsx b/frontend/src/scenes/project-homepage/today/TodayRecents.tsx
new file mode 100644
index 000000000000..e1c2cdf532b5
--- /dev/null
+++ b/frontend/src/scenes/project-homepage/today/TodayRecents.tsx
@@ -0,0 +1,88 @@
+import { useActions, useValues } from 'kea'
+import { useId } from 'react'
+
+import { dayjs } from 'lib/dayjs'
+import { LinkPrimitive } from 'lib/lemon-ui/Link'
+import { libraryObjectHref, libraryObjectName, libraryTypeLabel } from 'scenes/library/libraryUtils'
+
+import { iconForType } from '~/layout/panel-layout/ProjectTree/defaultTree'
+import { todayShellLogic } from '~/layout/today/todayShellLogic'
+import { FileSystemEntry, FileSystemIconType } from '~/queries/schema/schema-general'
+
+import { todayLogic } from './todayLogic'
+import { TodaySectionTitle } from './TodaySectionTitle'
+
+function RecentObjectRow({ entry }: { entry: FileSystemEntry }): JSX.Element {
+ const typeLabel = libraryTypeLabel(entry.type)
+ return (
+ <li className="TodayRecentRow">
+ <span className="TodayRecentIcon" aria-hidden>
+ {iconForType(entry.type as FileSystemIconType | undefined)}
+ </span>
+ <LinkPrimitive
+ to={libraryObjectHref(entry) ?? undefined}
+ className="TodayInlineLink truncate"
+ data-attr="today-home-recent-object"
+ >
+ {libraryObjectName(entry)}
+ </LinkPrimitive>
+ <span className="TodayRecentRow__meta">
+ {typeLabel && <span>{typeLabel}</span>}
+ {typeLabel && entry.last_viewed_at && <span className="TodayRecentRow__time"> · </span>}
+ {entry.last_viewed_at && (
+ <time className="TodayRecentRow__time" dateTime={entry.last_viewed_at}>
+ {dayjs(entry.last_viewed_at).fromNow()}
+ </time>
+ )}
+ </span>
+ </li>
+ )
+}
+
+export function TodayRecents(): JSX.Element {
+ const { recentObjects, recentsHasLoaded } = useValues(todayLogic)
+ const { pickPane } = useActions(todayShellLogic)
+ const titleId = useId()
+
+ const productsButton = (
+ <button
+ type="button"
+ className="TodayInlineAction"
+ data-attr="today-home-recent-library"
+ onClick={() => pickPane('products')}
+ >
+ Products
+ </button>
+ )
+
+ return (
+ <section
+ className="TodayHome__prose TodayHome__recents group/colorful-product-icons colorful-product-icons-true flex flex-col gap-2.5"
+ aria-labelledby={titleId}
+ >
+ <TodaySectionTitle id={titleId}>Recent</TodaySectionTitle>
+ {!recentsHasLoaded ? (
+ <p>Finding what you looked at last…</p>
+ ) : recentObjects.length === 0 ? (
+ <p>
+ <span>Dashboards, insights and other things you open show up here. Find them in the </span>
+ {productsButton}
+ <span>.</span>
+ </p>
+ ) : (
+ <>
+ <ul className="TodayRecentList">
+ {recentObjects.map((entry) => (
+ <RecentObjectRow key={entry.id} entry={entry} />
+ ))}
+ </ul>
+ <p>
+ <span>Everything else is in </span>
+ {productsButton}
+ <span>.</span>
+ </p>
+ </>
+ )}
+ </section>
+ )
+}
diff --git a/frontend/src/scenes/project-homepage/today/TodayReportEvidence.tsx b/frontend/src/scenes/project-homepage/today/TodayReportEvidence.tsx
index 4de699f54c65..c4f73596453e 100644
--- a/frontend/src/scenes/project-homepage/today/TodayReportEvidence.tsx
+++ b/frontend/src/scenes/project-homepage/today/TodayReportEvidence.tsx
@@ -8,9 +8,9 @@ import { urls } from 'scenes/urls'
import { SignalReport } from 'products/signals/frontend/inbox/types'
import { todayReportLogic } from './todayReportLogic'
-import { TodayReportSectionTitle } from './TodayReportSectionTitle'
import { TodayReportSignalRow } from './TodayReportSignalRow'
import { isSampleReportId } from './todaySampleReports'
+import { TodaySectionTitle } from './TodaySectionTitle'
function EvidenceRows({ reportId }: { reportId: string }): JSX.Element {
const { shownEvidence } = useValues(todayReportLogic({ reportId }))
@@ -38,7 +38,7 @@ export function TodayReportEvidence({ report }: { report: SignalReport }): JSX.E
return (
<section className="flex flex-col gap-0.5" aria-label="Evidence" data-attr="today-report-evidence">
<div className="flex items-baseline justify-between gap-3">
- <TodayReportSectionTitle>Evidence</TodayReportSectionTitle>
+ <TodaySectionTitle>Evidence</TodaySectionTitle>
{showsSeeAll && (
<Button
variant="link-muted"
diff --git a/frontend/src/scenes/project-homepage/today/TodayReportProposal.tsx b/frontend/src/scenes/project-homepage/today/TodayReportProposal.tsx
index 9e7ca73a04b2..e2eca069a4e4 100644
--- a/frontend/src/scenes/project-homepage/today/TodayReportProposal.tsx
+++ b/frontend/src/scenes/project-homepage/today/TodayReportProposal.tsx
@@ -4,13 +4,13 @@ import { Text } from '@posthog/quill'
import { TodayMarkedText } from './TodayMarkedText'
import { todayReportLogic } from './todayReportLogic'
-import { TodayReportSectionTitle } from './TodayReportSectionTitle'
+import { TodaySectionTitle } from './TodaySectionTitle'
export function TodayReportProposal({ reportId }: { reportId: string }): JSX.Element {
const { proposal, shownKeyClauses } = useValues(todayReportLogic({ reportId }))
return (
<div className="flex flex-col gap-2">
- <TodayReportSectionTitle>Proposal</TodayReportSectionTitle>
+ <TodaySectionTitle>Proposal</TodaySectionTitle>
{proposal ? (
<Text size="sm" render={<p />} className="leading-relaxed text-pretty">
<TodayMarkedText
diff --git a/frontend/src/scenes/project-homepage/today/TodayReportSectionTitle.tsx b/frontend/src/scenes/project-homepage/today/TodayReportSectionTitle.tsx
deleted file mode 100644
index 40faa64683f1..000000000000
--- a/frontend/src/scenes/project-homepage/today/TodayReportSectionTitle.tsx
+++ /dev/null
@@ -1,9 +0,0 @@
-import { Text } from '@posthog/quill'
-
-export function TodayReportSectionTitle({ children }: { children: string }): JSX.Element {
- return (
- <Text size="base" weight="semibold" render={<h2 />}>
- {children}
- </Text>
- )
-}
diff --git a/frontend/src/scenes/project-homepage/today/TodaySectionTitle.tsx b/frontend/src/scenes/project-homepage/today/TodaySectionTitle.tsx
new file mode 100644
index 000000000000..635d632872ef
--- /dev/null
+++ b/frontend/src/scenes/project-homepage/today/TodaySectionTitle.tsx
@@ -0,0 +1,9 @@
+import { Text } from '@posthog/quill'
+
+export function TodaySectionTitle({ id, children }: { id?: string; children: string }): JSX.Element {
+ return (
+ <Text size="base" weight="semibold" render={<h2 id={id} />}>
+ {children}
+ </Text>
+ )
+}
diff --git a/frontend/src/scenes/project-homepage/today/todayLogic.test.ts b/frontend/src/scenes/project-homepage/today/todayLogic.test.ts
index cb0f232eeb0d..675987a41f5f 100644
--- a/frontend/src/scenes/project-homepage/today/todayLogic.test.ts
+++ b/frontend/src/scenes/project-homepage/today/todayLogic.test.ts
@@ -211,7 +211,7 @@ describe('todayLogic', () => {
if (reportLogic) {
reportLogic.actions.askAboutReport('Why is signup broken?')
} else {
- logic.actions.askAi('Why is signup broken?', report ? 'report_page' : 'ask_box', report)
+ logic.actions.askAi('Why is signup broken?', report ? 'report_page' : 'walk_through', report)
}
})
.toFinishAllListeners()
diff --git a/frontend/src/scenes/project-homepage/today/todayLogic.ts b/frontend/src/scenes/project-homepage/today/todayLogic.ts
index 74fc9f4157ae..8d9341525eaf 100644
--- a/frontend/src/scenes/project-homepage/today/todayLogic.ts
+++ b/frontend/src/scenes/project-homepage/today/todayLogic.ts
@@ -15,6 +15,8 @@ import { urls } from 'scenes/urls'
import { userLogic } from 'scenes/userLogic'
import type { TodayReportCard, TodayReportPreview } from '~/layout/today/todayPreviewCards'
+import { recentItemsModel } from '~/models/recentItemsModel'
+import { FileSystemEntry } from '~/queries/schema/schema-general'
import { TeamType, UserType } from '~/types'
import {
@@ -52,10 +54,12 @@ import {
itemNamesPerson,
itemReportId,
} from './todayBriefingItems'
+import { recentObjectsForHome } from './todayRecentObjects'
import { SAMPLE_BRIEFING, isSampleReportId, parseSampleParam, sampleTopReports } from './todaySampleReports'
import { TodayBriefingSegment, briefingForReports, teamReportCard } from './todaySignalReports'
export const TOP_REPORT_COUNT = 5
+export const RECENT_OBJECT_COUNT = 4
// The most reports the for_you endpoint returns in one call (MAX_FOR_YOU_REPORTS on the backend).
export const MORE_REPORTS_LIMIT = 20
const CLOCK_MS = 30_000
@@ -67,7 +71,7 @@ const MAX_BRIEFING_POLLS = 132
export type TodayReportOpenSource = 'briefing' | 'chip' | 'sidebar' | 'sidebar_more'
/** Where a question to PostHog AI came from, sent with the `today ai asked` event. */
-export type TodayAskSource = 'ask_box' | 'walk_through' | 'report_page'
+export type TodayAskSource = 'walk_through' | 'report_page'
/** What a person decides about a report from Today. */
export type TodayReportVerdict = 'resolve' | 'dismiss'
@@ -206,6 +210,8 @@ export interface TodayBriefingProgress {
// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
export interface todayLogicValues {
+ recents: FileSystemEntry[] // recentItemsModel
+ recentsHasLoaded: boolean // recentItemsModel
currentProjectId: number | string // teamLogic
currentTeam: TeamPublicType | TeamType | null // teamLogic
user: UserType | null // userLogic
@@ -231,6 +237,7 @@ export interface todayLogicValues {
personalBriefing: BriefingApi | null
personalBriefingFailed: boolean
personalBriefingLoading: boolean
+ recentObjects: FileSystemEntry[]
refreshedBriefing: BriefingApi | null
refreshedBriefingLoading: boolean
reloadingAfterRefresh: boolean
@@ -447,6 +454,7 @@ export interface todayLogicMeta {
hour: (now: number) => number
greeting: (hour: number, user: UserType | null) => string
reportSummary: (hour: number, reports: SignalReport[]) => string
+ recentObjects: (recents: FileSystemEntry[]) => FileSystemEntry[]
showPersonalBriefing: (personalBriefing: BriefingApi | null, useSampleData: boolean) => boolean
inboxMore: (personalBriefing: BriefingApi | null) => TodayInboxMore | null
briefingItems: (
@@ -510,7 +518,14 @@ function previewsBySurface(
export const todayLogic = kea<todayLogicType>([
path(['scenes', 'project-homepage', 'today', 'todayLogic']),
connect(() => ({
- values: [userLogic, ['user'], teamLogic, ['currentTeam', 'currentProjectId']],
+ values: [
+ userLogic,
+ ['user'],
+ teamLogic,
+ ['currentTeam', 'currentProjectId'],
+ recentItemsModel,
+ ['recents', 'recentsHasLoaded'],
+ ],
actions: [router, ['locationChanged']],
})),
actions({
@@ -731,6 +746,10 @@ export const todayLogic = kea<todayLogicType>([
(s) => [s.hour, s.reports],
(hour: number, reports: SignalReport[]): string => reportSummaryForHour(hour, reports.length),
],
+ recentObjects: [
+ (s) => [s.recents],
+ (recents: FileSystemEntry[]): FileSystemEntry[] => recentObjectsForHome(recents, RECENT_OBJECT_COUNT),
+ ],
showPersonalBriefing: [
(s) => [s.personalBriefing, s.useSampleData],
(personalBriefing: BriefingApi | null, useSampleData: boolean): boolean =>
diff --git a/frontend/src/scenes/project-homepage/today/todayRecentObjects.test.ts b/frontend/src/scenes/project-homepage/today/todayRecentObjects.test.ts
new file mode 100644
index 000000000000..2dc178dbb432
--- /dev/null
+++ b/frontend/src/scenes/project-homepage/today/todayRecentObjects.test.ts
@@ -0,0 +1,15 @@
+import { recentObjectsForHome } from './todayRecentObjects'
+
+describe('recentObjectsForHome', () => {
+ it('keeps agent sessions and entries with no page out of the recent objects', () => {
+ const recents = [
+ { id: 'task', path: 'Tasks/Fix the flaky test', type: 'task', href: '/tasks/1' },
+ { id: 'dashboard', path: 'Dashboards/Growth', type: 'dashboard', href: '/dashboard/1' },
+ { id: 'unlinked', path: 'Insights/Draft', type: 'insight' },
+ { id: 'by-ref', path: 'Flags/checkout', type: 'feature_flag', ref: '7' },
+ { id: 'insight', path: 'Insights/Funnel', type: 'insight/funnels', href: '/insights/a' },
+ ]
+
+ expect(recentObjectsForHome(recents, 3).map((entry) => entry.id)).toEqual(['dashboard', 'by-ref', 'insight'])
+ })
+})
diff --git a/frontend/src/scenes/project-homepage/today/todayRecentObjects.ts b/frontend/src/scenes/project-homepage/today/todayRecentObjects.ts
new file mode 100644
index 000000000000..0ebe4312d5f8
--- /dev/null
+++ b/frontend/src/scenes/project-homepage/today/todayRecentObjects.ts
@@ -0,0 +1,10 @@
+import { baseObjectType, libraryObjectHref } from 'scenes/library/libraryUtils'
+
+import { FileSystemEntry } from '~/queries/schema/schema-general'
+
+/** Recently viewed objects for the home, without tasks, which are agent sessions rather than things people look at. */
+export function recentObjectsForHome(recents: FileSystemEntry[], limit: number): FileSystemEntry[] {
+ return recents
+ .filter((entry) => libraryObjectHref(entry) !== null && baseObjectType(entry.type) !== 'task')
+ .slice(0, limit)
+}
diff --git a/packages/quill/packages/primitives/src/button.css b/packages/quill/packages/primitives/src/button.css
index 259e36b81ae8..c6690c9698b7 100644
--- a/packages/quill/packages/primitives/src/button.css
+++ b/packages/quill/packages/primitives/src/button.css
@@ -480,8 +480,18 @@
0 0 0 3px color-mix(in oklab, var(--ring) 30%, transparent);
}
- :is(.dark, [theme='dark']) .quill-button--elevated {
- --quill-button-edge: color-mix(in oklab, var(--foreground) 45%, var(--background));
+ /* Dark mode inverts the neutral look onto a foreground fill, so the CTA stands out on a dark surface. */
+ :is(.dark, [theme='dark']) .quill-button--elevated:not(.quill-button--variant-primary) {
+ --quill-button-edge: color-mix(in oklab, var(--background) 75%, var(--foreground));
+
+ color: var(--quill-button-edge);
+ background-color: var(--foreground);
+ border-color: var(--quill-button-edge);
+ }
+
+ :is(.dark, [theme='dark'])
+ .quill-button--elevated:not(.quill-button--variant-primary, :disabled, [aria-disabled='true']):hover {
+ background-color: color-mix(in oklab, var(--foreground) 92%, var(--background));
}
.quill-button--elevated.quill-button--variant-primary {
diff --git a/products/signals/backend/management/commands/seed_inbox_data.py b/products/signals/backend/management/commands/seed_inbox_data.py
index 31c0d5e6d8cc..601eebc1d801 100644
--- a/products/signals/backend/management/commands/seed_inbox_data.py
+++ b/products/signals/backend/management/commands/seed_inbox_data.py
@@ -25,7 +25,7 @@ from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from django.db import transaction
-from posthog.models import OrganizationMembership, Team
+from posthog.models import OrganizationMembership, Team, User
from products.signals.backend.artefact_schemas import (
Commit,
@@ -102,6 +102,7 @@ class Command(BaseCommand):
team = self._get_team(options["team_id"])
user_id = self._resolve_user_id(team, options["user_id"])
+ user_uuid = str(User.objects.values_list("uuid", flat=True).get(id=user_id))
fixtures = self._load_fixtures()
count = options["count"] or len(fixtures)
@@ -116,7 +117,7 @@ class Command(BaseCommand):
self.stdout.write(f" · {report.status:<13} {result.title[:70]} ({name})")
self._add_extra_log_artefacts(team.id, str(report.id), repository, index)
- self._add_suggested_reviewers(team.id, str(report.id), repository, index)
+ self._add_suggested_reviewers(team.id, str(report.id), repository, index, user_uuid)
if options["with_runs"]:
self._seed_task_run(team, user_id, report, repository, index)
created += 1
@@ -244,7 +245,9 @@ class Command(BaseCommand):
attribution=ArtefactAttribution.system(),
)
- def _add_suggested_reviewers(self, team_id: int, report_id: str, repository: str, index: int) -> None:
+ def _add_suggested_reviewers(
+ self, team_id: int, report_id: str, repository: str, index: int, user_uuid: str
+ ) -> None:
# Reviewers are normally derived from finding commit hashes via GitHub, which won't resolve
# locally — so seed them directly. Counts vary (1..7) so some reports exercise the list-overflow.
reviewer_count = 1 + (index % 7)
@@ -265,6 +268,8 @@ class Command(BaseCommand):
)
for i in range(reviewer_count)
]
+ # The seeding user leads the list, so the reports reach their Today home, which shows only reports naming them.
+ entries.insert(0, SuggestedReviewerEntry(user_uuid=user_uuid, reason="Owns the affected surface."))
SignalReportArtefact.append_status(
team_id=team_id,
report_id=report_id,