: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(signals): match inbox priority filter dots to the badge colours (#129081)
Andrew Maguiree31ee05fd265
diff --git a/frontend/snapshots.yml b/frontend/snapshots.ymlindex 2f2a87eee9a4..1395b549f282 100644--- a/frontend/snapshots.yml+++ b/frontend/snapshots.yml@@ -12574,6 +12574,10 @@ snapshots:hash: v1.k794b7964.1203e57baa347acd4e5b275dfed5f3c22728009a7373477de73ddf0783e93bc3.ULU5wVI3B8RrV8cDyd5q42JvAQMCPYz3lDFDtzPidv8scenes-app-inbox-linearteamsmodal--teams-picked--light:hash: v1.k794b7964.fbafa81bc3423f3f6daa5a4adb7cf061fb9cc7cdce756414a696daa088d2ccc0.A7XLMQQj4uatJWJApnBbLc1WkTuhCnS49DAYAlpr_qo+ scenes-app-inbox-priorityfilter--open--dark:+ hash: v1.k794b7964.0f9a9449ce711348c7d1083e4fe4f6034ebe13a986be1f4eed5cd8f5bff731ed.KnKN5xUFmYbD1mmovaJd2YcfuPY3AFcC-YG_7CRGDPo+ scenes-app-inbox-priorityfilter--open--light:+ hash: v1.k794b7964.2aae03e53780c0f74f5267c8ba7b7d969a6f648503ac3a6074cf26e0ead334f9.9xib5QAXs9Jhu7_1a2JudX4AeQEbWpzLD14S-DyW3MQscenes-app-inbox-pullrequestdiffview--default--dark:hash: v1.k794b7964.55e3241d3af708ef5aa40de19b0baae64e633e372f3827164e986198b2b6be67.BcRhrBwKQfTp4aSrfBK4LASCs0XEnr1UsMRoEsCEsMsscenes-app-inbox-pullrequestdiffview--default--light:diff --git a/products/signals/frontend/inbox/components/badges/SignalReportPriorityBadge.tsx b/products/signals/frontend/inbox/components/badges/SignalReportPriorityBadge.tsxindex 2b89cee833ea..04e633c43b8a 100644--- a/products/signals/frontend/inbox/components/badges/SignalReportPriorityBadge.tsx+++ b/products/signals/frontend/inbox/components/badges/SignalReportPriorityBadge.tsx@@ -1,21 +1,9 @@import { IconQuestion } from '@posthog/icons'import { Tooltip } from '@posthog/lemon-ui'-import { PRIORITY_MEANING } from '../../filterOptions'+import { PRIORITY_ACCENT, PRIORITY_MEANING } from '../../filterOptions'import { SignalReportPriority } from '../../types'-/**- * Per-priority color, mirroring `PRIORITY_TAG_TYPE`'s LemonTag semantics but as raw CSS vars- * so the badge can paint its own border + text. Theme-aware, so contrast holds in both modes.- */-const PRIORITY_COLOR: Record<SignalReportPriority, string> = {- P0: 'var(--danger)',- P1: 'var(--warning)',- P2: 'var(--danger-lighter)',- P3: 'var(--color-accent)',- P4: 'var(--color-text-secondary)',-}-/*** Sleek priority chip: a square box of accent text on a faint accent fill with a matching border* and a tight radius. Built bespoke since no LemonTag variant gives this filled-square look.@@ -36,7 +24,7 @@ export function SignalReportPriorityBadge({return null}- const color = PRIORITY_COLOR[priority]+ const color = PRIORITY_ACCENT[priority]const borderColor = `color-mix(in srgb, ${color} 40%, transparent)`const chip = (<spandiff --git a/products/signals/frontend/inbox/components/shell/InboxPriorityFilter.stories.tsx b/products/signals/frontend/inbox/components/shell/InboxPriorityFilter.stories.tsxnew file mode 100644index 000000000000..cfab313aaa3d--- /dev/null+++ b/products/signals/frontend/inbox/components/shell/InboxPriorityFilter.stories.tsx@@ -0,0 +1,28 @@+import type { Meta, StoryObj } from '@storybook/react'+import { waitFor, within } from '@testing-library/dom'+import userEvent from '@testing-library/user-event'++import { InboxPriorityFilter } from './InboxPriorityFilter'++const meta: Meta<typeof InboxPriorityFilter> = {+ title: 'Scenes-App/Inbox/PriorityFilter',+ component: InboxPriorityFilter,+ parameters: { layout: 'centered' },+}+export default meta++type Story = StoryObj<typeof InboxPriorityFilter>++// Captures the open menu, so a change to the priority dot colors shows up next to the badges story.+export const Open: Story = {+ parameters: { testOptions: { snapshotTargetSelector: '.Popover' } },+ render: () => <InboxPriorityFilter />,+ play: async ({ canvasElement }) => {+ await userEvent.click(await within(canvasElement).findByText('All priorities'))+ await waitFor(() => {+ if (!document.querySelector('.Popover')) {+ throw new Error('priority menu not open yet')+ }+ })+ },+}diff --git a/products/signals/frontend/inbox/components/shell/InboxPriorityFilter.tsx b/products/signals/frontend/inbox/components/shell/InboxPriorityFilter.tsxnew file mode 100644index 000000000000..80c63b4b9c86--- /dev/null+++ b/products/signals/frontend/inbox/components/shell/InboxPriorityFilter.tsx@@ -0,0 +1,48 @@+import { useActions, useValues } from 'kea'++import { LemonSelect } from '@posthog/lemon-ui'++import {+ INBOX_PRIORITY_OPTIONS,+ inboxPriorityFilterLabel,+ PRIORITY_ACCENT,+ PRIORITY_MEANING,+} from '../../filterOptions'+import { inboxFiltersLogic } from '../../logics/inboxFiltersLogic'+import { SignalReportPriority } from '../../types'++const ALL_PRIORITIES = null++const PRIORITY_SELECT_OPTIONS = [+ { value: ALL_PRIORITIES, label: 'All priorities' },+ ...INBOX_PRIORITY_OPTIONS.map((priority) => ({+ value: priority,+ label: `${priority} · ${PRIORITY_MEANING[priority].label}`,+ icon: (+ <span+ className="size-2 rounded-full"+ // eslint-disable-next-line react/forbid-dom-props+ style={{ backgroundColor: PRIORITY_ACCENT[priority] }}+ />+ ),+ })),+]++/** Narrows the report list to one priority. Each option leads with a dot in the priority badge's color. */+export function InboxPriorityFilter(): JSX.Element {+ const { priorityFilter } = useValues(inboxFiltersLogic)+ const { setPriorityFilter } = useActions(inboxFiltersLogic)++ return (+ <LemonSelect+ size="small"+ value={priorityFilter.length === 1 ? priorityFilter[0] : ALL_PRIORITIES}+ onChange={(priority) => setPriorityFilter(priority ? [priority as SignalReportPriority] : [])}+ options={PRIORITY_SELECT_OPTIONS}+ // A shared link can carry several priorities, which no single option represents.+ // Read the selection out of the filter itself so the button never understates it.+ renderButtonContent={() => inboxPriorityFilterLabel(priorityFilter)}+ data-attr="inbox-filter-priority"+ />+ )+}diff --git a/products/signals/frontend/inbox/components/shell/InboxReportFilters.tsx b/products/signals/frontend/inbox/components/shell/InboxReportFilters.tsxindex c01a9a229df6..0febedc574f9 100644--- a/products/signals/frontend/inbox/components/shell/InboxReportFilters.tsx+++ b/products/signals/frontend/inbox/components/shell/InboxReportFilters.tsx@@ -3,35 +3,12 @@ import { useActions, useValues } from 'kea'import { IconCalendar } from '@posthog/icons'import { LemonSelect } from '@posthog/lemon-ui'-import {- INBOX_CREATED_WINDOW_OPTIONS,- INBOX_PRIORITY_OPTIONS,- inboxPriorityFilterLabel,- PRIORITY_ACCENT,- PRIORITY_MEANING,-} from '../../filterOptions'+import { INBOX_CREATED_WINDOW_OPTIONS } from '../../filterOptions'import { InboxCreatedWindow, inboxFiltersLogic } from '../../logics/inboxFiltersLogic'-import { SignalReportPriority } from '../../types'+import { InboxPriorityFilter } from './InboxPriorityFilter'import { InboxSourceFilter } from './InboxSourceFilter'import { InboxStateFilter } from './InboxStateFilter'-const ALL_PRIORITIES = null--const PRIORITY_SELECT_OPTIONS = [- { value: ALL_PRIORITIES, label: 'All priorities' },- ...INBOX_PRIORITY_OPTIONS.map((priority) => ({- value: priority,- label: `${priority} · ${PRIORITY_MEANING[priority].label}`,- icon: (- <span- className="size-2 rounded-full"- // eslint-disable-next-line react/forbid-dom-props- style={{ backgroundColor: PRIORITY_ACCENT[priority] }}- />- ),- })),-]-const ANY_TIME = nullconst CREATED_WINDOW_SELECT_OPTIONS: { value: InboxCreatedWindow | null; label: string }[] = [{ value: ANY_TIME, label: 'Any time' },@@ -62,8 +39,8 @@ function PanelField({ label, children }: { label: string; children: JSX.Element* and scope picks whose inbox this is, so both sit after a divider at the end of the row.*/export function InboxReportFilters({ layout = 'row' }: { layout?: 'row' | 'panel' }): JSX.Element {- const { priorityFilter, timeWindowAvailable, createdWindow, sourceFilterAvailable } = useValues(inboxFiltersLogic)- const { setPriorityFilter, setCreatedWindow } = useActions(inboxFiltersLogic)+ const { timeWindowAvailable, createdWindow, sourceFilterAvailable } = useValues(inboxFiltersLogic)+ const { setCreatedWindow } = useActions(inboxFiltersLogic)const panel = layout === 'panel'const field = (label: string, control: JSX.Element): JSX.Element =>panel ? <PanelField label={label}>{control}</PanelField> : control@@ -71,19 +48,7 @@ export function InboxReportFilters({ layout = 'row' }: { layout?: 'row' | 'panelreturn (<div className={panel ? 'flex flex-col gap-2' : 'flex flex-wrap items-center gap-2'}>{field('Status', <InboxStateFilter />)}- {field(- 'Priority',- <LemonSelect- size="small"- value={priorityFilter.length === 1 ? priorityFilter[0] : ALL_PRIORITIES}- onChange={(priority) => setPriorityFilter(priority ? [priority as SignalReportPriority] : [])}- options={PRIORITY_SELECT_OPTIONS}- // A shared link can carry several priorities, which no single option represents.- // Read the selection out of the filter itself so the button never understates it.- renderButtonContent={() => inboxPriorityFilterLabel(priorityFilter)}- data-attr="inbox-filter-priority"- />- )}+ {field('Priority', <InboxPriorityFilter />)}{timeWindowAvailable &&field('Created',diff --git a/products/signals/frontend/inbox/filterOptions.tsx b/products/signals/frontend/inbox/filterOptions.tsxindex 3d80fb074497..5e5e5f278461 100644--- a/products/signals/frontend/inbox/filterOptions.tsx+++ b/products/signals/frontend/inbox/filterOptions.tsx@@ -31,16 +31,15 @@ import { SignalReportPriority } from './types'import { prettifyScoutSkillName } from './utils/scoutRunsWindow'/**- * Single source of truth for per-priority color. P0–P4 each get a DISTINCT hue so- * users can tell them apart at a glance (red → orange → amber → blue → gray).- * Consumed by the priority badge, the priority monogram, and the filter dots.+ * Per-priority LemonTag type, for surfaces that render a LemonTag. Keep in step with+ * `PRIORITY_ACCENT`, which holds the same colors as raw CSS vars.*/export const PRIORITY_TAG_TYPE: Record<SignalReportPriority, LemonTagType> = {- P0: 'danger', // red- P1: 'warning', // orange- P2: 'caution', // amber- P3: 'highlight', // blue- P4: 'muted', // gray+ P0: 'danger',+ P1: 'warning',+ P2: 'caution',+ P3: 'highlight',+ P4: 'muted',}/**@@ -59,13 +58,17 @@ export const PRIORITY_MEANING: Record<SignalReportPriority, { label: string; desP4: { label: 'Minimal', description: 'Cosmetic or negligible impact, or an optional investigation.' },}-/** Matching CSS accent per priority, for non-LemonTag surfaces (filter dots, monograms). */+/**+ * Single source of truth for per-priority color, as raw CSS vars mirroring `PRIORITY_TAG_TYPE`'s+ * LemonTag colors. Theme-aware, so contrast holds in both modes. Shared by the priority badge and+ * the filter dots so the two always match.+ */export const PRIORITY_ACCENT: Record<SignalReportPriority, string> = {- P0: 'var(--red-9, #e5484d)',- P1: 'var(--orange-9, #f76b15)',- P2: 'var(--amber-9, #ffc53d)',- P3: 'var(--blue-9, #3b9eff)',- P4: 'var(--muted, #8f8f8f)',+ P0: 'var(--danger)',+ P1: 'var(--warning)',+ P2: 'var(--danger-lighter)',+ P3: 'var(--color-accent)',+ P4: 'var(--color-text-secondary)',}// Port of desktop `@posthog/ui/features/inbox/filterOptions`. Drives the Source /