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(error-tracking): improve issue filters (#73914)

Hugues Pouillot2d8536eef085
diff --git a/frontend/snapshots.yml b/frontend/snapshots.yml
index b4a5f40b0985..6b82c0e3b2da 100644
--- a/frontend/snapshots.yml
+++ b/frontend/snapshots.yml
@@ -1909,9 +1909,9 @@ snapshots:
dashboards-dashboard-widgets-widget-types-activity-recent-events--tile-filters-read-only--light:
hash: v1.k794b7964.f8942e1cec92a622efb804a02df6dd98ce5b2dd7243ebf3df2e4d77c3393d18f.fRrlJH1cpBue6uz0tOwxutK4pSKUyH5I67yUSuOUuQ4
dashboards-dashboard-widgets-widget-types-error-tracking-top-issues--default--dark:
- hash: v1.k794b7964.d3dfbe0e278a9b72fa40eeb9cbc4411543cf1f01685791b2b00db458934a313f.MG8Rflyq7rNwV4K8_57N41AV4_dDboABPGP081KBzMc
+ hash: v1.k794b7964.77b0c690ee3199858b4f196d73c32fbd944079ef7e3e76c8727aba4c3d27225c.ZzuO0MAG8xk-HvmRnNzsk_DQ1SK8akloY2zVFFcIm3E
dashboards-dashboard-widgets-widget-types-error-tracking-top-issues--default--light:
- hash: v1.k794b7964.0c4f20398cc67cc73d4cd2623aab4fad225730b40f7e5670d1ebd34626c9fdbc.MXsNAA0facJ95m94rmKNi-loCzlEINIf4fH8BMWDBJw
+ hash: v1.k794b7964.5aa1d315ee65b9129ab2a8ae1b0b4e81e2c41e49d7379b66ecd23fdc0b28b962.p06078zS7B27oUn2J14G-_7Vrf59GWIiNOp_XEaXK2s
dashboards-dashboard-widgets-widget-types-error-tracking-top-issues--empty--dark:
hash: v1.k794b7964.6ec2a8f0c010c0e197a5360abadfbefe055aac4f5f206895d39c062a51a233e0.5vBYZUqDupOszR6e7FibFy3PG5daScP13dr_ep5VW4g
dashboards-dashboard-widgets-widget-types-error-tracking-top-issues--empty--light:
@@ -1925,9 +1925,9 @@ snapshots:
dashboards-dashboard-widgets-widget-types-error-tracking-top-issues--setup-unavailable--light:
hash: v1.k794b7964.37e9b482167e71e3be8bedc7ba57aa389d8f6b01a988609333c24a298ceda4ff.CGKXua0aX-ocE6JFJJNz3b7eaOxJzhmPsxwSJggocr8
dashboards-dashboard-widgets-widget-types-error-tracking-top-issues--tile-filters-read-only--dark:
- hash: v1.k794b7964.3f3098d9dbdc38c04ba4b7b13310cf9f98ff4dad4a5d0923edd76bff6cdd4641.i6Q3cT8Fj6xbEVm9OTGI_JJd4VWD-IlHPFUpAsVXrBM
+ hash: v1.k794b7964.ea754a4783f7653247f127337c407a8cdd4a9c6bc3f1b908d8d00dd1a090b966.ZjfSmiq21oVkEyMEkKZ2IUqsSavtCZ-p9BuBQ30_M_8
dashboards-dashboard-widgets-widget-types-error-tracking-top-issues--tile-filters-read-only--light:
- hash: v1.k794b7964.54dee265f3ccf00463afa25dccd2bebe20c29dbc2b6994a278fc14ca7301bb72.jcP83uoqbKG4AVhvktaZBgsEc-HWsYZNoe6uJlWJk84
+ hash: v1.k794b7964.b2ca2efc52a9ccf56953159c66d3c8766acd1d3a17379d5faec45a4715ae24a9.cLTUBCzgGYkHRLn1Bmbo-0XLt0VvtnMcR4vuhC_EQUU
dashboards-dashboard-widgets-widget-types-error-tracking-top-issues-widget-settings--before-exception-ingestion--dark:
hash: v1.k794b7964.ee9bd78f705c05a89b8dffa7ce394b1af07b75a9597fd220c94d177b49def5bd.wgr9DZ2HMgzs83WxBZ84ANYLuVRtEtX2bCglKd_4e1k
dashboards-dashboard-widgets-widget-types-error-tracking-top-issues-widget-settings--before-exception-ingestion--light:
diff --git a/frontend/src/lib/components/DateFilter/DateFilter.test.tsx b/frontend/src/lib/components/DateFilter/DateFilter.test.tsx
index 4368cd099503..7ae81b7485e9 100644
--- a/frontend/src/lib/components/DateFilter/DateFilter.test.tsx
+++ b/frontend/src/lib/components/DateFilter/DateFilter.test.tsx
@@ -4,7 +4,6 @@ import { cleanup, render, screen, waitFor } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import { Provider } from 'kea'
-import { Button } from 'lib/ui/quill'
import { dateMapping } from 'lib/utils/dateFilters'
import { initKeaTests } from '~/test/init'
@@ -104,36 +103,3 @@ describe('DateFilter with allowFixedRangeWithTime', () => {
})
})
})
-
-describe('DateFilter with a custom trigger', () => {
- beforeEach(() => {
- initKeaTests()
- render(
- <Provider>
- <DateFilter
- onChange={jest.fn()}
- dateOptions={dateMapping}
- renderTrigger={({ buttonRef, isOpen, label, onClick }) => (
- <Button ref={buttonRef} aria-expanded={isOpen} onClick={onClick}>
- Custom: {label}
- </Button>
- )}
- />
- </Provider>
- )
- })
-
- afterEach(() => {
- cleanup()
- })
-
- it('opens the date options from the rendered trigger', async () => {
- const trigger = screen.getByText(/Custom:/)
-
- expect(trigger).toHaveAttribute('aria-expanded', 'false')
- await userEvent.click(trigger)
-
- expect(trigger).toHaveAttribute('aria-expanded', 'true')
- expect(screen.getByText('Yesterday')).toBeInTheDocument()
- })
-})
diff --git a/frontend/src/lib/components/DateFilter/DateFilter.tsx b/frontend/src/lib/components/DateFilter/DateFilter.tsx
index 7b420988573b..3e366da2224b 100644
--- a/frontend/src/lib/components/DateFilter/DateFilter.tsx
+++ b/frontend/src/lib/components/DateFilter/DateFilter.tsx
@@ -1,7 +1,7 @@
import { Placement } from '@floating-ui/react'
import clsx from 'clsx'
import { useActions, useValues } from 'kea'
-import { type ForwardedRef, type ReactElement, type ReactNode, forwardRef, useEffect, useRef, useState } from 'react'
+import { forwardRef, useEffect, useRef, useState } from 'react'
import { IconCalendar, IconInfo } from '@posthog/icons'
import { LemonButton, LemonButtonProps, LemonDivider, LemonSwitch, Popover } from '@posthog/lemon-ui'
@@ -62,18 +62,6 @@ export interface DateFilterProps {
allowSingleAndRange?: boolean
/** Called when the dropdown opens (true) or closes (false). Used for interaction analytics. */
onOpenChange?: (open: boolean) => void
- /** Optional design-system-specific trigger while preserving the date filter's existing behavior and overlay. */
- renderTrigger?: (props: DateFilterTriggerProps) => ReactElement
-}
-
-export interface DateFilterTriggerProps {
- buttonRef: ForwardedRef<HTMLButtonElement>
- disabledReason?: string | null
- fullWidth: boolean
- isOpen: boolean
- label: ReactNode
- onClick: () => void
- title?: string
}
interface RawDateFilterProps extends DateFilterProps {
@@ -126,7 +114,6 @@ export const DateFilter = forwardRef<HTMLButtonElement, RawDateFilterProps>(func
showCustomRelativeRange = false,
allowSingleAndRange = false,
onOpenChange,
- renderTrigger,
},
ref
) {
@@ -423,32 +410,20 @@ export const DateFilter = forwardRef<HTMLButtonElement, RawDateFilterProps>(func
onClickOutside={close}
closeParentPopoverOnClickInside={false}
>
- {renderTrigger ? (
- renderTrigger({
- buttonRef: ref,
- disabledReason,
- fullWidth,
- isOpen: isVisible,
- label,
- onClick: isVisible ? close : open,
- title: formatResolvedDateRange(resolvedDateRange),
- })
- ) : (
- <LemonButton
- ref={ref}
- id="daterange_selector"
- size={size ?? 'small'}
- type={type ?? 'secondary'}
- disabledReason={disabledReason}
- data-attr="date-filter"
- icon={<IconCalendar />}
- onClick={isVisible ? close : open}
- fullWidth={fullWidth}
- tooltip={formatResolvedDateRange(resolvedDateRange)}
- >
- <span className={clsx('text-nowrap', className)}>{label}</span>
- </LemonButton>
- )}
+ <LemonButton
+ ref={ref}
+ id="daterange_selector"
+ size={size ?? 'small'}
+ type={type ?? 'secondary'}
+ disabledReason={disabledReason}
+ data-attr="date-filter"
+ icon={<IconCalendar />}
+ onClick={isVisible ? close : open}
+ fullWidth={fullWidth}
+ tooltip={formatResolvedDateRange(resolvedDateRange)}
+ >
+ <span className={clsx('text-nowrap', className)}>{label}</span>
+ </LemonButton>
</Popover>
)
})
diff --git a/packages/quill/packages/primitives/src/index.ts b/packages/quill/packages/primitives/src/index.ts
index 62ccbb8f8562..f88b1dcf8249 100644
--- a/packages/quill/packages/primitives/src/index.ts
+++ b/packages/quill/packages/primitives/src/index.ts
@@ -290,6 +290,7 @@ export {
SelectGroupLabel,
SelectSeparator,
SelectTrigger,
+ SelectTriggerIcon,
SelectValue,
} from './select'
export { Separator } from './separator'
diff --git a/packages/quill/packages/primitives/src/select.tsx b/packages/quill/packages/primitives/src/select.tsx
index e43f2d526960..194a19333fde 100644
--- a/packages/quill/packages/primitives/src/select.tsx
+++ b/packages/quill/packages/primitives/src/select.tsx
@@ -22,6 +22,10 @@ function SelectValue({ className, ...props }: SelectPrimitive.Value.Props): Reac
)
}
+function SelectTriggerIcon({ className, ...props }: React.ComponentProps<typeof ChevronDownIcon>): React.ReactElement {
+ return <ChevronDownIcon className={cn('quill-select__icon', className)} {...props} />
+}
+
function SelectTrigger({
className,
size = 'default',
@@ -42,7 +46,7 @@ function SelectTrigger({
{...props}
>
{children}
- <SelectPrimitive.Icon render={<ChevronDownIcon className="quill-select__icon" />} />
+ <SelectPrimitive.Icon render={<SelectTriggerIcon />} />
</SelectPrimitive.Trigger>
)
}
@@ -170,5 +174,6 @@ export {
SelectScrollUpButton,
SelectSeparator,
SelectTrigger,
+ SelectTriggerIcon,
SelectValue,
}
diff --git a/products/error_tracking/frontend/components/Assignee/ErrorTrackingAssigneeSelectButton.tsx b/products/error_tracking/frontend/components/Assignee/ErrorTrackingAssigneeSelectButton.tsx
index d53da16579d0..6ec06dae2889 100644
--- a/products/error_tracking/frontend/components/Assignee/ErrorTrackingAssigneeSelectButton.tsx
+++ b/products/error_tracking/frontend/components/Assignee/ErrorTrackingAssigneeSelectButton.tsx
@@ -2,6 +2,8 @@ import { useActions, useValues } from 'kea'
import { LemonButton } from '@posthog/lemon-ui'
+import { Button, SelectTriggerIcon } from 'lib/ui/quill'
+
import { ErrorTrackingIssue } from '~/queries/schema/schema-general'
import { issueQueryOptionsLogic } from '../IssueQueryOptions/issueQueryOptionsLogic'
@@ -45,5 +47,19 @@ export function AssigneeFilter(): JSX.Element {
const { assignee } = useValues(issueQueryOptionsLogic)
const { setAssignee } = useActions(issueQueryOptionsLogic)
- return <ErrorTrackingAssigneeSelectButton assignee={assignee ?? null} onChange={(value) => setAssignee(value)} />
+ return (
+ <AssigneeSelect assignee={assignee ?? null} onChange={(value) => setAssignee(value)}>
+ {(displayAssignee, isOpen) => (
+ <Button variant="outline" size="default" aria-expanded={isOpen}>
+ <AssigneeIconDisplay assignee={displayAssignee} size="small" />
+ <AssigneeLabelDisplay
+ assignee={displayAssignee}
+ placeholder="Any assignee"
+ className="max-w-40 truncate"
+ />
+ <SelectTriggerIcon />
+ </Button>
+ )}
+ </AssigneeSelect>
+ )
}
diff --git a/products/error_tracking/frontend/components/Breakdowns/BreakdownsChart.tsx b/products/error_tracking/frontend/components/Breakdowns/BreakdownsChart.tsx
index 2faf1eef049f..93029eddf074 100644
--- a/products/error_tracking/frontend/components/Breakdowns/BreakdownsChart.tsx
+++ b/products/error_tracking/frontend/components/Breakdowns/BreakdownsChart.tsx
@@ -32,7 +32,7 @@ export function BreakdownsChart(): JSX.Element {
}
return (
- <div className="ErrorTracking__breakdowns p-3 flex-1 min-h-0">
+ <div className="ErrorTracking__breakdowns p-2 flex-1 min-h-0">
<Query query={query} context={{ ignoreActionsInSeriesLabels: true }} />
</div>
)
diff --git a/products/error_tracking/frontend/components/Breakdowns/BreakdownsSearchBar.tsx b/products/error_tracking/frontend/components/Breakdowns/BreakdownsSearchBar.tsx
index b050f892861e..cc05e929b83c 100644
--- a/products/error_tracking/frontend/components/Breakdowns/BreakdownsSearchBar.tsx
+++ b/products/error_tracking/frontend/components/Breakdowns/BreakdownsSearchBar.tsx
@@ -1,70 +1,80 @@
import { useActions, useValues } from 'kea'
import posthog from 'posthog-js'
+import { useMemo } from 'react'
-import { LemonButton } from '@posthog/lemon-ui'
-
-import { DateFilter } from 'lib/components/DateFilter/DateFilter'
import { PropertyKeyInfo } from 'lib/components/PropertyKeyInfo'
-import { TaxonomicFilter } from 'lib/components/TaxonomicFilter/TaxonomicFilter'
+import { TaxonomicFilterHeadless } from 'lib/components/TaxonomicFilter/headless'
+import { MenuFilterEntry } from 'lib/components/TaxonomicFilter/menu'
+import { TaxonomicFilterMenu } from 'lib/components/TaxonomicFilter/menu/TaxonomicFilterMenu'
import { TaxonomicFilterGroupType } from 'lib/components/TaxonomicFilter/types'
-import { Popover } from 'lib/lemon-ui/Popover'
-import { dateMapping } from 'lib/utils/dateFilters'
-import { TestAccountFilter } from 'scenes/insights/filters/TestAccountFilter'
+import { Button, SelectTriggerIcon } from 'lib/ui/quill'
+import { DateRangeButton } from '../DateRangeButton'
+import { InternalAccountsToggle } from '../InternalAccountsToggle'
import { breakdownFiltersLogic } from './breakdownFiltersLogic'
import { BreakdownsEvents, TAXONOMIC_GROUP_TYPES } from './consts'
export function BreakdownsSearchBar(): JSX.Element {
- const { dateRange, filterTestAccounts, filterOpen, breakdownProperty } = useValues(breakdownFiltersLogic)
- const { setDateRange, setFilterTestAccounts, setFilterOpen, setBreakdownProperty } =
- useActions(breakdownFiltersLogic)
+ const { dateRange, filterTestAccounts, breakdownProperty } = useValues(breakdownFiltersLogic)
+ const { setDateRange, setFilterTestAccounts, setBreakdownProperty } = useActions(breakdownFiltersLogic)
+
+ /*
+ * Synthetic entry for the current property. The menu reads `group.type` to route the
+ * initial open — with it set the picker lands straight on the searchable property list
+ * with this property highlighted, rather than the category menu. A full
+ * `TaxonomicFilterGroup` isn't needed; the orchestrator resolves the real one on commit.
+ */
+ const selected = useMemo<MenuFilterEntry>(
+ () =>
+ ({
+ item: { id: breakdownProperty, name: breakdownProperty },
+ group: {
+ type: TaxonomicFilterGroupType.EventProperties,
+ getName: (item: any) => item?.name,
+ getValue: (item: any) => item?.name ?? item?.id,
+ },
+ name: breakdownProperty,
+ }) as unknown as MenuFilterEntry,
+ [breakdownProperty]
+ )
return (
- <div className="flex items-center flex-wrap px-3 pt-3 gap-2">
- <DateFilter
- size="small"
- dateFrom={dateRange.date_from}
- dateTo={dateRange.date_to}
- fullWidth={false}
- dateOptions={dateMapping}
- onChange={(changedDateFrom, changedDateTo) => {
- setDateRange({ date_from: changedDateFrom, date_to: changedDateTo })
+ <div className="flex items-center flex-wrap px-2 py-2 gap-1">
+ <DateRangeButton dateRange={dateRange} onChange={setDateRange} />
+ <TaxonomicFilterHeadless.Root
+ className="contents"
+ bindRootProps={false}
+ groupType={TaxonomicFilterGroupType.EventProperties}
+ taxonomicGroupTypes={TAXONOMIC_GROUP_TYPES}
+ value={breakdownProperty}
+ onChange={(_, value) => {
+ if (value) {
+ setBreakdownProperty(String(value))
+ posthog.capture(BreakdownsEvents.PropertySelected, {
+ property: String(value),
+ })
+ }
}}
- allowedRollingDateOptions={['hours', 'days', 'weeks', 'months', 'years']}
- />
- <Popover
- overlay={
- <TaxonomicFilter
- value={breakdownProperty}
- onChange={(_, value) => {
- if (value) {
- setBreakdownProperty(String(value))
- posthog.capture(BreakdownsEvents.PropertySelected, {
- property: String(value),
- })
- }
- setFilterOpen(false)
- }}
- taxonomicGroupTypes={TAXONOMIC_GROUP_TYPES}
- />
- }
- visible={filterOpen}
- onClickOutside={() => setFilterOpen(false)}
>
- <LemonButton size="small" type="secondary" onClick={() => setFilterOpen(!filterOpen)}>
- <PropertyKeyInfo
- value={breakdownProperty}
- disablePopover
- type={TaxonomicFilterGroupType.EventProperties}
- />
- </LemonButton>
- </Popover>
- <div className="flex-1" />
- <div>
- <TestAccountFilter
- size="small"
- filters={{ filter_test_accounts: filterTestAccounts }}
- onChange={({ filter_test_accounts }) => setFilterTestAccounts(filter_test_accounts || false)}
+ <TaxonomicFilterMenu
+ selected={selected}
+ trigger={({ open }) => (
+ <Button variant="outline" size="default" aria-expanded={open} data-attr="breakdown-property">
+ <PropertyKeyInfo
+ value={breakdownProperty}
+ disablePopover
+ type={TaxonomicFilterGroupType.EventProperties}
+ />
+ <SelectTriggerIcon />
+ </Button>
+ )}
+ />
+ </TaxonomicFilterHeadless.Root>
+ <div className="ml-auto shrink-0">
+ <InternalAccountsToggle
+ filterTestAccounts={filterTestAccounts}
+ onChange={setFilterTestAccounts}
+ id="error-tracking-breakdowns-test-account-filter"
/>
</div>
</div>
diff --git a/products/error_tracking/frontend/components/Breakdowns/MiniBreakdowns.tsx b/products/error_tracking/frontend/components/Breakdowns/MiniBreakdowns.tsx
index 917e05d118a6..77245e06bd6e 100644
--- a/products/error_tracking/frontend/components/Breakdowns/MiniBreakdowns.tsx
+++ b/products/error_tracking/frontend/components/Breakdowns/MiniBreakdowns.tsx
@@ -3,7 +3,7 @@ import { BREAKDOWN_PRESETS } from './consts'
export function MiniBreakdowns(): JSX.Element {
return (
- <div className="px-3 mt-3">
+ <div className="px-2">
<div className="border rounded bg-surface-primary overflow-hidden divide-y">
{BREAKDOWN_PRESETS.map((item) => (
<BreakdownsTileButton key={item.property} item={item} />
diff --git a/products/error_tracking/frontend/components/Breakdowns/breakdownFiltersLogic.ts b/products/error_tracking/frontend/components/Breakdowns/breakdownFiltersLogic.ts
index 7594a2821f66..ff86372b63d2 100644
--- a/products/error_tracking/frontend/components/Breakdowns/breakdownFiltersLogic.ts
+++ b/products/error_tracking/frontend/components/Breakdowns/breakdownFiltersLogic.ts
@@ -13,7 +13,6 @@ import { DEFAULT_DATE_RANGE, DEFAULT_TEST_ACCOUNT } from './consts'
export interface breakdownFiltersLogicValues {
breakdownProperty: string
dateRange: DateRange
- filterOpen: boolean
filterTestAccounts: boolean
}
@@ -25,9 +24,6 @@ export interface breakdownFiltersLogicActions {
setDateRange: (dateRange: DateRange) => {
dateRange: DateRange
}
- setFilterOpen: (filterOpen: boolean) => {
- filterOpen: boolean
- }
setFilterTestAccounts: (filterTestAccounts: boolean) => {
filterTestAccounts: boolean
}
@@ -41,7 +37,6 @@ export const breakdownFiltersLogic = kea<breakdownFiltersLogicType>([
actions({
setDateRange: (dateRange: DateRange) => ({ dateRange }),
setFilterTestAccounts: (filterTestAccounts: boolean) => ({ filterTestAccounts }),
- setFilterOpen: (filterOpen: boolean) => ({ filterOpen }),
setBreakdownProperty: (breakdownProperty: string) => ({ breakdownProperty }),
}),
reducers({
@@ -66,12 +61,6 @@ export const breakdownFiltersLogic = kea<breakdownFiltersLogicType>([
setBreakdownProperty: (_, { breakdownProperty }) => breakdownProperty,
},
],
- filterOpen: [
- false as boolean,
- {
- setFilterOpen: (_, { filterOpen }) => filterOpen,
- },
- ],
}),
urlToAction(({ actions, values }) => {
diff --git a/products/error_tracking/frontend/components/DateRangeButton.tsx b/products/error_tracking/frontend/components/DateRangeButton.tsx
new file mode 100644
index 000000000000..3653c1f42faa
--- /dev/null
+++ b/products/error_tracking/frontend/components/DateRangeButton.tsx
@@ -0,0 +1,87 @@
+import { useValues } from 'kea'
+import { useState } from 'react'
+
+import { IconCalendar } from '@posthog/icons'
+
+import { dateRangeForSelection, selectionForDateRange } from 'lib/components/DateFilter/dateRangeSelection'
+import { QuillDateFilter } from 'lib/components/DateFilter/QuillDateFilter'
+import { Button, Popover, PopoverContent, PopoverTrigger, SelectTriggerIcon } from 'lib/ui/quill'
+import { dateFilterToText, dateMapping } from 'lib/utils/dateFilters'
+import { teamLogic } from 'scenes/teamLogic'
+
+import { DateRange } from '~/queries/schema/schema-general'
+import { DateMappingOption } from '~/types'
+
+export interface DateRangeButtonProps {
+ dateRange: DateRange
+ onChange: (dateRange: DateRange) => void
+ /** Options the trigger label resolves named ranges against. */
+ dateOptions?: DateMappingOption[]
+ /** Named preset chips to offer; omit for the picker's own defaults. */
+ namedChips?: string[]
+ className?: string
+ fullWidth?: boolean
+}
+
+/** Error tracking's date range control: a quill trigger over the quill date picker. */
+export const DateRangeButton = ({
+ dateRange,
+ onChange,
+ dateOptions = dateMapping,
+ namedChips,
+ className,
+ fullWidth = false,
+}: DateRangeButtonProps): JSX.Element => {
+ const { weekStartDay } = useValues(teamLogic)
+ const [open, setOpen] = useState(false)
+
+ const selection = selectionForDateRange(dateRange.date_from ?? '-7d', dateRange.date_to)
+ const triggerLabel =
+ dateFilterToText(dateRange.date_from, dateRange.date_to, 'Last 7 days', dateOptions, false) ?? 'Last 7 days'
+
+ const applySelection = (nextSelection: Parameters<typeof dateRangeForSelection>[0]): void =>
+ onChange({ ...dateRange, ...dateRangeForSelection(nextSelection) })
+
+ return (
+ <span className={className}>
+ <Popover open={open} onOpenChange={setOpen}>
+ <PopoverTrigger
+ render={
+ <Button
+ variant="outline"
+ size="default"
+ className={fullWidth ? 'w-full' : undefined}
+ data-attr="date-filter"
+ />
+ }
+ >
+ <IconCalendar />
+ <span className="text-nowrap">{triggerLabel}</span>
+ <SelectTriggerIcon />
+ </PopoverTrigger>
+ <PopoverContent
+ align="start"
+ collisionAvoidance={{ side: 'flip', align: 'shift', fallbackAxisSide: 'none' }}
+ className="w-auto overflow-hidden border-none p-0 shadow-none ring-0"
+ >
+ <QuillDateFilter
+ selection={selection}
+ onSelectionChange={(nextSelection) => {
+ applySelection(nextSelection)
+ // Rolling steppers keep the panel open so the count can be nudged.
+ if (nextSelection.kind !== 'rolling') {
+ setOpen(false)
+ }
+ }}
+ onApplyCustom={(nextSelection) => {
+ applySelection(nextSelection)
+ setOpen(false)
+ }}
+ namedChips={namedChips}
+ weekStartsOn={weekStartDay === 1 ? 1 : 0}
+ />
+ </PopoverContent>
+ </Popover>
+ </span>
+ )
+}
diff --git a/products/error_tracking/frontend/components/Indicators.test.tsx b/products/error_tracking/frontend/components/Indicators.test.tsx
new file mode 100644
index 000000000000..19bed04881fe
--- /dev/null
+++ b/products/error_tracking/frontend/components/Indicators.test.tsx
@@ -0,0 +1,16 @@
+import '@testing-library/jest-dom'
+
+import { render, screen } from '@testing-library/react'
+import userEvent from '@testing-library/user-event'
+
+import { StatusIndicator } from './Indicators'
+
+describe('StatusIndicator', () => {
+ it('shows the status explanation on hover when requested', async () => {
+ render(<StatusIndicator status="active" withTooltip />)
+
+ await userEvent.hover(screen.getByText('Active'))
+
+ expect(await screen.findByText('Ongoing issue')).toBeInTheDocument()
+ })
+})
diff --git a/products/error_tracking/frontend/components/Indicators.tsx b/products/error_tracking/frontend/components/Indicators.tsx
index dc59c5b7a692..494260ad1597 100644
--- a/products/error_tracking/frontend/components/Indicators.tsx
+++ b/products/error_tracking/frontend/components/Indicators.tsx
@@ -1,7 +1,9 @@
import clsx from 'clsx'
import React from 'react'
-import { LemonBadge, Tooltip, TooltipProps } from '@posthog/lemon-ui'
+import { LemonBadge, Tooltip as LemonTooltip, TooltipProps } from '@posthog/lemon-ui'
+
+import { Dot, Tooltip, TooltipContent, TooltipTrigger } from 'lib/ui/quill'
import { ErrorTrackingIssue } from '~/queries/schema/schema-general'
@@ -30,7 +32,7 @@ export const LabelIndicator = React.forwardRef<HTMLDivElement, LabelIndicatorPro
ref
): JSX.Element {
return (
- <Tooltip title={tooltip} placement={tooltipPlacement}>
+ <LemonTooltip title={tooltip} placement={tooltipPlacement}>
<div
ref={ref}
className={clsx('flex items-center', tooltip && 'cursor-help', className, sizeVariants[size])}
@@ -38,48 +40,61 @@ export const LabelIndicator = React.forwardRef<HTMLDivElement, LabelIndicatorPro
<LemonBadge status={intent} size="small" />
<div>{label}</div>
</div>
- </Tooltip>
+ </LemonTooltip>
)
})
-const STATUS_LABEL: Record<ErrorTrackingIssue['status'], string> = {
- active: 'Active',
- archived: 'Archived',
- resolved: 'Resolved',
- pending_release: 'Pending release',
- suppressed: 'Suppressed',
+interface IssueStatusConfig {
+ color: string
+ intentLabel: string
+ label: string
+ tooltip?: string
}
-const STATUS_INTENT: Record<ErrorTrackingIssue['status'], Intent> = {
- active: 'warning',
- archived: 'muted',
- resolved: 'success',
- pending_release: 'muted',
- suppressed: 'danger',
+export const ISSUE_STATUS_CONFIG: Record<IssueStatus, IssueStatusConfig> = {
+ active: {
+ color: '#f59e0b',
+ intentLabel: 'Mark issue as active again',
+ label: 'Active',
+ tooltip: 'Ongoing issue',
+ },
+ archived: {
+ color: '#6b7280',
+ intentLabel: 'Archive issue',
+ label: 'Archived',
+ },
+ pending_release: {
+ color: '#3b82f6',
+ intentLabel: 'Mark issue as resolved in next version (new occurrences will re-activate it)',
+ label: 'Pending release',
+ },
+ resolved: {
+ color: '#22c55e',
+ intentLabel: 'Mark issue as resolved (new occurrences will re-activate it)',
+ label: 'Resolved',
+ tooltip: 'Will become active again on next occurrence',
+ },
+ suppressed: {
+ color: '#ef4444',
+ intentLabel: 'Suppress issue (new occurrences will be ignored)',
+ label: 'Suppressed',
+ tooltip: 'New occurrences of this issue are ignored',
+ },
}
-export const STATUS_INTENT_LABEL: Record<ErrorTrackingIssue['status'], string> = {
- active: 'Mark issue as active again',
- suppressed: 'Suppress issue (new occurrences will be ignored)',
- archived: 'Archive issue',
- pending_release: 'Mark issue as resolved in next version (new occurrences will re-activate it)',
- resolved: 'Mark issue as resolved (new occurrences will re-activate it)',
-}
-
-const STATUS_TOOLTIP: Record<ErrorTrackingIssue['status'], string | undefined> = {
- suppressed: 'New occurrences of this issue are ignored',
- active: 'Ongoing issue',
- archived: undefined,
- resolved: 'Will become active again on next occurrence',
- pending_release: undefined,
-}
+export const IssueStatusDot = ({ status, className }: { status: IssueStatus; className?: string }): JSX.Element => (
+ <Dot
+ className={clsx('!border-0 !p-0 [&_[data-slot=dot-inner]]:!bg-[var(--error-tracking-status-color)]', className)}
+ style={{ '--error-tracking-status-color': ISSUE_STATUS_CONFIG[status].color } as React.CSSProperties}
+ />
+)
interface StatusIndicatorProps {
status: IssueStatus
intent?: boolean
size?: 'xsmall' | 'small' | 'medium' | 'large'
/** Whether to show a tooltip explaining each status. If just `true`, tooltip placement defaults to `top`. */
- withTooltip?: boolean | TooltipProps['placement']
+ withTooltip?: boolean | NonNullable<React.ComponentProps<typeof TooltipContent>['side']>
className?: string
}
@@ -87,15 +102,23 @@ export const StatusIndicator = React.forwardRef<HTMLDivElement, StatusIndicatorP
{ status, size = 'small', intent = false, className, withTooltip },
ref
): JSX.Element {
+ const config = ISSUE_STATUS_CONFIG[status]
+ const tooltip = withTooltip ? config.tooltip : undefined
+ const content = (
+ <div ref={ref} className={clsx('flex items-center', className, sizeVariants[size])}>
+ <IssueStatusDot status={status} />
+ <div>{intent ? config.intentLabel : config.label}</div>
+ </div>
+ )
+
+ if (!tooltip) {
+ return content
+ }
+
return (
- <LabelIndicator
- intent={STATUS_INTENT[status]}
- size={size}
- label={intent ? STATUS_INTENT_LABEL[status] : STATUS_LABEL[status]}
- tooltip={withTooltip ? STATUS_TOOLTIP[status] : undefined}
- tooltipPlacement={withTooltip ? (typeof withTooltip === 'string' ? withTooltip : 'top') : undefined}
- className={className}
- ref={ref}
- />
+ <Tooltip>
+ <TooltipTrigger render={content} />
+ <TooltipContent side={typeof withTooltip === 'string' ? withTooltip : 'top'}>{tooltip}</TooltipContent>
+ </Tooltip>
)
})
diff --git a/products/error_tracking/frontend/components/InternalAccountsToggle.tsx b/products/error_tracking/frontend/components/InternalAccountsToggle.tsx
new file mode 100644
index 000000000000..efc52369b08f
--- /dev/null
+++ b/products/error_tracking/frontend/components/InternalAccountsToggle.tsx
@@ -0,0 +1,84 @@
+import { useActions, useValues } from 'kea'
+
+import { IconGear } from '@posthog/icons'
+
+import { LinkPrimitive } from 'lib/lemon-ui/Link'
+import {
+ Button,
+ ButtonGroup,
+ ButtonGroupText,
+ buttonVariants,
+ cn,
+ Label,
+ Switch,
+ Tooltip,
+ TooltipContent,
+ TooltipTrigger,
+} from 'lib/ui/quill'
+import { filterTestAccountsDefaultsLogic } from 'scenes/settings/environment/filterTestAccountDefaultsLogic'
+import { teamLogic } from 'scenes/teamLogic'
+import { urls } from 'scenes/urls'
+
+export interface InternalAccountsToggleProps {
+ filterTestAccounts: boolean
+ onChange: (filterTestAccounts: boolean) => void
+ /** Ties the label to the switch. Override when two instances can render on one page. */
+ id?: string
+}
+
+/** Error tracking's internal-user exclusion toggle, with a shortcut to configure the filters. */
+export const InternalAccountsToggle = ({
+ filterTestAccounts,
+ onChange,
+ id = 'error-tracking-test-account-filter',
+}: InternalAccountsToggleProps): JSX.Element => {
+ const { currentTeam } = useValues(teamLogic)
+ const { setLocalDefault } = useActions(filterTestAccountsDefaultsLogic)
+ const hasFilters = (currentTeam?.test_account_filters || []).length > 0
+ const disabledReason = hasFilters ? undefined : "You haven't set any internal and test filters"
+
+ return (
+ <ButtonGroup className="shrink-0" title={disabledReason}>
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <Button
+ variant="outline"
+ size="icon"
+ render={
+ <LinkPrimitive
+ to={urls.settings('environment-customization', 'internal-user-filtering')}
+ />
+ }
+ aria-label="Configure internal user filters"
+ />
+ }
+ >
+ <IconGear />
+ </TooltipTrigger>
+ <TooltipContent>Configure internal user filters</TooltipContent>
+ </Tooltip>
+ {/*
+ * ButtonGroupText ships no frame, so this segment borrows the outline button's own
+ * variant classes rather than re-deriving its border and fill, which is how the two
+ * segments stay identical. It isn't a button, so the pointer cursor is dropped.
+ */}
+ <ButtonGroupText className={cn(buttonVariants({ variant: 'outline', size: 'default' }), 'cursor-default')}>
+ <Label htmlFor={id} className="whitespace-nowrap">
+ Exclude internal users
+ </Label>
+ <Switch
+ id={id}
+ size="default"
+ checked={hasFilters && filterTestAccounts}
+ disabled={!hasFilters}
+ onCheckedChange={(checked) => {
+ onChange(checked)
+ setLocalDefault(checked)
+ }}
+ aria-label="Exclude internal users"
+ />
+ </ButtonGroupText>
+ </ButtonGroup>
+ )
+}
diff --git a/products/error_tracking/frontend/components/IssueActions/IssueActions.tsx b/products/error_tracking/frontend/components/IssueActions/IssueActions.tsx
index 08daf13da6cf..9543984e1461 100644
--- a/products/error_tracking/frontend/components/IssueActions/IssueActions.tsx
+++ b/products/error_tracking/frontend/components/IssueActions/IssueActions.tsx
@@ -1,8 +1,19 @@
import { useActions, useValues } from 'kea'
-import { LemonButton, LemonDialog, LemonSelect } from '@posthog/lemon-ui'
+import { LemonDialog } from '@posthog/lemon-ui'
import { useHogfetti } from 'lib/components/Hogfetti/Hogfetti'
+import {
+ Button,
+ Select,
+ SelectContent,
+ SelectItem,
+ SelectTrigger,
+ SelectValue,
+ Tooltip,
+ TooltipContent,
+ TooltipTrigger,
+} from 'lib/ui/quill'
import { newInternalTab } from 'lib/utils/newInternalTab'
import { urls } from 'scenes/urls'
@@ -74,36 +85,47 @@ export function IssueActions({ issues, selectedIds }: IssueActionsProps): JSX.El
let options: IssueStatus[] = ['active', 'resolved', 'suppressed']
+ const mergeButton = (
+ <Button
+ variant="outline"
+ disabled={!hasAtLeastTwoIssues}
+ onClick={() =>
+ LemonDialog.open({
+ title: 'Merge Issues',
+ content: `Are you sure you want to merge these ${selectedIds.length} issues?`,
+ primaryButton: {
+ children: 'Merge',
+ status: 'danger',
+ onClick: () => {
+ mergeIssues(selectedIds)
+ },
+ },
+ })
+ }
+ >
+ Merge
+ </Button>
+ )
+
return (
<div className="flex gap-x-2 justify-between">
<HogfettiComponent />
<div className="flex gap-x-2">
- <LemonButton type="secondary" size="small" onClick={openInNewTabs}>
+ <Button variant="outline" onClick={openInNewTabs}>
Open all
- </LemonButton>
- <LemonButton
- disabledReason={!hasAtLeastTwoIssues ? 'Select at least two issues to merge' : null}
- type="secondary"
- size="small"
- onClick={() =>
- LemonDialog.open({
- title: 'Merge Issues',
- content: `Are you sure you want to merge these ${selectedIds.length} issues?`,
- primaryButton: {
- children: 'Merge',
- status: 'danger',
- onClick: () => {
- mergeIssues(selectedIds)
- },
- },
- })
- }
- >
- Merge
- </LemonButton>
- <LemonSelect
- onChange={(value) => {
- if (value == currentStatus) {
+ </Button>
+ {hasAtLeastTwoIssues ? (
+ mergeButton
+ ) : (
+ <Tooltip>
+ <TooltipTrigger render={mergeButton} />
+ <TooltipContent>Select at least two issues to merge</TooltipContent>
+ </Tooltip>
+ )}
+ <Select
+ value={currentStatus === 'mixed' ? null : currentStatus}
+ onValueChange={(value) => {
+ if (!value || value === currentStatus) {
return
}
switch (value) {
@@ -121,30 +143,40 @@ export function IssueActions({ issues, selectedIds }: IssueActionsProps): JSX.El
break
}
}}
- value={currentStatus == 'mixed' ? null : currentStatus}
- placeholder="Mark as"
- options={options.map((key) => ({
- value: key,
- label: <StatusIndicator status={key} size="small" className="w-full" withTooltip="right" />,
- }))}
- size="small"
- />
+ >
+ <SelectTrigger>
+ <SelectValue>
+ {currentStatus && currentStatus !== 'mixed' ? (
+ <StatusIndicator status={currentStatus} size="xsmall" className="w-full" />
+ ) : (
+ 'Mark as'
+ )}
+ </SelectValue>
+ </SelectTrigger>
+ <SelectContent align="start" alignItemWithTrigger={false}>
+ {options.map((status) => (
+ <SelectItem key={status} value={status}>
+ <StatusIndicator status={status} size="xsmall" className="w-full" withTooltip="right" />
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
<AssigneeSelect assignee={null} onChange={(assignee) => assignIssues(selectedIds, assignee)}>
{(displayAssignee) => (
- <LemonButton type="secondary" size="small">
+ <Button variant="outline">
<AssigneeLabelDisplay assignee={displayAssignee} placeholder="Assign" />
- </LemonButton>
+ </Button>
)}
</AssigneeSelect>
{issues.some((issue) => selectedIds.includes(issue.id) && issue.assignee != null) && (
- <LemonButton type="secondary" size="small" onClick={() => assignIssues(selectedIds, null)}>
+ <Button variant="outline" onClick={() => assignIssues(selectedIds, null)}>
Unassign
- </LemonButton>
+ </Button>
)}
</div>
- <LemonButton type="secondary" size="small" onClick={excludeSelectedIssues}>
+ <Button variant="outline" onClick={excludeSelectedIssues}>
Hide from search
- </LemonButton>
+ </Button>
</div>
)
}
diff --git a/products/error_tracking/frontend/components/IssueFilters/DateRange.test.tsx b/products/error_tracking/frontend/components/IssueFilters/DateRange.test.tsx
new file mode 100644
index 000000000000..054e1f9f3273
--- /dev/null
+++ b/products/error_tracking/frontend/components/IssueFilters/DateRange.test.tsx
@@ -0,0 +1,51 @@
+import '@testing-library/jest-dom'
+
+import { cleanup, render, screen } from '@testing-library/react'
+import userEvent from '@testing-library/user-event'
+import { BindLogic, Provider } from 'kea'
+
+import { useMocks } from '~/mocks/jest'
+import { initKeaTests } from '~/test/init'
+
+import { DateRangeFilter } from './DateRange'
+import { issueFiltersLogic } from './issueFiltersLogic'
+
+const LOGIC_KEY = 'test'
+
+describe('DateRangeFilter', () => {
+ beforeEach(() => {
+ useMocks({
+ get: {
+ '/api/environments/:team_id/quick_filters/': { results: [] },
+ },
+ })
+ initKeaTests()
+ })
+
+ afterEach(() => {
+ cleanup()
+ })
+
+ it('updates the issue date range from the Quill filter', async () => {
+ const logic = issueFiltersLogic({ logicKey: LOGIC_KEY })
+ logic.mount()
+
+ render(
+ <Provider>
+ <BindLogic logic={issueFiltersLogic} props={{ logicKey: LOGIC_KEY }}>
+ <DateRangeFilter />
+ </BindLogic>
+ </Provider>
+ )
+
+ await userEvent.click(screen.getByText('Last 7 days'))
+
+ expect(document.querySelector('[data-attr="quill-date-filter"]')).toBeInTheDocument()
+
+ await userEvent.click(await screen.findByText('30d'))
+
+ expect(logic.values.dateRange).toEqual({ date_from: '-30d', date_to: null })
+
+ logic.unmount()
+ })
+})
diff --git a/products/error_tracking/frontend/components/IssueFilters/DateRange.tsx b/products/error_tracking/frontend/components/IssueFilters/DateRange.tsx
index 6fc9a5b27fd2..3a6ecb23f9b3 100644
--- a/products/error_tracking/frontend/components/IssueFilters/DateRange.tsx
+++ b/products/error_tracking/frontend/components/IssueFilters/DateRange.tsx
@@ -1,37 +1,33 @@
import { useActions, useValues } from 'kea'
-import { DateFilter } from 'lib/components/DateFilter/DateFilter'
-import { cn } from 'lib/utils/css-classes'
import { dateMapping } from 'lib/utils/dateFilters'
+import { DateRangeButton } from '../DateRangeButton'
import { issueFiltersLogic } from './issueFiltersLogic'
-const errorTrackingDateOptions = dateMapping.filter((dm) => !['Yesterday', 'All time', 'Today'].includes(dm.key))
+const ERROR_TRACKING_NAMED_CHIPS = ['Last week', 'Last month', 'This week', 'This month', 'This year']
+const ERROR_TRACKING_DATE_OPTIONS = dateMapping.filter(
+ (option) => !['Yesterday', 'All time', 'Today'].includes(option.key)
+)
export const DateRangeFilter = ({
className,
fullWidth = false,
- size = 'small',
}: {
className?: string
fullWidth?: boolean
- size?: 'xsmall' | 'small' | 'medium' | 'large'
}): JSX.Element => {
const { dateRange } = useValues(issueFiltersLogic)
const { setDateRange } = useActions(issueFiltersLogic)
+
return (
- <span className={cn('rounded bg-surface-primary', className)}>
- <DateFilter
- size={size}
- dateFrom={dateRange.date_from}
- dateTo={dateRange.date_to}
- fullWidth={fullWidth}
- dateOptions={errorTrackingDateOptions}
- onChange={(changedDateFrom, changedDateTo) =>
- setDateRange({ date_from: changedDateFrom, date_to: changedDateTo })
- }
- allowedRollingDateOptions={['hours', 'days', 'weeks', 'months', 'years']}
- />
- </span>
+ <DateRangeButton
+ dateRange={dateRange}
+ onChange={setDateRange}
+ dateOptions={ERROR_TRACKING_DATE_OPTIONS}
+ namedChips={ERROR_TRACKING_NAMED_CHIPS}
+ className={className}
+ fullWidth={fullWidth}
+ />
)
}
diff --git a/products/error_tracking/frontend/components/IssueFilters/FilterGroup.test.tsx b/products/error_tracking/frontend/components/IssueFilters/FilterGroup.test.tsx
index ceebe6985836..49df703d8714 100644
--- a/products/error_tracking/frontend/components/IssueFilters/FilterGroup.test.tsx
+++ b/products/error_tracking/frontend/components/IssueFilters/FilterGroup.test.tsx
@@ -42,6 +42,7 @@ describe('FilterGroup', () => {
useMocks({
get: {
'/api/environments/:team_id/quick_filters/': { results: [] },
+ '/api/projects/:team_id/surveys/question_labels/': { labels: [] },
},
})
initKeaTests()
@@ -76,4 +77,51 @@ describe('FilterGroup', () => {
logic.unmount()
})
+
+ it('renders active filters below the filter picker', () => {
+ const logic = issueFiltersLogic({ logicKey: LOGIC_KEY })
+ logic.mount()
+ logic.actions.setFilterGroup({
+ type: FilterLogicalOperator.And,
+ values: [{ type: FilterLogicalOperator.And, values: [firefoxFilter] }],
+ })
+
+ render(
+ <Provider>
+ <BindLogic logic={issueFiltersLogic} props={{ logicKey: LOGIC_KEY }}>
+ <FilterGroup />
+ </BindLogic>
+ </Provider>
+ )
+
+ const filterPickerButton = screen.getByText('Add filter')
+ const activeFilters = screen.getByTestId('error-tracking-active-filters')
+
+ expect(filterPickerButton).not.toContainElement(activeFilters)
+ expect(
+ filterPickerButton.compareDocumentPosition(activeFilters) & Node.DOCUMENT_POSITION_FOLLOWING
+ ).toBeTruthy()
+
+ logic.unmount()
+ })
+
+ it('opens the filter picker directly to the main category', async () => {
+ const logic = issueFiltersLogic({ logicKey: LOGIC_KEY })
+ logic.mount()
+
+ render(
+ <Provider>
+ <BindLogic logic={issueFiltersLogic} props={{ logicKey: LOGIC_KEY }}>
+ <FilterGroup />
+ </BindLogic>
+ </Provider>
+ )
+
+ await userEvent.click(screen.getByText('Add filter'))
+
+ expect(await screen.findByText('Choose filter')).toBeInTheDocument()
+ expect(screen.queryByText('New filter…')).not.toBeInTheDocument()
+
+ logic.unmount()
+ })
})
diff --git a/products/error_tracking/frontend/components/IssueFilters/FilterGroup.tsx b/products/error_tracking/frontend/components/IssueFilters/FilterGroup.tsx
index 9640302de202..33252932105d 100644
--- a/products/error_tracking/frontend/components/IssueFilters/FilterGroup.tsx
+++ b/products/error_tracking/frontend/components/IssueFilters/FilterGroup.tsx
@@ -1,29 +1,32 @@
-import { BindLogic, useActions, useValues } from 'kea'
-import { useRef, useState } from 'react'
-import { useDebouncedCallback } from 'use-debounce'
+import { useActions, useValues } from 'kea'
+import { useState } from 'react'
-import { LemonDropdown, LemonSegmentedButton } from '@posthog/lemon-ui'
+import { IconFilter } from '@posthog/icons'
-import { InfiniteSelectResults } from 'lib/components/TaxonomicFilter/InfiniteSelectResults'
-import { TaxonomicFilterSearchInput } from 'lib/components/TaxonomicFilter/TaxonomicFilter'
-import { taxonomicFilterLogic } from 'lib/components/TaxonomicFilter/taxonomicFilterLogic'
-import { TaxonomicFilterGroupType, TaxonomicFilterLogicProps } from 'lib/components/TaxonomicFilter/types'
+import { TaxonomicFilterHeadless } from 'lib/components/TaxonomicFilter/headless'
+import { TaxonomicFilterMenu } from 'lib/components/TaxonomicFilter/menu/TaxonomicFilterMenu'
+import { TaxonomicFilterGroupType } from 'lib/components/TaxonomicFilter/types'
import UniversalFilters from 'lib/components/UniversalFilters/UniversalFilters'
import { universalFiltersLogic } from 'lib/components/UniversalFilters/universalFiltersLogic'
import { isUniversalGroupFilterLike } from 'lib/components/UniversalFilters/utils'
import { useOnMountEffect } from 'lib/hooks/useOnMountEffect'
+import { Button, ToggleGroup, ToggleGroupItem } from 'lib/ui/quill'
import { FilterLogicalOperator, PropertyFilterType, UniversalFiltersGroup, UniversalFiltersGroupValue } from '~/types'
import { TAXONOMIC_FILTER_LOGIC_KEY, TAXONOMIC_GROUP_TYPES } from './consts'
import { issueFiltersLogic } from './issueFiltersLogic'
+const ERROR_TRACKING_EVENT_NAMES = ['$exception']
+
export const FilterGroup = ({
taxonomicGroupTypes = TAXONOMIC_GROUP_TYPES,
excludeFilterTypes,
+ activeFiltersInline = false,
}: {
taxonomicGroupTypes?: TaxonomicFilterGroupType[]
excludeFilterTypes?: PropertyFilterType[]
+ activeFiltersInline?: boolean
} = {}): JSX.Element => {
const { filterGroup } = useValues(issueFiltersLogic)
const { setFilterGroup } = useActions(issueFiltersLogic)
@@ -41,81 +44,87 @@ export const FilterGroup = ({
taxonomicGroupTypes={taxonomicGroupTypes}
onChange={(group) => setFilterGroup({ type: FilterLogicalOperator.And, values: [group] })}
>
- <UniversalSearch taxonomicGroupTypes={taxonomicGroupTypes} />
+ <FilterControls taxonomicGroupTypes={taxonomicGroupTypes} activeFiltersInline={activeFiltersInline} />
</UniversalFilters>
)
}
-const UniversalSearch = ({
+const FilterControls = ({
taxonomicGroupTypes = TAXONOMIC_GROUP_TYPES,
+ nested = false,
+ activeFiltersInline = false,
}: {
taxonomicGroupTypes?: TaxonomicFilterGroupType[]
+ nested?: boolean
+ activeFiltersInline?: boolean
}): JSX.Element => {
- const [visible, setVisible] = useState<boolean>(false)
- const { searchQuery } = useValues(issueFiltersLogic)
- const { setSearchQuery } = useActions(issueFiltersLogic)
- const { addGroupFilter } = useActions(universalFiltersLogic)
-
- const searchInputRef = useRef<HTMLInputElement | null>(null)
- const floatingRef = useRef<HTMLDivElement | null>(null)
+ const filterRow = (
+ <div className={`relative flex shrink-0 items-center ${activeFiltersInline ? 'gap-2' : 'gap-1'}`}>
+ {nested ? <FilterOperatorToggle /> : null}
+ <FilterPicker taxonomicGroupTypes={taxonomicGroupTypes} />
+ {nested ? null : <FilterOperatorToggle />}
+ </div>
+ )
- const onClose = (): void => {
- searchInputRef.current?.blur()
- setVisible(false)
+ if (nested) {
+ return (
+ <div className="flex w-full min-w-0 flex-col gap-1">
+ {filterRow}
+ <UniversalFilterGroup taxonomicGroupTypes={taxonomicGroupTypes} className="flex flex-wrap gap-1" />
+ </div>
+ )
}
- const taxonomicFilterLogicProps: TaxonomicFilterLogicProps = {
- taxonomicFilterLogicKey: TAXONOMIC_FILTER_LOGIC_KEY,
- taxonomicGroupTypes,
- onChange: (taxonomicGroup, value, item) => {
- searchInputRef.current?.blur()
- setVisible(false)
- setSearchQuery('')
- addGroupFilter(taxonomicGroup, value, item)
- },
- onEnter: onClose,
- autoSelectItem: false,
- initialSearchQuery: searchQuery,
- excludedProperties: { [TaxonomicFilterGroupType.ErrorTrackingIssues]: ['assignee'] },
- }
+ return (
+ <>
+ {filterRow}
+ <UniversalFilterGroup
+ taxonomicGroupTypes={taxonomicGroupTypes}
+ className={
+ activeFiltersInline
+ ? 'flex flex-1 flex-wrap items-center gap-2'
+ : 'order-last flex w-full flex-wrap items-center gap-1'
+ }
+ dataAttr="error-tracking-active-filters"
+ />
+ </>
+ )
+}
- const onChange = useDebouncedCallback((value: string) => setSearchQuery(value), 250)
+const FilterPicker = ({ taxonomicGroupTypes }: { taxonomicGroupTypes: TaxonomicFilterGroupType[] }): JSX.Element => {
+ const { addGroupFilter } = useActions(universalFiltersLogic)
+ const [openRequest, setOpenRequest] = useState(0)
return (
- <BindLogic logic={taxonomicFilterLogic} props={taxonomicFilterLogicProps}>
- <div className="flex w-full min-w-0 items-center gap-1">
- <FilterOperatorToggle />
- <div className="min-w-0 flex-1">
- <LemonDropdown
- overlay={
- <div className="w-[400px] md:w-[600px]">
- <InfiniteSelectResults
- focusInput={() => searchInputRef.current?.focus()}
- taxonomicFilterLogicProps={taxonomicFilterLogicProps}
- popupAnchorElement={floatingRef.current}
- />
- </div>
- }
- visible={visible}
- closeOnClickInside={false}
- floatingRef={floatingRef}
- onClickOutside={() => onClose()}
+ <TaxonomicFilterHeadless.Root
+ className="contents"
+ bindRootProps={false}
+ groupType={taxonomicGroupTypes[0] ?? TaxonomicFilterGroupType.ErrorTrackingProperties}
+ taxonomicGroupTypes={taxonomicGroupTypes}
+ eventNames={ERROR_TRACKING_EVENT_NAMES}
+ onChange={(group, value, item) => addGroupFilter(group, value, item)}
+ >
+ <TaxonomicFilterMenu
+ key={openRequest}
+ defaultOpen={openRequest > 0}
+ defaultOpenState="combobox"
+ trigger={({ open }) => (
+ <Button
+ variant="outline"
+ size="default"
+ aria-expanded={open}
+ onClick={() => {
+ if (!open) {
+ setOpenRequest((request) => request + 1)
+ }
+ }}
>
- <TaxonomicFilterSearchInput
- prefix={<UniversalFilterGroup taxonomicGroupTypes={taxonomicGroupTypes} />}
- onClick={() => setVisible(true)}
- searchInputRef={searchInputRef}
- onClose={() => onClose()}
- onChange={onChange}
- size="small"
- autoFocus={false}
- fullWidth
- placeholder="Add a filter or search..."
- />
- </LemonDropdown>
- </div>
- </div>
- </BindLogic>
+ <IconFilter />
+ Add filter
+ </Button>
+ )}
+ />
+ </TaxonomicFilterHeadless.Root>
)
}
@@ -142,46 +151,67 @@ const FilterOperatorToggle = (): JSX.Element | null => {
}
return (
- <div className="shrink-0">
- <LemonSegmentedButton
- value={filterGroup.type}
- onChange={(type) => setGroupType(type)}
- options={FILTER_LOGICAL_OPERATOR_OPTIONS}
- size="xsmall"
- />
- </div>
+ <ToggleGroup
+ variant="outline"
+ size="default"
+ className="shrink-0"
+ value={[filterGroup.type]}
+ onValueChange={([type]) => {
+ if (type === FilterLogicalOperator.And || type === FilterLogicalOperator.Or) {
+ setGroupType(type)
+ }
+ }}
+ >
+ {FILTER_LOGICAL_OPERATOR_OPTIONS.map((option) => (
+ <ToggleGroupItem key={option.value} value={option.value} title={option.tooltip}>
+ {option.label}
+ </ToggleGroupItem>
+ ))}
+ </ToggleGroup>
)
}
const UniversalFilterGroup = ({
taxonomicGroupTypes = TAXONOMIC_GROUP_TYPES,
+ className,
+ dataAttr,
}: {
taxonomicGroupTypes?: TaxonomicFilterGroupType[]
-}): JSX.Element => {
+ className?: string
+ dataAttr?: string
+}): JSX.Element | null => {
const { filterGroup } = useValues(universalFiltersLogic)
const { replaceGroupValue, removeGroupValue } = useActions(universalFiltersLogic)
const [allowInitiallyOpen, setAllowInitiallyOpen] = useState<boolean>(false)
useOnMountEffect(() => setAllowInitiallyOpen(true))
- return (
- <>
- {filterGroup.values.map((filterOrGroup: UniversalFiltersGroupValue, index: number) => {
- return isUniversalGroupFilterLike(filterOrGroup) ? (
- <UniversalFilters.Group index={index} key={index} group={filterOrGroup}>
- <UniversalSearch taxonomicGroupTypes={taxonomicGroupTypes} />
- </UniversalFilters.Group>
- ) : (
- <UniversalFilters.Value
- key={index}
- index={index}
- filter={filterOrGroup}
- onRemove={() => removeGroupValue(index)}
- onChange={(value) => replaceGroupValue(index, value)}
- initiallyOpen={allowInitiallyOpen && filterOrGroup.type != PropertyFilterType.HogQL}
- />
- )
- })}
- </>
+ if (filterGroup.values.length === 0) {
+ return null
+ }
+
+ const values = filterGroup.values.map((filterOrGroup: UniversalFiltersGroupValue, index: number) => {
+ return isUniversalGroupFilterLike(filterOrGroup) ? (
+ <UniversalFilters.Group index={index} key={index} group={filterOrGroup}>
+ <FilterControls taxonomicGroupTypes={taxonomicGroupTypes} nested />
+ </UniversalFilters.Group>
+ ) : (
+ <UniversalFilters.Value
+ key={index}
+ index={index}
+ filter={filterOrGroup}
+ onRemove={() => removeGroupValue(index)}
+ onChange={(value) => replaceGroupValue(index, value)}
+ initiallyOpen={allowInitiallyOpen && filterOrGroup.type != PropertyFilterType.HogQL}
+ />
+ )
+ })
+
+ return className ? (
+ <div className={className} data-attr={dataAttr}>
+ {values}
+ </div>
+ ) : (
+ <>{values}</>
)
}
diff --git a/products/error_tracking/frontend/components/IssueFilters/InternalAccounts.tsx b/products/error_tracking/frontend/components/IssueFilters/InternalAccounts.tsx
index 8ddfaf1e0a2c..6be3d2205de3 100644
--- a/products/error_tracking/frontend/components/IssueFilters/InternalAccounts.tsx
+++ b/products/error_tracking/frontend/components/IssueFilters/InternalAccounts.tsx
@@ -1,20 +1,11 @@
import { useActions, useValues } from 'kea'
-import { TestAccountFilter } from 'scenes/insights/filters/TestAccountFilter'
-
+import { InternalAccountsToggle } from '../InternalAccountsToggle'
import { issueFiltersLogic } from './issueFiltersLogic'
export const InternalAccountsFilter = (): JSX.Element => {
const { filterTestAccounts } = useValues(issueFiltersLogic)
const { setFilterTestAccounts } = useActions(issueFiltersLogic)
- return (
- <div>
- <TestAccountFilter
- size="small"
- filters={{ filter_test_accounts: filterTestAccounts }}
- onChange={({ filter_test_accounts }) => setFilterTestAccounts(filter_test_accounts || false)}
- />
- </div>
- )
+ return <InternalAccountsToggle filterTestAccounts={filterTestAccounts} onChange={setFilterTestAccounts} />
}
diff --git a/products/error_tracking/frontend/components/IssueFilters/QuickFilters.tsx b/products/error_tracking/frontend/components/IssueFilters/QuickFilters.tsx
new file mode 100644
index 000000000000..a5d1d8ec6a5a
--- /dev/null
+++ b/products/error_tracking/frontend/components/IssueFilters/QuickFilters.tsx
@@ -0,0 +1,112 @@
+import { useActions, useValues } from 'kea'
+import { useMemo } from 'react'
+
+import { IconGear } from '@posthog/icons'
+
+import {
+ QuickFiltersModal,
+ quickFiltersLogic,
+ quickFiltersModalLogic,
+ quickFiltersSectionLogic,
+} from 'lib/components/QuickFilters'
+import {
+ Button,
+ Select,
+ SelectContent,
+ SelectItem,
+ SelectTrigger,
+ SelectValue,
+ Tooltip,
+ TooltipContent,
+ TooltipTrigger,
+} from 'lib/ui/quill'
+
+import { QuickFilterContext } from '~/queries/schema/schema-general'
+import { QuickFilter, QuickFilterOption } from '~/types'
+
+import { ERROR_TRACKING_SCENE_LOGIC_KEY } from '../../scenes/ErrorTrackingScene/errorTrackingSceneLogic'
+
+const ANY_OPTION = '__any__'
+
+const QuickFilterSelect = ({ filter }: { filter: QuickFilter }): JSX.Element => {
+ const { selectedQuickFilters } = useValues(
+ quickFiltersSectionLogic({
+ context: QuickFilterContext.ErrorTrackingIssueFilters,
+ logicKey: ERROR_TRACKING_SCENE_LOGIC_KEY,
+ })
+ )
+ const { setQuickFilterValue, clearQuickFilter } = useActions(
+ quickFiltersSectionLogic({
+ context: QuickFilterContext.ErrorTrackingIssueFilters,
+ logicKey: ERROR_TRACKING_SCENE_LOGIC_KEY,
+ })
+ )
+ const selectedOptionId = selectedQuickFilters[filter.id]?.optionId ?? ANY_OPTION
+ const items = useMemo(
+ () => [
+ { value: ANY_OPTION, label: `Any ${filter.name.toLowerCase()}` },
+ ...filter.options.map((option) => ({ value: option.id, label: option.label })),
+ ],
+ [filter.name, filter.options]
+ )
+
+ return (
+ <Select
+ items={items}
+ value={selectedOptionId}
+ onValueChange={(selectedId) => {
+ if (selectedId === ANY_OPTION) {
+ clearQuickFilter(filter.id)
+ return
+ }
+
+ const selectedOption = filter.options.find((option: QuickFilterOption) => option.id === selectedId)
+ if (selectedOption) {
+ setQuickFilterValue(filter.id, filter.property_name, selectedOption)
+ }
+ }}
+ >
+ <SelectTrigger size="default">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent align="start" alignItemWithTrigger={false}>
+ {items.map((item) => (
+ <SelectItem key={item.value} value={item.value}>
+ {item.label}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ )
+}
+
+export const ErrorTrackingQuickFilters = (): JSX.Element => {
+ const context = QuickFilterContext.ErrorTrackingIssueFilters
+ const { quickFilters } = useValues(quickFiltersLogic({ context }))
+ const modalProps = { context }
+ const { openModal } = useActions(quickFiltersModalLogic(modalProps))
+
+ return (
+ <>
+ {quickFilters.map((filter: QuickFilter) => (
+ <QuickFilterSelect key={filter.id} filter={filter} />
+ ))}
+ <QuickFiltersModal {...modalProps} />
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <Button
+ variant="outline"
+ size={quickFilters.length === 0 ? 'default' : 'icon'}
+ onClick={openModal}
+ />
+ }
+ >
+ <IconGear />
+ {quickFilters.length === 0 ? 'Configure quick filters' : null}
+ </TooltipTrigger>
+ <TooltipContent>Configure quick filters</TooltipContent>
+ </Tooltip>
+ </>
+ )
+}
diff --git a/products/error_tracking/frontend/components/IssueFilters/Search.tsx b/products/error_tracking/frontend/components/IssueFilters/Search.tsx
new file mode 100644
index 000000000000..287babc276ad
--- /dev/null
+++ b/products/error_tracking/frontend/components/IssueFilters/Search.tsx
@@ -0,0 +1,37 @@
+import { useActions, useValues } from 'kea'
+import type { ChangeEvent } from 'react'
+
+import { IconSearch } from '@posthog/icons'
+
+import { InputGroup, InputGroupAddon, InputGroupInput } from 'lib/ui/quill'
+import { cn } from 'lib/utils/css-classes'
+
+import { issueFiltersLogic } from './issueFiltersLogic'
+
+export function IssueSearchInput({
+ className,
+ placeholder = 'Search issues',
+}: {
+ className?: string
+ placeholder?: string
+}): JSX.Element {
+ const { searchInput } = useValues(issueFiltersLogic)
+ const { setSearchInput } = useActions(issueFiltersLogic)
+
+ return (
+ <div className={cn('w-64 max-w-full shrink-0', className)}>
+ <InputGroup className="h-7">
+ <InputGroupAddon>
+ <IconSearch />
+ </InputGroupAddon>
+ <InputGroupInput
+ type="search"
+ value={searchInput}
+ onChange={(event: ChangeEvent<HTMLInputElement>) => setSearchInput(event.target.value)}
+ placeholder={placeholder}
+ aria-label={placeholder}
+ />
+ </InputGroup>
+ </div>
+ )
+}
diff --git a/products/error_tracking/frontend/components/IssueFilters/Status.tsx b/products/error_tracking/frontend/components/IssueFilters/Status.tsx
index 5f3c385eb96a..db5e498a05ae 100644
--- a/products/error_tracking/frontend/components/IssueFilters/Status.tsx
+++ b/products/error_tracking/frontend/components/IssueFilters/Status.tsx
@@ -2,9 +2,11 @@ import { useActions, useValues } from 'kea'
import { LemonSelect, type LemonSelectProps } from '@posthog/lemon-ui'
+import { Dot, Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from 'lib/ui/quill'
+
import { ErrorTrackingIssue } from '~/queries/schema/schema-general'
-import { LabelIndicator, StatusIndicator } from '../Indicators'
+import { ISSUE_STATUS_CONFIG, IssueStatusDot, LabelIndicator, StatusIndicator } from '../Indicators'
import { issueQueryOptionsLogic } from '../IssueQueryOptions/issueQueryOptionsLogic'
export type ErrorTrackingStatusSelectValue = ErrorTrackingIssue['status'] | 'all'
@@ -18,6 +20,24 @@ function statusOptionLabel(key: ErrorTrackingStatusSelectValue): JSX.Element {
return <StatusIndicator status={key} size="small" withTooltip="right" />
}
+function quillStatusOptionLabel(key: ErrorTrackingStatusSelectValue): JSX.Element {
+ if (key === 'all') {
+ return (
+ <span className="flex items-center gap-2">
+ <Dot className="!border-0 !p-0" />
+ All
+ </span>
+ )
+ }
+
+ return (
+ <span className="flex items-center gap-2">
+ <IssueStatusDot status={key} />
+ {ISSUE_STATUS_CONFIG[key].label}
+ </span>
+ )
+}
+
type ErrorTrackingStatusSelectProps = {
value: ErrorTrackingStatusSelectValue
onChange: (value: ErrorTrackingStatusSelectValue) => void
@@ -56,6 +76,20 @@ export function ErrorTrackingStatusSelect({
export const StatusFilter = (): JSX.Element => {
const { status } = useValues(issueQueryOptionsLogic)
const { setStatus } = useActions(issueQueryOptionsLogic)
+ const value = status ?? 'active'
- return <ErrorTrackingStatusSelect value={status ?? 'active'} onChange={(value) => setStatus(value)} />
+ return (
+ <Select value={value} onValueChange={(nextValue) => setStatus(nextValue as ErrorTrackingStatusSelectValue)}>
+ <SelectTrigger size="default">
+ <SelectValue>{quillStatusOptionLabel(value)}</SelectValue>
+ </SelectTrigger>
+ <SelectContent align="start" alignItemWithTrigger={false}>
+ {STATUS_OPTIONS.map((option) => (
+ <SelectItem key={option} value={option}>
+ {quillStatusOptionLabel(option)}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ )
}
diff --git a/products/error_tracking/frontend/components/IssueFilters/index.tsx b/products/error_tracking/frontend/components/IssueFilters/index.tsx
index 268975278d47..1d0ecb51daa1 100644
--- a/products/error_tracking/frontend/components/IssueFilters/index.tsx
+++ b/products/error_tracking/frontend/components/IssueFilters/index.tsx
@@ -3,6 +3,7 @@ import { DateRangeFilter } from './DateRange'
import { FilterGroup } from './FilterGroup'
import { InternalAccountsFilter } from './InternalAccounts'
import { ErrorFiltersRoot } from './Root'
+import { IssueSearchInput } from './Search'
import { StatusFilter } from './Status'
export const ErrorFilters = {
@@ -12,4 +13,5 @@ export const ErrorFilters = {
Assignee: AssigneeFilter,
Status: StatusFilter,
InternalAccounts: InternalAccountsFilter,
+ Search: IssueSearchInput,
}
diff --git a/products/error_tracking/frontend/components/IssueFilters/issueFiltersLogic.test.ts b/products/error_tracking/frontend/components/IssueFilters/issueFiltersLogic.test.ts
index 3bb2413f3865..56f995bc77f0 100644
--- a/products/error_tracking/frontend/components/IssueFilters/issueFiltersLogic.test.ts
+++ b/products/error_tracking/frontend/components/IssueFilters/issueFiltersLogic.test.ts
@@ -56,6 +56,18 @@ describe('issueFiltersLogic', () => {
quickFiltersSection.unmount()
})
+ it('debounces issue search and stays synchronized with the committed query', async () => {
+ await expectLogic(logic, () => {
+ logic.actions.setSearchInput('timeout')
+ })
+ .toDispatchActions(['setSearchInput', 'setSearchQuery'])
+ .toFinishAllListeners()
+ .toMatchValues({ searchInput: 'timeout', searchQuery: 'timeout' })
+
+ logic.actions.setSearchQuery('from-url')
+ expect(logic.values.searchInput).toBe('from-url')
+ })
+
describe('mergedFilterGroup', () => {
const propA: EventPropertyFilter = {
type: PropertyFilterType.Event,
diff --git a/products/error_tracking/frontend/components/IssueFilters/issueFiltersLogic.ts b/products/error_tracking/frontend/components/IssueFilters/issueFiltersLogic.ts
index bd8db2e2edaf..cedb49af0fda 100644
--- a/products/error_tracking/frontend/components/IssueFilters/issueFiltersLogic.ts
+++ b/products/error_tracking/frontend/components/IssueFilters/issueFiltersLogic.ts
@@ -2,7 +2,6 @@ import { deepEqual as equal } from 'fast-equals'
import { MakeLogicType, actions, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
import { SelectedQuickFilter, quickFiltersSectionLogic } from 'lib/components/QuickFilters'
-import { taxonomicFilterLogic } from 'lib/components/TaxonomicFilter/taxonomicFilterLogic'
import { isUniversalGroupFilterLike } from 'lib/components/UniversalFilters/utils'
import { Params } from 'scenes/sceneTypes'
@@ -10,7 +9,6 @@ import { DateRange, QuickFilterContext } from '~/queries/schema/schema-general'
import { FilterLogicalOperator, PropertyFilterType, UniversalFiltersGroup } from '~/types'
import { updateSearchParams } from '../../utils'
-import { TAXONOMIC_FILTER_LOGIC_KEY, TAXONOMIC_GROUP_TYPES } from './consts'
export const DEFAULT_DATE_RANGE = { date_from: '-7d', date_to: null }
export const DEFAULT_FILTER_GROUP = {
@@ -31,14 +29,12 @@ export interface issueFiltersLogicValues {
filterGroup: UniversalFiltersGroup
filterTestAccounts: boolean
mergedFilterGroup: UniversalFiltersGroup
+ searchInput: string
searchQuery: string
}
// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
export interface issueFiltersLogicActions {
- setTaxonomicSearchQuery: (searchQuery: string) => {
- searchQuery: string
- } // taxonomicFilterLogic
setDateRange: (dateRange: DateRange) => {
dateRange: DateRange
}
@@ -48,6 +44,9 @@ export interface issueFiltersLogicActions {
setFilterTestAccounts: (filterTestAccounts: boolean) => {
filterTestAccounts: boolean
}
+ setSearchInput: (searchInput: string) => {
+ searchInput: string
+ }
setSearchQuery: (searchQuery: string) => {
searchQuery: string
}
@@ -84,17 +83,11 @@ export const issueFiltersLogic = kea<issueFiltersLogicType>([
}),
['selectedQuickFilters'],
],
- actions: [
- taxonomicFilterLogic({
- taxonomicFilterLogicKey: TAXONOMIC_FILTER_LOGIC_KEY,
- taxonomicGroupTypes: TAXONOMIC_GROUP_TYPES,
- }),
- ['setSearchQuery as setTaxonomicSearchQuery'],
- ],
})),
actions({
setDateRange: (dateRange: DateRange) => ({ dateRange }),
+ setSearchInput: (searchInput: string) => ({ searchInput }),
setSearchQuery: (searchQuery: string) => ({ searchQuery }),
setFilterGroup: (filterGroup: UniversalFiltersGroup) => ({ filterGroup }),
setFilterTestAccounts: (filterTestAccounts: boolean) => ({ filterTestAccounts }),
@@ -119,6 +112,13 @@ export const issueFiltersLogic = kea<issueFiltersLogicType>([
setFilterTestAccounts: (_, { filterTestAccounts }) => filterTestAccounts,
},
],
+ searchInput: [
+ DEFAULT_SEARCH_QUERY as string,
+ {
+ setSearchInput: (_, { searchInput }) => searchInput,
+ setSearchQuery: (_, { searchQuery }) => searchQuery,
+ },
+ ],
searchQuery: [
DEFAULT_SEARCH_QUERY as string,
{
@@ -126,6 +126,14 @@ export const issueFiltersLogic = kea<issueFiltersLogicType>([
},
],
}),
+ listeners(({ actions, values }) => ({
+ setSearchInput: async ({ searchInput }, breakpoint) => {
+ await breakpoint(250)
+ if (values.searchInput === searchInput) {
+ actions.setSearchQuery(searchInput)
+ }
+ },
+ })),
selectors({
mergedFilterGroup: [
(s) => [s.filterGroup, s.selectedQuickFilters],
@@ -182,11 +190,6 @@ export const issueFiltersLogic = kea<issueFiltersLogicType>([
},
],
}),
- listeners(({ actions }) => ({
- setSearchQuery: async ({ searchQuery }) => {
- actions.setTaxonomicSearchQuery(searchQuery)
- },
- })),
])
export interface IssueFilterValues {
diff --git a/products/error_tracking/frontend/components/IssueQueryOptions/IssueQueryOptions.test.tsx b/products/error_tracking/frontend/components/IssueQueryOptions/IssueQueryOptions.test.tsx
new file mode 100644
index 000000000000..96004cd7d54f
--- /dev/null
+++ b/products/error_tracking/frontend/components/IssueQueryOptions/IssueQueryOptions.test.tsx
@@ -0,0 +1,37 @@
+import '@testing-library/jest-dom'
+
+import { cleanup, render, screen } from '@testing-library/react'
+import userEvent from '@testing-library/user-event'
+import { BindLogic, Provider } from 'kea'
+
+import { initKeaTests } from '~/test/init'
+
+import { IssueSortButton } from './IssueQueryOptions'
+import { issueQueryOptionsLogic } from './issueQueryOptionsLogic'
+
+const LOGIC_KEY = 'test'
+
+describe('IssueSortButton', () => {
+ beforeEach(() => {
+ initKeaTests()
+ })
+
+ afterEach(() => {
+ cleanup()
+ })
+
+ it('opens the grouped sort options', async () => {
+ render(
+ <Provider>
+ <BindLogic logic={issueQueryOptionsLogic} props={{ logicKey: LOGIC_KEY }}>
+ <IssueSortButton />
+ </BindLogic>
+ </Provider>
+ )
+
+ await userEvent.click(screen.getByText('Last seen'))
+
+ expect(await screen.findByText('Sort by')).toBeInTheDocument()
+ expect(screen.getByText('Direction')).toBeInTheDocument()
+ })
+})
diff --git a/products/error_tracking/frontend/components/IssueQueryOptions/IssueQueryOptions.tsx b/products/error_tracking/frontend/components/IssueQueryOptions/IssueQueryOptions.tsx
index b7cbe73d0ab4..1987efc30bc8 100644
--- a/products/error_tracking/frontend/components/IssueQueryOptions/IssueQueryOptions.tsx
+++ b/products/error_tracking/frontend/components/IssueQueryOptions/IssueQueryOptions.tsx
@@ -1,90 +1,102 @@
import { useActions, useValues } from 'kea'
-import { IconRefresh } from '@posthog/icons'
-import { LemonButton, LemonMenu, LemonSelect, Spinner } from '@posthog/lemon-ui'
+import { IconRefresh, IconSort } from '@posthog/icons'
+
+import {
+ Button,
+ DropdownMenu,
+ DropdownMenuContent,
+ DropdownMenuLabel,
+ DropdownMenuRadioGroup,
+ DropdownMenuRadioItem,
+ DropdownMenuSeparator,
+ DropdownMenuTrigger,
+ SelectTriggerIcon,
+ Spinner,
+ Tooltip,
+ TooltipContent,
+ TooltipTrigger,
+} from 'lib/ui/quill'
import { issuesDataNodeLogic } from '../../logics/issuesDataNodeLogic'
import { ORDER_BY_OPTIONS, issueQueryOptionsLogic } from './issueQueryOptionsLogic'
+import type { ErrorTrackingQueryOrderBy, ErrorTrackingQueryOrderDirection } from './issueQueryOptionsLogic'
-export const IssueQueryOptions = (): JSX.Element => {
+export const IssueSortButton = (): JSX.Element => {
const { orderBy, orderDirection } = useValues(issueQueryOptionsLogic)
const { setOrderBy, setOrderDirection } = useActions(issueQueryOptionsLogic)
return (
- <span className="flex items-center justify-between gap-2 self-end">
- <Reload />
- <div className="flex items-center gap-2 self-end">
- <div className="flex items-center gap-1">
- <span>Sort by:</span>
-
- <LemonMenu
- items={[
- {
- label: ORDER_BY_OPTIONS['last_seen'],
- onClick: () => setOrderBy('last_seen'),
- },
- {
- label: ORDER_BY_OPTIONS['first_seen'],
- onClick: () => setOrderBy('first_seen'),
- },
- {
- label: ORDER_BY_OPTIONS['occurrences'],
- onClick: () => setOrderBy('occurrences'),
- },
- {
- label: ORDER_BY_OPTIONS['users'],
- onClick: () => setOrderBy('users'),
- },
- {
- label: ORDER_BY_OPTIONS['sessions'],
- onClick: () => setOrderBy('sessions'),
- },
- ]}
+ <DropdownMenu>
+ <DropdownMenuTrigger
+ render={
+ <Button
+ variant="outline"
+ size="default"
+ aria-label={`Sort by ${ORDER_BY_OPTIONS[orderBy]}, ${orderDirection === 'DESC' ? 'descending' : 'ascending'}`}
>
- <LemonButton size="small" type="secondary">
- {ORDER_BY_OPTIONS[orderBy]}
- </LemonButton>
- </LemonMenu>
-
- <LemonSelect
- onChange={setOrderDirection}
- value={orderDirection}
- options={[
- {
- value: 'DESC',
- label: 'Descending',
- },
- {
- value: 'ASC',
- label: 'Ascending',
- },
- ]}
- size="small"
- />
- </div>
- </div>
- </span>
+ <IconSort className={orderDirection === 'ASC' ? 'rotate-180' : undefined} />
+ {ORDER_BY_OPTIONS[orderBy]}
+ <SelectTriggerIcon />
+ </Button>
+ }
+ />
+ <DropdownMenuContent align="end" className="min-w-48">
+ <DropdownMenuRadioGroup
+ value={orderBy}
+ onValueChange={(value) => setOrderBy(value as ErrorTrackingQueryOrderBy)}
+ >
+ <DropdownMenuLabel>Sort by</DropdownMenuLabel>
+ {Object.entries(ORDER_BY_OPTIONS).map(([value, label]) => (
+ <DropdownMenuRadioItem key={value} value={value} closeOnClick={false}>
+ {label}
+ </DropdownMenuRadioItem>
+ ))}
+ </DropdownMenuRadioGroup>
+ <DropdownMenuSeparator />
+ <DropdownMenuRadioGroup
+ value={orderDirection}
+ onValueChange={(value) => setOrderDirection(value as ErrorTrackingQueryOrderDirection)}
+ >
+ <DropdownMenuLabel>Direction</DropdownMenuLabel>
+ <DropdownMenuRadioItem value="DESC" closeOnClick={false}>
+ Descending
+ </DropdownMenuRadioItem>
+ <DropdownMenuRadioItem value="ASC" closeOnClick={false}>
+ Ascending
+ </DropdownMenuRadioItem>
+ </DropdownMenuRadioGroup>
+ </DropdownMenuContent>
+ </DropdownMenu>
)
}
-const Reload = (): JSX.Element => {
+export const ReloadIssuesButton = (): JSX.Element => {
const { responseLoading } = useValues(issuesDataNodeLogic)
const { reloadData, cancelQuery } = useActions(issuesDataNodeLogic)
return (
- <LemonButton
- type="secondary"
- size="small"
- onClick={() => {
- if (responseLoading) {
- cancelQuery()
- } else {
- reloadData()
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <Button
+ variant="outline"
+ size="icon"
+ aria-label={responseLoading ? 'Cancel issue reload' : 'Reload issues'}
+ aria-busy={responseLoading}
+ onClick={() => {
+ if (responseLoading) {
+ cancelQuery()
+ } else {
+ reloadData()
+ }
+ }}
+ />
}
- }}
- icon={responseLoading ? <Spinner textColored /> : <IconRefresh />}
- >
- {responseLoading ? 'Cancel' : 'Reload'}
- </LemonButton>
+ >
+ {responseLoading ? <Spinner /> : <IconRefresh />}
+ </TooltipTrigger>
+ <TooltipContent>{responseLoading ? 'Cancel issue reload' : 'Reload issues'}</TooltipContent>
+ </Tooltip>
)
}
diff --git a/products/error_tracking/frontend/components/IssueStatusButton.tsx b/products/error_tracking/frontend/components/IssueStatusButton.tsx
index 806e81a8eba5..628b1474afce 100644
--- a/products/error_tracking/frontend/components/IssueStatusButton.tsx
+++ b/products/error_tracking/frontend/components/IssueStatusButton.tsx
@@ -4,7 +4,7 @@ import { useHogfetti } from 'lib/components/Hogfetti/Hogfetti'
import { ErrorTrackingIssue } from '~/queries/schema/schema-general'
-import { STATUS_INTENT_LABEL } from './Indicators'
+import { ISSUE_STATUS_CONFIG } from './Indicators'
export const IssueStatusButton = ({
status,
@@ -30,7 +30,11 @@ export const IssueStatusButton = ({
<LemonButton
type="primary"
onClick={handleResolve}
- tooltip={status === 'active' ? STATUS_INTENT_LABEL['resolved'] : STATUS_INTENT_LABEL['active']}
+ tooltip={
+ status === 'active'
+ ? ISSUE_STATUS_CONFIG.resolved.intentLabel
+ : ISSUE_STATUS_CONFIG.active.intentLabel
+ }
data-attr="error-tracking-resolve"
sideAction={
status === 'active'
@@ -43,7 +47,7 @@ export const IssueStatusButton = ({
{
label: 'Suppress',
onClick: () => onChange('suppressed'),
- tooltip: STATUS_INTENT_LABEL['suppressed'],
+ tooltip: ISSUE_STATUS_CONFIG.suppressed.intentLabel,
},
]}
/>
diff --git a/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/ErrorTrackingIssueScene.scss b/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/ErrorTrackingIssueScene.scss
index 9fcc1dc36bd5..274fc0efed5e 100644
--- a/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/ErrorTrackingIssueScene.scss
+++ b/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/ErrorTrackingIssueScene.scss
@@ -1,6 +1,15 @@
.ErrorTrackingIssue {
+ .ErrorTrackingIssue__search .quill-input-group {
+ background-color: color-mix(in oklab, var(--muted) 30%, transparent);
+ border-color: color-mix(in oklab, var(--foreground) 10%, transparent);
+ }
+
// Needed for the NotFound state inside SessionRecordingPlayer
.NotFoundComponent {
margin: 0 auto;
}
}
+
+:is(.dark, [theme='dark']) .ErrorTrackingIssue .ErrorTrackingIssue__search .quill-input-group {
+ border-color: color-mix(in oklab, var(--foreground) 15%, transparent);
+}
diff --git a/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/ErrorTrackingIssueScene.tsx b/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/ErrorTrackingIssueScene.tsx
index 3aada1a2fc2c..c985cabecdac 100644
--- a/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/ErrorTrackingIssueScene.tsx
+++ b/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/ErrorTrackingIssueScene.tsx
@@ -5,8 +5,8 @@ import { BindLogic, useActions, useMountedLogic, useValues } from 'kea'
import posthog from 'posthog-js'
import { useEffect, useRef } from 'react'
-import { IconFilter, IconList, IconRewindPlay, IconSearch, IconX } from '@posthog/icons'
-import { LemonButton, LemonDivider } from '@posthog/lemon-ui'
+import { IconFilter, IconList, IconRefresh, IconRewindPlay, IconSearch, IconX } from '@posthog/icons'
+import { LemonButton } from '@posthog/lemon-ui'
import { Resizer } from 'lib/components/Resizer/Resizer'
import { ResizerLogicProps, resizerLogic } from 'lib/components/Resizer/resizerLogic'
@@ -17,6 +17,7 @@ import ViewRecordingsPlaylistButton from 'lib/components/ViewRecordingButton/Vie
import { useFeatureFlag } from 'lib/hooks/useFeatureFlag'
import { useWindowSize } from 'lib/hooks/useWindowSize'
import { IconRobot } from 'lib/lemon-ui/icons'
+import { Button, Separator, Tooltip, TooltipContent, TooltipTrigger } from 'lib/ui/quill'
import {
TabsPrimitive,
TabsPrimitiveContent,
@@ -39,6 +40,7 @@ import { BreakdownsChart } from '../../components/Breakdowns/BreakdownsChart'
import { BreakdownsSearchBar } from '../../components/Breakdowns/BreakdownsSearchBar'
import { MiniBreakdowns } from '../../components/Breakdowns/MiniBreakdowns'
import { miniBreakdownsLogic } from '../../components/Breakdowns/miniBreakdownsLogic'
+import { eventsSourceLogic } from '../../components/EventsTable/eventsSourceLogic'
import { EventsTable } from '../../components/EventsTable/EventsTable'
import { ExceptionCard } from '../../components/ExceptionCard'
import { StackTraceActions } from '../../components/ExceptionCard/Tabs/StackTraceTab/StackTraceActions'
@@ -390,19 +392,48 @@ const ExceptionsTab = (): JSX.Element => {
const { eventsQuery, eventsQueryKey, selectedEvent, issueFingerprints, issueFingerprintsLoading } =
useValues(errorTrackingIssueSceneLogic)
const { selectEvent } = useActions(errorTrackingIssueSceneLogic)
+ const eventsDataSource = eventsSourceLogic({ query: eventsQuery, queryKey: eventsQueryKey })
+ const { itemsLoading } = useValues(eventsDataSource)
+ const { loadData } = useActions(eventsDataSource)
return (
<div className="flex flex-col h-full min-h-0">
- <div className="px-2 py-3 shrink-0">
+ <div className="shrink-0 px-2 py-2">
<ErrorFilters.Root>
- <div className="flex gap-2 justify-between flex-wrap">
- <ErrorFilters.DateRange />
- <ErrorFilters.InternalAccounts />
+ <div className="flex w-full flex-col gap-1">
+ <div className="flex w-full flex-wrap items-center gap-1">
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <Button
+ variant="outline"
+ size="icon"
+ loading={itemsLoading}
+ aria-label="Reload exceptions"
+ onClick={() => loadData()}
+ />
+ }
+ >
+ <IconRefresh />
+ </TooltipTrigger>
+ <TooltipContent>Reload exceptions</TooltipContent>
+ </Tooltip>
+ <ErrorFilters.DateRange />
+ <div className="ml-auto shrink-0">
+ <ErrorFilters.InternalAccounts />
+ </div>
+ </div>
+ <div className="flex w-full flex-wrap items-center gap-1">
+ <ErrorFilters.Search
+ className="ErrorTrackingIssue__search w-auto min-w-40 flex-1 shrink"
+ placeholder="Search exceptions"
+ />
+ <ErrorFilters.FilterGroup />
+ </div>
</div>
- <ErrorFilters.FilterGroup />
</ErrorFilters.Root>
</div>
- <LemonDivider className="my-0 shrink-0" />
+ <Separator className="shrink-0" />
<Metadata className="flex flex-col flex-1 min-h-0">
{issueFingerprintsLoading ? (
<div className="text-muted text-sm px-2 py-3">Loading exceptions...</div>
diff --git a/products/error_tracking/frontend/scenes/ErrorTrackingScene/ErrorTrackingScene.tsx b/products/error_tracking/frontend/scenes/ErrorTrackingScene/ErrorTrackingScene.tsx
index dab996d82bd1..5c2b47fc52fa 100644
--- a/products/error_tracking/frontend/scenes/ErrorTrackingScene/ErrorTrackingScene.tsx
+++ b/products/error_tracking/frontend/scenes/ErrorTrackingScene/ErrorTrackingScene.tsx
@@ -32,7 +32,6 @@ import {
errorTrackingSceneLogic,
} from './errorTrackingSceneLogic'
import { ErrorTrackingInsights } from './tabs/insights/ErrorTrackingInsights'
-import { IssuesFilters } from './tabs/issues/IssuesFilters'
import { IssuesList } from './tabs/issues/IssuesList'
import { SourceMapsBanner } from './tabs/issues/SourceMapsBanner'
import { RecommendationsTab } from './tabs/recommendations/RecommendationsTab'
@@ -86,9 +85,6 @@ export function ErrorTrackingScene(): JSX.Element {
<ErrorTrackingIssueFilteringTool />
{hasSentExceptionEventLoading || hasSentExceptionEvent ? null : <IngestionStatusCheck />}
{hasSourceMapsBanner ? <SourceMapsBanner /> : null}
- <div className="border rounded bg-surface-primary p-2">
- <IssuesFilters />
- </div>
<IssuesList />
</ErrorTrackingSetupPrompt>
),
diff --git a/products/error_tracking/frontend/scenes/ErrorTrackingScene/tabs/insights/ChartCard.tsx b/products/error_tracking/frontend/scenes/ErrorTrackingScene/tabs/insights/ChartCard.tsx
index 533c6d667138..e174a82b481e 100644
--- a/products/error_tracking/frontend/scenes/ErrorTrackingScene/tabs/insights/ChartCard.tsx
+++ b/products/error_tracking/frontend/scenes/ErrorTrackingScene/tabs/insights/ChartCard.tsx
@@ -1,5 +1,7 @@
import { IconExternal } from '@posthog/icons'
-import { LemonButton } from '@posthog/lemon-ui'
+
+import { LinkPrimitive } from 'lib/lemon-ui/Link'
+import { Button, Tooltip, TooltipContent, TooltipTrigger } from 'lib/ui/quill'
import { Query } from '~/queries/Query/Query'
import { InsightVizNode, TrendsQuery } from '~/queries/schema/schema-general'
@@ -25,23 +27,30 @@ export function ChartCard({
}
return (
- <div className="border rounded-lg bg-surface-primary flex flex-col h-100">
- <div className="flex items-center justify-between px-4 pt-3 pb-1 shrink-0">
+ <div className="h-100 flex flex-col rounded-md border bg-surface-primary">
+ <div className="flex shrink-0 items-center justify-between p-4 pb-2">
<div>
<h3 className="font-semibold text-sm m-0">{title}</h3>
<p className="text-xs text-secondary m-0">{description}</p>
</div>
- <LemonButton
- size="xsmall"
- type="secondary"
- icon={<IconExternal />}
- to={insightNewUrl(query)}
- targetBlank
- >
- Open as insight
- </LemonButton>
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <Button
+ variant="default"
+ size="icon-sm"
+ nativeButton={false}
+ render={<LinkPrimitive to={insightNewUrl(query)} target="_blank" />}
+ aria-label="Open as insight"
+ />
+ }
+ >
+ <IconExternal />
+ </TooltipTrigger>
+ <TooltipContent>Open as insight</TooltipContent>
+ </Tooltip>
</div>
- <div className="ErrorTracking__insights flex-1 min-h-0 p-2">
+ <div className="ErrorTracking__insights min-h-0 flex-1 px-4 pt-2 pb-4">
<Query
query={query}
readOnly={true}
diff --git a/products/error_tracking/frontend/scenes/ErrorTrackingScene/tabs/insights/ErrorTrackingInsights.tsx b/products/error_tracking/frontend/scenes/ErrorTrackingScene/tabs/insights/ErrorTrackingInsights.tsx
index d2768e0546e8..0af2c19f7e5c 100644
--- a/products/error_tracking/frontend/scenes/ErrorTrackingScene/tabs/insights/ErrorTrackingInsights.tsx
+++ b/products/error_tracking/frontend/scenes/ErrorTrackingScene/tabs/insights/ErrorTrackingInsights.tsx
@@ -1,5 +1,7 @@
import { useValues } from 'kea'
+import { SceneStickyBar } from '~/layout/scenes/components/SceneStickyBar'
+
import { ChartCard } from './ChartCard'
import { errorTrackingInsightsLogic } from './errorTrackingInsightsLogic'
import { InsightsFilters } from './InsightsFilters'
@@ -9,31 +11,33 @@ export function ErrorTrackingInsights(): JSX.Element {
const { exceptionVolumeQuery, affectedUsersQuery, crashFreeSessionsQuery } = useValues(errorTrackingInsightsLogic)
return (
- <div className="space-y-4">
- <div className="border rounded bg-surface-primary p-2 space-y-2">
+ <div>
+ <SceneStickyBar className="-mt-4" showBorderBottom={false}>
<InsightsFilters />
- </div>
- <SummaryStats />
+ </SceneStickyBar>
+ <div className="space-y-4">
+ <SummaryStats />
- <div className="grid grid-cols-1 xl:grid-cols-2 gap-3">
- <ChartCard
- title="Exception volume"
- description="Exceptions per day"
- query={exceptionVolumeQuery}
- chartKey="exception_volume"
- />
- <ChartCard
- title="Affected users"
- description="Unique users experiencing exceptions"
- query={affectedUsersQuery}
- chartKey="affected_users"
- />
- <ChartCard
- title="Crash-free sessions"
- description="Percentage of sessions without any exceptions"
- query={crashFreeSessionsQuery}
- chartKey="crash_free_sessions"
- />
+ <div className="grid grid-cols-1 gap-4 xl:grid-cols-2">
+ <ChartCard
+ title="Exception volume"
+ description="Exceptions per day"
+ query={exceptionVolumeQuery}
+ chartKey="exception_volume"
+ />
+ <ChartCard
+ title="Affected users"
+ description="Unique users experiencing exceptions"
+ query={affectedUsersQuery}
+ chartKey="affected_users"
+ />
+ <ChartCard
+ title="Crash-free sessions"
+ description="Percentage of sessions without any exceptions"
+ query={crashFreeSessionsQuery}
+ chartKey="crash_free_sessions"
+ />
+ </div>
</div>
</div>
)
diff --git a/products/error_tracking/frontend/scenes/ErrorTrackingScene/tabs/insights/InsightsFilters.tsx b/products/error_tracking/frontend/scenes/ErrorTrackingScene/tabs/insights/InsightsFilters.tsx
index dc195221210e..5f7e4ec39498 100644
--- a/products/error_tracking/frontend/scenes/ErrorTrackingScene/tabs/insights/InsightsFilters.tsx
+++ b/products/error_tracking/frontend/scenes/ErrorTrackingScene/tabs/insights/InsightsFilters.tsx
@@ -1,14 +1,10 @@
-import { LemonDivider } from '@posthog/lemon-ui'
-
-import { QuickFiltersSection } from 'lib/components/QuickFilters/QuickFiltersSection'
import { TaxonomicFilterGroupType } from 'lib/components/TaxonomicFilter/types'
+import { Separator } from 'lib/ui/quill'
-import { QuickFilterContext } from '~/queries/schema/schema-general'
import { PropertyFilterType } from '~/types'
import { ErrorFilters } from 'products/error_tracking/frontend/components/IssueFilters'
-
-import { ERROR_TRACKING_SCENE_LOGIC_KEY } from '../../errorTrackingSceneLogic'
+import { ErrorTrackingQuickFilters } from 'products/error_tracking/frontend/components/IssueFilters/QuickFilters'
const INSIGHTS_TAXONOMIC_GROUP_TYPES = [
TaxonomicFilterGroupType.ErrorTrackingProperties,
@@ -21,22 +17,18 @@ const INSIGHTS_TAXONOMIC_GROUP_TYPES = [
export function InsightsFilters(): JSX.Element {
return (
<ErrorFilters.Root>
- <div className="flex gap-2 flex-wrap">
+ <div className="flex w-full flex-wrap items-center gap-2">
<ErrorFilters.DateRange />
- <LemonDivider vertical />
- <QuickFiltersSection
- context={QuickFilterContext.ErrorTrackingIssueFilters}
- logicKey={ERROR_TRACKING_SCENE_LOGIC_KEY}
+ <Separator orientation="vertical" className="h-6" />
+ <ErrorTrackingQuickFilters />
+ <ErrorFilters.FilterGroup
+ taxonomicGroupTypes={INSIGHTS_TAXONOMIC_GROUP_TYPES}
+ excludeFilterTypes={[PropertyFilterType.ErrorTrackingIssue]}
+ activeFiltersInline
/>
- </div>
- <div className="flex gap-2 items-start">
- <div className="flex-1">
- <ErrorFilters.FilterGroup
- taxonomicGroupTypes={INSIGHTS_TAXONOMIC_GROUP_TYPES}
- excludeFilterTypes={[PropertyFilterType.ErrorTrackingIssue]}
- />
+ <div className="ml-auto shrink-0">
+ <ErrorFilters.InternalAccounts />
</div>
- <ErrorFilters.InternalAccounts />
</div>
</ErrorFilters.Root>
)
diff --git a/products/error_tracking/frontend/scenes/ErrorTrackingScene/tabs/insights/SummaryStats.tsx b/products/error_tracking/frontend/scenes/ErrorTrackingScene/tabs/insights/SummaryStats.tsx
index 335c5ff04c76..e7c8e23a051d 100644
--- a/products/error_tracking/frontend/scenes/ErrorTrackingScene/tabs/insights/SummaryStats.tsx
+++ b/products/error_tracking/frontend/scenes/ErrorTrackingScene/tabs/insights/SummaryStats.tsx
@@ -18,9 +18,9 @@ export function SummaryStats(): JSX.Element {
]
return (
- <div className="grid grid-cols-2 xl:grid-cols-5 gap-4">
+ <div className="grid grid-cols-2 gap-4 xl:grid-cols-5">
{cards.map(({ label, value }) => (
- <div key={label} className="border rounded-lg bg-surface-primary p-4 flex flex-col gap-1">
+ <div key={label} className="flex flex-col gap-1 rounded-md border bg-surface-primary p-4">
<span className="text-xs text-secondary">{label}</span>
{summaryStatsLoading ? (
<LemonSkeleton className="h-8 w-20" />
diff --git a/products/error_tracking/frontend/scenes/ErrorTrackingScene/tabs/issues/IssuesFilters.tsx b/products/error_tracking/frontend/scenes/ErrorTrackingScene/tabs/issues/IssuesFilters.tsx
index 9a0ca9e1c2db..4f18341efd30 100644
--- a/products/error_tracking/frontend/scenes/ErrorTrackingScene/tabs/issues/IssuesFilters.tsx
+++ b/products/error_tracking/frontend/scenes/ErrorTrackingScene/tabs/issues/IssuesFilters.tsx
@@ -1,31 +1,36 @@
-import { LemonDivider } from '@posthog/lemon-ui'
-
-import { QuickFiltersSection } from 'lib/components/QuickFilters/QuickFiltersSection'
-
-import { QuickFilterContext } from '~/queries/schema/schema-general'
+import { Separator } from 'lib/ui/quill'
import { ErrorFilters } from 'products/error_tracking/frontend/components/IssueFilters'
-
-import { ERROR_TRACKING_SCENE_LOGIC_KEY } from '../../errorTrackingSceneLogic'
+import { ErrorTrackingQuickFilters } from 'products/error_tracking/frontend/components/IssueFilters/QuickFilters'
+import {
+ IssueSortButton,
+ ReloadIssuesButton,
+} from 'products/error_tracking/frontend/components/IssueQueryOptions/IssueQueryOptions'
export function IssuesFilters(): JSX.Element {
return (
<ErrorFilters.Root>
- <div className="flex gap-2 flex-wrap">
- <ErrorFilters.DateRange />
- <ErrorFilters.Status />
- <ErrorFilters.Assignee />
- <LemonDivider vertical />
- <QuickFiltersSection
- context={QuickFilterContext.ErrorTrackingIssueFilters}
- logicKey={ERROR_TRACKING_SCENE_LOGIC_KEY}
- />
- </div>
- <div className="flex gap-2 items-start">
- <div className="flex-1">
- <ErrorFilters.FilterGroup />
+ <div className="flex flex-col gap-2">
+ <div className="flex flex-wrap items-center gap-2">
+ <div className="flex shrink-0 items-center gap-2">
+ <ReloadIssuesButton />
+ <ErrorFilters.DateRange />
+ </div>
+ <ErrorFilters.Status />
+ <ErrorFilters.Assignee />
+ <Separator orientation="vertical" className="h-6" />
+ <ErrorTrackingQuickFilters />
+ <div className="ml-auto shrink-0">
+ <ErrorFilters.InternalAccounts />
+ </div>
+ </div>
+ <div className="flex w-full flex-wrap items-center gap-2">
+ <ErrorFilters.Search />
+ <ErrorFilters.FilterGroup activeFiltersInline />
+ <div className="ml-auto shrink-0">
+ <IssueSortButton />
+ </div>
</div>
- <ErrorFilters.InternalAccounts />
</div>
</ErrorFilters.Root>
)
diff --git a/products/error_tracking/frontend/scenes/ErrorTrackingScene/tabs/issues/IssuesList.tsx b/products/error_tracking/frontend/scenes/ErrorTrackingScene/tabs/issues/IssuesList.tsx
index 852c4a8af1e1..7bf6fffb6cee 100644
--- a/products/error_tracking/frontend/scenes/ErrorTrackingScene/tabs/issues/IssuesList.tsx
+++ b/products/error_tracking/frontend/scenes/ErrorTrackingScene/tabs/issues/IssuesList.tsx
@@ -19,7 +19,6 @@ import {
import { InsightLogicProps } from '~/types'
import { IssueActions } from 'products/error_tracking/frontend/components/IssueActions/IssueActions'
-import { IssueQueryOptions } from 'products/error_tracking/frontend/components/IssueQueryOptions/IssueQueryOptions'
import { IssueListTitleColumn, IssueListTitleHeader } from 'products/error_tracking/frontend/components/TableColumns'
import { errorTrackingVolumeSparklineLogic } from 'products/error_tracking/frontend/components/VolumeSparkline/errorTrackingVolumeSparklineLogic'
import {
@@ -34,6 +33,8 @@ import { issuesDataNodeLogic } from 'products/error_tracking/frontend/logics/iss
import { errorTrackingSceneLogic } from 'products/error_tracking/frontend/scenes/ErrorTrackingScene/errorTrackingSceneLogic'
import { ERROR_TRACKING_LISTING_RESOLUTION } from 'products/error_tracking/frontend/utils'
+import { IssuesFilters } from './IssuesFilters'
+
const VolumeColumn: QueryContextColumnComponent = (props) => {
const record = props.record as ErrorTrackingIssue
const sparklineKey = record.id ?? 'issue-unknown'
@@ -153,7 +154,8 @@ export function IssuesList(): JSX.Element {
logic={issuesDataNodeLogic}
props={{ key: insightVizDataNodeKey(insightProps), query: query.source }}
>
- <SceneStickyBar showBorderBottom={false}>
+ <SceneStickyBar className="-mt-4" showBorderBottom={false}>
+ <IssuesFilters />
<ListOptions />
</SceneStickyBar>
@@ -164,7 +166,7 @@ export function IssuesList(): JSX.Element {
)
}
-export const ListOptions = (): JSX.Element => {
+export const ListOptions = (): JSX.Element | null => {
const { selectedIssueIds } = useValues(bulkSelectLogic)
const { results } = useValues(issuesDataNodeLogic)
@@ -172,5 +174,5 @@ export const ListOptions = (): JSX.Element => {
return <IssueActions issues={results} selectedIds={selectedIssueIds} />
}
- return <IssueQueryOptions />
+ return null
}