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): polish issue metadata controls (#89070)

Hugues Pouillot468826caa018
diff --git a/frontend/snapshots.yml b/frontend/snapshots.yml
index 9e61cfdf36ea..ff1ea999b7ee 100644
--- a/frontend/snapshots.yml
+++ b/frontend/snapshots.yml
@@ -2209,9 +2209,9 @@ snapshots:
errortracking-stacktracedisplay--generic-display-with-stacktrace--light:
hash: v1.k794b7964.ae0c08aecfbd10220b331128d6ec8e198a41797b1395076232f7e424e24dd755.UfVTetDNuBKEM3LJ-ZYHVKo-1UDriQklgCRKleHSyMg
errortracking-volumesparkline--compact-issues-list--dark:
- hash: v1.k794b7964.317541200525e015cdb55bc324a804b1e0bb7cc3b893f196e93e2874a46a1b2e.5LUEQXmO_kvqYkwYT-oPy7ZxYQ4QoU7tKLRp9Of3duU
+ hash: v1.k794b7964.d298e4f6b95195df5bc3fcf4dfc727f58465f6109aec240bb074c52d0302bdbd.WrMIK-krojjiEg3RABvdT4H6V2lWToAR9S8sGdvQ2EA
errortracking-volumesparkline--compact-issues-list--light:
- hash: v1.k794b7964.24c7b32430b53240b2dd850722f89c410377ae29d1c89ba93bd860b581d787c1.bHZSqU3ooYQagaYxml8Rtj7ddEAekUWSvCyFshr-0mU
+ hash: v1.k794b7964.68a0eac3794d9ad0228500e60270f8e72623c6b00a9df894372df846c39a5d6a.3JQjCSNdXuE8b6DQmISqSjlL3FtB4Kpg_96AioA5-Rc
errortracking-volumesparkline--detailed-full-axis-with-events--dark:
hash: v1.k794b7964.96f32cb9588280eab1e9272fa66be3efc38aa4dfb5a80818f1d59ff1eded175d.Ver_BIatDcyCrBovUXL1yMLQsRYQ3kAq89yiRwAaXuw
errortracking-volumesparkline--detailed-full-axis-with-events--light:
@@ -6333,57 +6333,61 @@ snapshots:
scenes-app-error-project-unavailable--no-selectable-projects--light:
hash: v1.k794b7964.25cba9f347696eb78fc20a05e5f37e514e17b483c0e7f2cbc2a0ff581eef2b72.Z1uJTP8R_ATm8aciECP4ScSzcSTFpYd7VQI6kVswSMg
scenes-app-errortracking--group-page--dark:
- hash: v1.k794b7964.a09a2a5bf17e69e0681068b610130d21ce65ac0037db7f60527bec19a416f05f.ji1tqyiK8M8vjUevg_kMlxV7ZjZprSLSsrx6zwu39r4
+ hash: v1.k794b7964.c6e4938f5fea35b65ef57198ee2b0935151e55b3bfdc90f0d84fa4c416cf24a6.EGidst1m2mmQK0RVXKF46D2Yg-iPEGfk3k6VhE70drk
scenes-app-errortracking--group-page--light:
- hash: v1.k794b7964.f1b77106d680720fda3429c10fbe9a1e1995caaca802c537f743f14780e41576.6u7L6xYNzRw066qfx0w15wkLxE5XjgUv2KKUAgROjWs
+ hash: v1.k794b7964.75d53d79c39374e99a4018fe211dade321899ec8edaa5bb92d5afff7a705d0f2.vxzdYtLqp72E6zyL_oLfgerjFr1uIODxWLIEXQltsC0
scenes-app-errortracking--group-page-breakdown-loading--dark:
- hash: v1.k794b7964.905db5ee0a380bf49ce46663e5ba944da30555a59e5b30ad459faa07a75ba7fd.BC8aOud8jpikFflgjjp6HkL8xJ6wxD37RoyuP9YcL_w
+ hash: v1.k794b7964.7b8ecc575efdf8aba385bd7881cff5f4e33860211d9a378539471013b9e56928.M1LyscDdfnn8xPCctOYrUY8PdViD8D1UF4-XlnarXl8
scenes-app-errortracking--group-page-breakdown-loading--light:
- hash: v1.k794b7964.4e0f9baf66d9862363aa56b0fb5640baaa9e1def79a017d4363749bad336e40b.ueZa0D_FaOk4aN7tUMVwWmgOThr9XIJc12W0iK01a6Y
+ hash: v1.k794b7964.f4f450e6a3effb92cf07e8ed487968cf5a993a4fff653b082df4baf6239bfa9a.6wjM3R5L2LFDzdxnqtoNyHs90SoQiLZO5Hwg7AHM0To
scenes-app-errortracking--group-page-breakdown-modal--dark:
hash: v1.k794b7964.4df823170b24e0170171c6841ef0126f6ef042f5f28173958959aa7469704087.86hvk1n6TWtaIk85RAMaygZ2pVsU4EsT6XlmevrrHt8
scenes-app-errortracking--group-page-breakdown-modal--light:
- hash: v1.k794b7964.cdb93b62da6faf1e0f06917819a56a04c5d188aac2cf669c1fdc4cfc73ae8a98.6RLivUFUu42I6SypPnuTZoCIL5vbPtSZLsGcGr036is
+ hash: v1.k794b7964.9a9297a05f7941816c6c550209aeec5fb20164a13814579c6bc314f701b41557.mD1RcWwAz4INsXdw8PHyMo2in7ZlQpz0g4_PhT90nT4
scenes-app-errortracking--group-page-breakdown-modal-loading--dark:
hash: v1.k794b7964.e19707caf474d78777b1b88c8a03d4a6619d0a423d0db2553e24951161c266e6.EWf2MelREK7oDbF4-YW2sq5r9Cy6-gl5NNKxEwZx-GI
scenes-app-errortracking--group-page-breakdown-modal-loading--light:
- hash: v1.k794b7964.2a5809ecf92a1fcfe66c70345d60a90e205b4cb6a016a186a6269dfcc4f63bfa.QIvi7R5UJ2cHYGDdkJt-7KfevCSH2Yl0lnMQODvZfgs
+ hash: v1.k794b7964.73e4178244de167ed3c5ef90dcc1baf6fd2f10ef32f3a638425bbf3a4bad6812.7CZLkOg29DdfpM3WpoFiBQNnPelP45GkD5b2_hAtLzI
scenes-app-errortracking--group-page-capped-breakdown-panel--dark:
- hash: v1.k794b7964.dbc3c5fc98a15fa2f4e709a6a451cb769b28b935a306c764002f84dfa079bc22.MRahfxq0gyAUa23579zv69iW_QYRsTbijY6ccyZTpgw
+ hash: v1.k794b7964.73149a08bc86aeed0f7035e63291b791f594bc21f9cb5b2c3113a28df9b583fd.aqed0hwqxAOqhbqJyf1XsUQJrm1EWgsRR_TA_5zEZXM
scenes-app-errortracking--group-page-capped-breakdown-panel--light:
- hash: v1.k794b7964.ef5e3db90772e06510d061172fba490a85d5e1d0b30ff95fbfa5ed89271618eb.vBD2lchMSrNiW5DURoHY6nH1Xw61EABza6jjgHzEuYk
+ hash: v1.k794b7964.534d71be3bf672a2a67c518e57283c5ff953320fe80540a8ba597f5d3c848b9e.lMfERe8tqOU7Z3N8Ge1Eoim4cT-UDY1bwyqOLwqVA_8
scenes-app-errortracking--group-page-content-sized-breakdown-panel--dark:
- hash: v1.k794b7964.dbc3c5fc98a15fa2f4e709a6a451cb769b28b935a306c764002f84dfa079bc22.lMWQoUcDpgvSjCKBSBa-iynOamKeOdy8CdNejw1_bLY
+ hash: v1.k794b7964.73149a08bc86aeed0f7035e63291b791f594bc21f9cb5b2c3113a28df9b583fd.4cdL9XAG8Pqk_aeQ6mo7JCmY6gvuNuj9LwwXTcQplYs
scenes-app-errortracking--group-page-content-sized-breakdown-panel--light:
- hash: v1.k794b7964.ebc2a3c8426bb4d1adf7a50adfd82fb099cb04ff7039148c19eb100356115d23.t2UFVlDb_zF1J9uE2nJJ7WCDmxAnkLdBz00TIEnAwYo
+ hash: v1.k794b7964.875703867a34ca8ef534d6c6c0083f47da565f650fd5475bd954b933df9b813d.MM2q7MkAjCJzZI8BDQG5A9szR93XnQlIVyLhVqZPK7k
scenes-app-errortracking--group-page-empty-with-filter--dark:
- hash: v1.k794b7964.8af7a7f552f592c9bea2a3bf7bd687bace89246404cac7991973d2c760104f9d.DO0DLDoxcYidQZT32FkkgnuXCRQsmRuOUC3JR-TG8hI
+ hash: v1.k794b7964.8e36fecd9a06df63cf05577cb8df3ae58eff115c1ebbda30cf2382f49338a991.lQs73Chkihc4wJ9aOCxbJmt5nlS0YsbKHezRrHP8Abc
scenes-app-errortracking--group-page-empty-with-filter--light:
- hash: v1.k794b7964.50372c3554997af22c6286d29899ed2dee7286543f9854a24369c82594827b4f.hm-F4CK6jtHzTcU9SNds3hfdGHucHAvoKl2inMnQA-A
+ hash: v1.k794b7964.e5b37983bfb5ebd1df9d801c132a2b3840fbca7120dd64e574f13a436b0e4c14.U3vP6flK7gaevuDJUBudmBLKljjgeqz27m5ap9pCYGo
scenes-app-errortracking--group-page-fingerprint-map--dark:
- hash: v1.k794b7964.c2371b61c82d78840a898f65a5d5056500445f4f58ee5c66cecfba5b58332963.18BW2E8eIlCmRO_44KTj9DdGo4b-mKrYmVN71UR6cnU
+ hash: v1.k794b7964.0148ab63e2e6c320a023c16d1d065cc64228b6da1b3ead2ecd4fe4ce6fe41b5a.Zz-SJJ4PPB1B5VEYm2lOsTWVulLOWGFHVRrp7Hllq6c
scenes-app-errortracking--group-page-fingerprint-map--light:
- hash: v1.k794b7964.5bcc2549a82819bd73f1646bcdd8910827f6fb8777717db68f7fdbc0de541caa.R95WqcJG53O_E-3KT5vH0HFwL9Z94UQ_0tv15yiUFFA
+ hash: v1.k794b7964.031001b47424858ceced7f2766b08c8bf714a27388a8ea642d10fc8e916906ad.pMWQXh5gNwS06QUSowpKnLFs8hIp1eL-LhJ9o-Ndnnw
scenes-app-errortracking--group-page-loading--dark:
- hash: v1.k794b7964.211fa2dc218f0004b4f6fb90be5accfd1cec678d8cf5d75f2aa0c06167dc9b8b.ZF3VTqeZ0v_HQxJZyMnn70EScvoUGGyQ-fjz4dw-ExA
+ hash: v1.k794b7964.ec1a6b9a8c84c1e966e1f8d51715e693cebefb2b1ac698eb532551cb5f903e62.ysGBwcMt52R6v2nkvw0twiRXCMCNlS0QFt_k4FVTGLU
scenes-app-errortracking--group-page-loading--light:
- hash: v1.k794b7964.bd5a0e6b76f520d53c3ae2c0ec45a5f56ac50f2af60c17362c5b631104a1cea1.--suvXltANT83FFHak4ie__7cy0WVIHrzvtQhZkxmJg
+ hash: v1.k794b7964.d3f211afe06d61e93fc7888cdb930d3c6a095ecff9e76481de103eb47bd35c19.WuLVYx_HDqUNaoLGf_D7E70r2kzK3ezGvkqiRxmdhfE
+ scenes-app-errortracking--group-page-many-assignees--dark:
+ hash: v1.k794b7964.c6e4938f5fea35b65ef57198ee2b0935151e55b3bfdc90f0d84fa4c416cf24a6.zmFTAxxBUspe5P1vhKPmyXwdDEqNg8ESGXd1V09FbCo
+ scenes-app-errortracking--group-page-many-assignees--light:
+ hash: v1.k794b7964.3288393a4ba05348eccc82815c30a4d38355bf1d0b31c4b360e1dbc20f0ccfe2.v07jBZUeqeXbQWK8J-JiY3y819Pad4pWNoBKvOIqF7w
scenes-app-errortracking--group-page-with-self-driving--dark:
- hash: v1.k794b7964.9a6d6984b93caf409a9f834d39c754800e691935d2431aca8bfcad5be30d9211.I9aVC4ZG1CfFrSucVWdwGfgLC33Y51VBTPP9BfcCj1Y
+ hash: v1.k794b7964.361c63d8098b60ca1bbf69206dc8f6711320146663aaf32dbd6651168a0b600b.dMsSmC7-kkmsg2uY_UCUtBk-2KP8U8EC-CgTQBwgCkE
scenes-app-errortracking--group-page-with-self-driving--light:
- hash: v1.k794b7964.8ea5cfbc986b02d616a31e797de8ba06f84f8d2bf6dc3cb1a1b1a1a7ed82bfa3.jCMsWupoerRB1Or40oe4e7O9h_4e3sjE93kMQl2ieWk
+ hash: v1.k794b7964.4c24d565a6a126a64761040eb44a64d5a689fc04a8b566ccc5410147c19451fc.wuQskHSi8SlMXfFZuza565EKQMIw1RhLM-1UCclFPJ8
scenes-app-errortracking--list-page--dark:
- hash: v1.k794b7964.bf71e48e3e45dfaa4b8dba589284194ec379469eaac4cd1275ed58b98ef96df4.krIuwVdI78fbvMxEiwXLJnm-YK6AdQRt38pUxaauMg0
+ hash: v1.k794b7964.2fcf2311aa6f601214b532ccb22e83ef378b87ed1fd6705085b8276ca245ba6f.zLha5NipvTWdyRZqgMiowFL3N5MicRiuwrfuAa22y7c
scenes-app-errortracking--list-page--light:
- hash: v1.k794b7964.4ef6b63ad25b170e4a2dfba319b532eba1a29569557778383cd2591fe9db493e.KYjQJmu6DoiCPBpblwCBMxP3RJnw_zKHRjXMEiTxuS4
+ hash: v1.k794b7964.ec828bd049bcf02367910abb18539201ef5f6447b602a75891a64d45d743c4f5.RAArjfFKQhB64bx3ypvlJdCR3svO5Yify4gANdrDJ94
scenes-app-errortracking--list-page-with-ingestion-warning--dark:
- hash: v1.k794b7964.d0cc1ad39fb4d2101a7a5ee733f369f3edfba581b6e1644061beefa170622731.eS38wQuq5nOMAkMEskk-x6F5fup7EQTlXqsZJN5cP0w
+ hash: v1.k794b7964.d022a01bda75a3dd24df2d9c8761a89ae164cfc56be95324d5e7c64c10d0b430.oHc4Ikowbu-9SRbRqkbNwIiLvrqTrwPTVdRddjhGNQ0
scenes-app-errortracking--list-page-with-ingestion-warning--light:
- hash: v1.k794b7964.9c648f1a516ab70ef799c6b654307dd8536e091176730df8a3ad6117f60a6172.JV2er-WBZWw0kT8-L5H4NV7V0TPdTzOabmeR7rWDPic
+ hash: v1.k794b7964.fc094917ab619f645401504337c6eed08254baf12433126b71a74241c499ad98.zuuZ0RWxU2OZDmwDZY1Usfd9fyV_qZq8t_romWDeQqA
scenes-app-errortracking--list-page-with-source-maps-banner--dark:
- hash: v1.k794b7964.75e6c2741dfe10d612b5ebfba86bd7f9f0a8fc0836ee33ba4b324b18db3f4248.6pl5Tn_T-S9dXtYACltccR4oPl2X_lOfEyg0GXH5Hpc
+ hash: v1.k794b7964.f549cf65c050beb24872b7e7ce7c53049d3853569db398f0ec0bb1e90af3cf54.LR6FysBFkExdTu3nAltZsd3gH8J3knaUNz-MiGs6iTo
scenes-app-errortracking--list-page-with-source-maps-banner--light:
- hash: v1.k794b7964.f10e31beaea75632de5d0fb3611c527d9e1c523c347bc3091d18c542fdf81743.W31jW6d-fZfXWZB7sJkDPgRcx2L4-j1CQxqWEX4PtIg
+ hash: v1.k794b7964.1f1efabaa301aa1fb6df35608b4f0ceb04758b16bd0cb5c5b683d38e9372209d.v4lJX3wKzX7RGn4ckCTmgnfmWGaWaokyfojnXS0_Dlo
scenes-app-errortracking-linkedreports--fix-proposed--dark:
hash: v1.k794b7964.1b50022f8fafb4684dacd255b966bd2969f79e84d5c7c7daeb68291772a1e36d.9uyjrwufsjMCFx9c7cjsoIyabB3A4ZBnPSVUouM0RZE
scenes-app-errortracking-linkedreports--fix-proposed--light:
diff --git a/products/error_tracking/frontend/ErrorTracking.stories.tsx b/products/error_tracking/frontend/ErrorTracking.stories.tsx
index 59386f40375c..30c75a74fc2d 100644
--- a/products/error_tracking/frontend/ErrorTracking.stories.tsx
+++ b/products/error_tracking/frontend/ErrorTracking.stories.tsx
@@ -1,4 +1,4 @@
-import { MOCK_DEFAULT_TEAM } from 'lib/api.mock'
+import { MOCK_DEFAULT_BASIC_USER, MOCK_DEFAULT_TEAM } from 'lib/api.mock'
import { Meta, StoryObj } from '@storybook/react'
import { useActions } from 'kea'
@@ -212,6 +212,52 @@ const STORY_POSITION_EVENT = {
timestamp: STORY_TIMESTAMPS[0],
properties: STORY_EVENT_PROPERTIES,
}
+const STORY_ASSIGNEE_MEMBERS = Array.from({ length: 32 }, (_, index) => {
+ const userNumber = index + 1
+ const user =
+ index === 0
+ ? MOCK_DEFAULT_BASIC_USER
+ : {
+ id: 1000 + index,
+ uuid: `story-user-${userNumber}`,
+ distinct_id: `story-user-${userNumber}`,
+ first_name: `Engineer ${String(userNumber).padStart(2, '0')}`,
+ email: `engineer-${userNumber}@example.com`,
+ }
+
+ return {
+ id: `story-member-${userNumber}`,
+ user,
+ level: 1,
+ joined_at: '2024-01-01T00:00:00.000Z',
+ updated_at: '2024-01-01T00:00:00.000Z',
+ is_2fa_enabled: false,
+ has_social_auth: false,
+ last_login: '2024-07-08T00:00:00.000Z',
+ }
+})
+const STORY_ASSIGNEE_ROLES = Array.from({ length: 16 }, (_, index) => {
+ const roleId = `story-role-${index + 1}`
+ const includesCurrentUser = index % 5 === 0
+
+ return {
+ id: roleId,
+ name: `Engineering role ${String(index + 1).padStart(2, '0')}`,
+ members: includesCurrentUser
+ ? [
+ {
+ id: `story-role-member-${index + 1}`,
+ user: MOCK_DEFAULT_BASIC_USER,
+ role_id: roleId,
+ joined_at: '2024-01-01T00:00:00.000Z',
+ updated_at: '2024-01-01T00:00:00.000Z',
+ },
+ ]
+ : [],
+ created_at: '2024-01-01T00:00:00.000Z',
+ created_by: MOCK_DEFAULT_BASIC_USER,
+ }
+})
const STORY_ISSUE = {
...errorTrackingTypeIssue,
id: ISSUE_ID,
@@ -443,6 +489,49 @@ export const GroupPage: Story = {
},
}
+export const GroupPageManyAssignees: Story = {
+ name: 'Issue scene with many assignees',
+ parameters: {
+ pageUrl: urls.errorTrackingIssue(ISSUE_ID),
+ featureFlags: [FEATURE_FLAGS.ERROR_TRACKING_SEVERITY_RULES],
+ },
+ decorators: [
+ mswDecorator({
+ get: {
+ '/api/organizations/:organization_id/members': ({ request }) => {
+ const search = new URL(request.url).searchParams.get('search')?.toLowerCase()
+ const members = search
+ ? STORY_ASSIGNEE_MEMBERS.filter((member) =>
+ [member.user.first_name, member.user.email].some((value) =>
+ value.toLowerCase().includes(search)
+ )
+ )
+ : STORY_ASSIGNEE_MEMBERS
+
+ return [
+ 200,
+ {
+ count: members.length,
+ results: members,
+ next: null,
+ previous: null,
+ },
+ ]
+ },
+ '/api/organizations/:organization_id/roles/': [
+ 200,
+ {
+ count: STORY_ASSIGNEE_ROLES.length,
+ results: STORY_ASSIGNEE_ROLES,
+ next: null,
+ previous: null,
+ },
+ ],
+ },
+ }),
+ ],
+}
+
export const GroupPageContentSizedBreakdownPanel: Story = {
name: 'Issue scene with content-sized breakdown panel',
parameters: { pageUrl: urls.errorTrackingIssue(ISSUE_ID) },
diff --git a/products/error_tracking/frontend/components/Assignee/QuillAssigneeDropdown.tsx b/products/error_tracking/frontend/components/Assignee/QuillAssigneeDropdown.tsx
new file mode 100644
index 000000000000..4e2f466fd5f9
--- /dev/null
+++ b/products/error_tracking/frontend/components/Assignee/QuillAssigneeDropdown.tsx
@@ -0,0 +1,258 @@
+import { useActions, useValues } from 'kea'
+import { router } from 'kea-router'
+import { useMemo, useRef } from 'react'
+
+import { IconPlusSmall, IconSearch, IconX } from '@posthog/icons'
+
+import {
+ Button,
+ Combobox,
+ ComboboxCollection,
+ ComboboxContent,
+ ComboboxEmpty,
+ ComboboxGroup,
+ ComboboxInput,
+ ComboboxItem,
+ ComboboxLabel,
+ ComboboxList,
+ ComboboxListFooter,
+ ComboboxTrigger,
+ InputGroupAddon,
+ Text,
+} from 'lib/ui/quill'
+import { fullName } from 'lib/utils/strings'
+import { urls } from 'scenes/urls'
+
+import { ErrorTrackingIssueAssignee } from '~/queries/schema/schema-general'
+
+import { AssigneeIconDisplay, AssigneeLabelDisplay } from './AssigneeDisplay'
+import { Assignee, assigneeSelectLogic, RoleAssignee, UserAssignee } from './assigneeSelectLogic'
+
+const CREATE_ROLE_VALUE = '__create-role__'
+const LOADING_ROLES_VALUE = '__loading-roles__'
+const LOADING_USERS_VALUE = '__loading-users__'
+const OPTION_CLASS_NAME =
+ '!ps-2 !pe-8 text-sm [&>span:last-child]:start-auto [&>span:last-child]:end-2 [&>span:last-child>svg]:size-3'
+
+interface AssigneeOptionGroup {
+ value: string
+ items: string[]
+}
+
+export interface QuillAssigneeDropdownProps {
+ assignee: ErrorTrackingIssueAssignee | null
+ onChange: (assignee: ErrorTrackingIssueAssignee | null) => void
+ open: boolean
+ onOpenChange: (open: boolean) => void
+ trigger: JSX.Element
+}
+
+function optionValue(assignee: NonNullable<Assignee>): string {
+ return `${assignee.type}:${assignee.id}`
+}
+
+function optionLabel(assignee: NonNullable<Assignee>): string {
+ return assignee.type === 'role' ? assignee.role.name : fullName(assignee.user)
+}
+
+export function QuillAssigneeDropdown({
+ assignee,
+ onChange,
+ open,
+ onOpenChange,
+ trigger,
+}: QuillAssigneeDropdownProps): JSX.Element {
+ const { search, filteredRoles, myRoles, filteredMembers, me, rolesLoading, membersLoading } =
+ useValues(assigneeSelectLogic)
+ const { setSearch } = useActions(assigneeSelectLogic)
+ const triggerRef = useRef<HTMLButtonElement>(null)
+
+ const { groups, optionByValue } = useMemo(() => {
+ const roles: RoleAssignee[] = filteredRoles.map((role) => ({
+ id: role.id,
+ type: 'role',
+ role,
+ }))
+ const myRoleIds = new Set(myRoles.map((role) => role.id))
+ const myRoleOptions = roles.filter((role) => myRoleIds.has(role.id))
+ const otherRoleOptions = roles.filter((role) => !myRoleIds.has(role.id))
+ const users: UserAssignee[] = filteredMembers.map((member) => ({
+ id: member.user.id,
+ type: 'user',
+ user: member.user,
+ }))
+ const options = new Map<string, NonNullable<Assignee>>()
+
+ for (const option of [...roles, ...users]) {
+ options.set(optionValue(option), option)
+ }
+
+ const myRoleItems = myRoleOptions.map(optionValue)
+ const roleItems = otherRoleOptions.map(optionValue)
+ if (rolesLoading) {
+ roleItems.push(LOADING_ROLES_VALUE)
+ } else if (roles.length === 0 && !search) {
+ roleItems.push(CREATE_ROLE_VALUE)
+ }
+
+ const userItems = users.map(optionValue)
+ if (membersLoading) {
+ userItems.push(LOADING_USERS_VALUE)
+ }
+
+ return {
+ groups: [
+ { value: 'My roles', items: myRoleItems },
+ { value: 'Roles', items: roleItems },
+ { value: 'Users', items: userItems },
+ ].filter((group) => group.items.length > 0),
+ optionByValue: options,
+ }
+ }, [filteredMembers, filteredRoles, membersLoading, myRoles, rolesLoading, search])
+
+ const selectedValue = assignee ? `${assignee.type}:${assignee.id}` : null
+ const isAssignedToMe = assignee?.type === 'user' && assignee.id === me?.user.id
+
+ return (
+ <Combobox
+ items={groups}
+ value={selectedValue}
+ inputValue={search}
+ open={open}
+ autoHighlight
+ highlightItemOnHover
+ itemToStringLabel={(value) => {
+ if (!value) {
+ return ''
+ }
+ const option = optionByValue.get(value)
+ return option ? optionLabel(option) : ''
+ }}
+ itemToStringValue={(value) => {
+ if (!value) {
+ return ''
+ }
+ const option = optionByValue.get(value)
+ return option ? optionLabel(option) : ''
+ }}
+ onInputValueChange={(value: string) => setSearch(value)}
+ onOpenChange={(nextOpen: boolean) => {
+ onOpenChange(nextOpen)
+ if (!nextOpen) {
+ setSearch('')
+ }
+ }}
+ onValueChange={(value: string | null) => {
+ if (!value || value.startsWith('__loading-')) {
+ return
+ }
+ if (value === CREATE_ROLE_VALUE) {
+ router.actions.push(urls.settings('organization-roles'))
+ return
+ }
+ const option = optionByValue.get(value)
+ if (option) {
+ onChange({ type: option.type, id: option.id })
+ }
+ }}
+ >
+ <ComboboxTrigger ref={triggerRef} render={trigger} aria-label="Assignee" />
+ <ComboboxContent
+ anchor={triggerRef}
+ align="start"
+ className="w-56 [&_[data-slot=combobox-input-group-wrapper]]:border-b-0"
+ >
+ <ComboboxInput
+ placeholder="Search assignees"
+ autoFocus
+ showTrigger={false}
+ className="h-7 [&_input]:text-sm"
+ >
+ <InputGroupAddon align="inline-start">
+ <IconSearch className="size-3" />
+ </InputGroupAddon>
+ </ComboboxInput>
+ <ComboboxEmpty className="text-sm">No matches</ComboboxEmpty>
+ <ComboboxList>
+ {(group: AssigneeOptionGroup) => (
+ <ComboboxGroup key={group.value} items={group.items}>
+ <ComboboxLabel className="py-1">{group.value}</ComboboxLabel>
+ <ComboboxCollection>
+ {(value: string) => {
+ if (value === CREATE_ROLE_VALUE) {
+ return (
+ <ComboboxItem key={value} value={value} className={OPTION_CLASS_NAME}>
+ <IconPlusSmall className="size-3" />
+ Create role
+ </ComboboxItem>
+ )
+ }
+
+ if (value === LOADING_ROLES_VALUE || value === LOADING_USERS_VALUE) {
+ return (
+ <ComboboxItem
+ key={value}
+ value={value}
+ disabled
+ className={OPTION_CLASS_NAME}
+ >
+ <Text size="sm" variant="muted" className="italic">
+ Loading...
+ </Text>
+ </ComboboxItem>
+ )
+ }
+
+ const option = optionByValue.get(value)
+ if (!option) {
+ return null
+ }
+
+ return (
+ <ComboboxItem key={value} value={value} className={OPTION_CLASS_NAME}>
+ <AssigneeIconDisplay assignee={option} size="xsmall" />
+ <AssigneeLabelDisplay assignee={option} size="small" />
+ </ComboboxItem>
+ )
+ }}
+ </ComboboxCollection>
+ </ComboboxGroup>
+ )}
+ </ComboboxList>
+ {me || assignee ? (
+ <ComboboxListFooter className="mx-0 mt-0 bg-transparent before:hidden">
+ <div className="flex flex-col gap-0.5">
+ {me && !isAssignedToMe ? (
+ <Button
+ variant="default"
+ size="default"
+ left
+ className="w-full gap-1.5 text-sm font-medium text-foreground"
+ onClick={() => onChange({ type: 'user', id: me.user.id })}
+ >
+ <AssigneeIconDisplay
+ assignee={{ type: 'user', id: me.user.id, user: me.user }}
+ size="xsmall"
+ />
+ Assign to me
+ </Button>
+ ) : null}
+ {assignee ? (
+ <Button
+ variant="default"
+ size="default"
+ left
+ className="w-full gap-1.5 text-sm font-medium text-foreground"
+ onClick={() => onChange(null)}
+ >
+ <IconX className="size-3" />
+ Remove assignee
+ </Button>
+ ) : null}
+ </div>
+ </ComboboxListFooter>
+ ) : null}
+ </ComboboxContent>
+ </Combobox>
+ )
+}
diff --git a/products/error_tracking/frontend/components/Assignee/QuillAssigneeSelect.tsx b/products/error_tracking/frontend/components/Assignee/QuillAssigneeSelect.tsx
new file mode 100644
index 000000000000..a0dee1eb44c9
--- /dev/null
+++ b/products/error_tracking/frontend/components/Assignee/QuillAssigneeSelect.tsx
@@ -0,0 +1,41 @@
+import { useActions, useValues } from 'kea'
+import { useEffect, useMemo, useState } from 'react'
+
+import { ErrorTrackingIssue } from '~/queries/schema/schema-general'
+
+import { Assignee, assigneeSelectLogic } from './assigneeSelectLogic'
+import { QuillAssigneeDropdown } from './QuillAssigneeDropdown'
+
+export const QuillAssigneeSelect = ({
+ assignee,
+ onChange,
+ children,
+}: {
+ assignee: ErrorTrackingIssue['assignee']
+ onChange: (assignee: ErrorTrackingIssue['assignee']) => void
+ children: (assignee: Assignee, isOpen: boolean) => JSX.Element
+}): JSX.Element => {
+ const { ensureAssigneeTypesLoaded } = useActions(assigneeSelectLogic)
+ const { resolveAssignee } = useValues(assigneeSelectLogic)
+ const [showPopover, setShowPopover] = useState(false)
+ const resolvedAssignee = useMemo(() => resolveAssignee(assignee), [assignee, resolveAssignee])
+
+ const _onChange = (value: ErrorTrackingIssue['assignee']): void => {
+ setShowPopover(false)
+ onChange(value)
+ }
+
+ useEffect(() => {
+ ensureAssigneeTypesLoaded()
+ }, [ensureAssigneeTypesLoaded])
+
+ return (
+ <QuillAssigneeDropdown
+ assignee={assignee}
+ onChange={_onChange}
+ open={showPopover}
+ onOpenChange={setShowPopover}
+ trigger={children(resolvedAssignee, showPopover)}
+ />
+ )
+}
diff --git a/products/error_tracking/frontend/components/Assignee/assigneeSelectLogic.tsx b/products/error_tracking/frontend/components/Assignee/assigneeSelectLogic.tsx
index 832ef462b27e..2c560a197f22 100644
--- a/products/error_tracking/frontend/components/Assignee/assigneeSelectLogic.tsx
+++ b/products/error_tracking/frontend/components/Assignee/assigneeSelectLogic.tsx
@@ -28,12 +28,14 @@ export type Assignee = UserAssignee | RoleAssignee | null
// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
export interface assigneeSelectLogicValues {
filteredMembers: OrganizationMemberType[] // membersLogic
+ me: OrganizationMemberType | null // membersLogic
meFirstMembers: OrganizationMemberType[] // membersLogic
membersLoading: boolean // membersLogic
roles: RoleType[] // rolesLogic
rolesLoading: boolean // rolesLogic
filteredRoles: RoleType[]
loading: boolean
+ myRoles: RoleType[]
resolveAssignee: (assignee: ErrorTrackingIssue['assignee']) => Assignee
rolesFuse: Fuse<RoleType>
search: string
@@ -61,6 +63,7 @@ export interface assigneeSelectLogicMeta {
loading: (membersLoading: boolean, rolesLoading: boolean) => boolean
rolesFuse: (roles: RoleType[]) => Fuse<RoleType>
filteredRoles: (roles: RoleType[], rolesFuse: Fuse<RoleType>, search: string) => RoleType[]
+ myRoles: (filteredRoles: RoleType[], me: OrganizationMemberType | null) => RoleType[]
resolveAssignee: (
roles: RoleType[],
meFirstMembers: OrganizationMemberType[]
@@ -82,7 +85,7 @@ export const assigneeSelectLogic = kea<assigneeSelectLogicType>([
connect(() => ({
values: [
membersLogic,
- ['meFirstMembers', 'filteredMembers', 'membersLoading'],
+ ['me', 'meFirstMembers', 'filteredMembers', 'membersLoading'],
rolesLogic,
['roles', 'rolesLoading'],
],
@@ -122,6 +125,13 @@ export const assigneeSelectLogic = kea<assigneeSelectLogicType>([
(roles: RoleType[], rolesFuse: Fuse<RoleType>, search: string): RoleType[] =>
search ? rolesFuse.search(search).map((result) => result.item) : (roles ?? []),
],
+ myRoles: [
+ (s) => [s.filteredRoles, s.me],
+ (roles: RoleType[], me: OrganizationMemberType | null): RoleType[] =>
+ me
+ ? roles.filter((role) => (role.members ?? []).some((member) => member.user.uuid === me.user.uuid))
+ : [],
+ ],
resolveAssignee: [
(s) => [s.roles, s.meFirstMembers],
diff --git a/products/error_tracking/frontend/components/ErrorTrackingIssueList/ErrorTrackingIssueList.tsx b/products/error_tracking/frontend/components/ErrorTrackingIssueList/ErrorTrackingIssueList.tsx
index 4335abcc360f..5df26b6cd68b 100644
--- a/products/error_tracking/frontend/components/ErrorTrackingIssueList/ErrorTrackingIssueList.tsx
+++ b/products/error_tracking/frontend/components/ErrorTrackingIssueList/ErrorTrackingIssueList.tsx
@@ -17,7 +17,7 @@ import { useSparklineData } from '../../hooks/use-sparkline-data'
import { errorTrackingIssueSceneLogic } from '../../scenes/ErrorTrackingIssueScene/errorTrackingIssueSceneLogic'
import { ERROR_TRACKING_LISTING_RESOLUTION, sourceDisplay } from '../../utils'
import { AssigneeIconDisplay, AssigneeLabelDisplay, AssigneeResolver } from '../Assignee/AssigneeDisplay'
-import { AssigneeSelect } from '../Assignee/AssigneeSelect'
+import { QuillAssigneeSelect } from '../Assignee/QuillAssigneeSelect'
import { StatusIndicator } from '../Indicators'
import { issueActionsLogic } from '../IssueActions/issueActionsLogic'
import { IssueSeveritySelect } from '../IssueSeveritySelect'
@@ -131,14 +131,14 @@ export function ErrorTrackingIssueListRow({
</>
) : null}
{canMutateIssues ? (
- <AssigneeSelect
+ <QuillAssigneeSelect
assignee={issue.assignee}
onChange={(assignee) => updateIssueAssignee(issue.id, assignee)}
>
{(anyAssignee) => (
- <div
+ <button
+ type="button"
className="ml-1 flex cursor-pointer items-center rounded p-[0.1rem] text-xs text-secondary hover:bg-fill-button-tertiary-hover"
- role="button"
>
<AssigneeIconDisplay assignee={anyAssignee} size="xsmall" />
<AssigneeLabelDisplay
@@ -148,9 +148,9 @@ export function ErrorTrackingIssueListRow({
placeholder="Unassigned"
/>
<IconChevronDown />
- </div>
+ </button>
)}
- </AssigneeSelect>
+ </QuillAssigneeSelect>
) : (
<AssigneeResolver assignee={issue.assignee}>
{({ assignee: resolvedAssignee }) => (
diff --git a/products/error_tracking/frontend/components/IssueSeveritySelect.test.tsx b/products/error_tracking/frontend/components/IssueSeveritySelect.test.tsx
index 268baee0dcc7..cd98c93b4891 100644
--- a/products/error_tracking/frontend/components/IssueSeveritySelect.test.tsx
+++ b/products/error_tracking/frontend/components/IssueSeveritySelect.test.tsx
@@ -6,18 +6,15 @@ import userEvent from '@testing-library/user-event'
import { IssueSeveritySelect } from './IssueSeveritySelect'
describe('IssueSeveritySelect', () => {
- it('updates and clears the severity from the menu', async () => {
+ it('updates severity without offering a clear action', async () => {
const user = userEvent.setup()
const onChange = jest.fn()
- const { rerender } = render(<IssueSeveritySelect severity="high" onChange={onChange} />)
+ render(<IssueSeveritySelect severity="high" onChange={onChange} />)
await user.click(screen.getByLabelText('Severity: High'))
+ expect(screen.queryByText('No severity')).not.toBeInTheDocument()
+
await user.click(await screen.findByText('Critical'))
expect(onChange).toHaveBeenLastCalledWith('critical')
-
- rerender(<IssueSeveritySelect severity="critical" onChange={onChange} />)
- await user.click(screen.getByLabelText('Severity: Critical'))
- await user.click(await screen.findByText('No severity'))
- expect(onChange).toHaveBeenLastCalledWith(null)
})
})
diff --git a/products/error_tracking/frontend/components/IssueSeveritySelect.tsx b/products/error_tracking/frontend/components/IssueSeveritySelect.tsx
index ace630091118..14c5bcf2be97 100644
--- a/products/error_tracking/frontend/components/IssueSeveritySelect.tsx
+++ b/products/error_tracking/frontend/components/IssueSeveritySelect.tsx
@@ -1,49 +1,62 @@
-import { IconChevronDown } from '@posthog/icons'
-import { LemonButton, LemonMenu } from '@posthog/lemon-ui'
+import {
+ Select,
+ SelectContent,
+ SelectGroup,
+ SelectGroupLabel,
+ SelectItem,
+ SelectTrigger,
+ SelectValue,
+ Spinner,
+} from 'lib/ui/quill'
import { ISSUE_SEVERITY_OPTIONS, IssueSeverityTag, issueSeverityLabel, type IssueSeverity } from './IssueSeverityTag'
type IssueSeveritySelectProps = {
severity: IssueSeverity | null | undefined
- onChange: (severity: IssueSeverity | null) => void
+ onChange: (severity: IssueSeverity) => void
loading?: boolean
+ size?: 'sm' | 'default'
}
-export function IssueSeveritySelect({ severity, onChange, loading = false }: IssueSeveritySelectProps): JSX.Element {
+export function IssueSeveritySelect({
+ severity,
+ onChange,
+ loading = false,
+ size = 'sm',
+}: IssueSeveritySelectProps): JSX.Element {
return (
- <LemonMenu
- placement="bottom-start"
- items={[
- ...ISSUE_SEVERITY_OPTIONS.map((option) => ({
- active: severity === option.value,
- label: <IssueSeverityTag severity={option.value} />,
- onClick: () => {
- if (severity !== option.value) {
- onChange(option.value)
- }
- },
- })),
- {
- active: !severity,
- label: <IssueSeverityTag severity={null} />,
- onClick: () => {
- if (severity) {
- onChange(null)
- }
- },
- },
- ]}
+ <Select
+ value={severity ?? null}
+ onValueChange={(nextSeverity: IssueSeverity | null) => {
+ if (nextSeverity && nextSeverity !== severity) {
+ onChange(nextSeverity)
+ }
+ }}
>
- <LemonButton
- type="tertiary"
- size="xsmall"
- loading={loading}
- sideIcon={<IconChevronDown />}
+ <SelectTrigger
+ disabled={loading}
+ data-loading={loading || undefined}
+ aria-busy={loading || undefined}
+ size={size}
+ className="gap-1 disabled:opacity-100"
aria-label={`Severity: ${issueSeverityLabel(severity)}`}
data-attr="error-tracking-issue-severity"
>
- <IssueSeverityTag severity={severity} />
- </LemonButton>
- </LemonMenu>
+ <SelectValue>
+ <IssueSeverityTag severity={severity} />
+ </SelectValue>
+ {loading && <Spinner />}
+ </SelectTrigger>
+ <SelectContent align="start" alignItemWithTrigger={false}>
+ <SelectGroup>
+ <SelectGroupLabel className="py-1">Severity</SelectGroupLabel>
+ {ISSUE_SEVERITY_OPTIONS.map((option) => (
+ <SelectItem key={option.value} value={option.value}>
+ <IssueSeverityTag severity={option.value} />
+ </SelectItem>
+ ))}
+ </SelectGroup>
+ </SelectContent>
+ </Select>
)
}
diff --git a/products/error_tracking/frontend/components/IssueSeverityTag.tsx b/products/error_tracking/frontend/components/IssueSeverityTag.tsx
index be73f661e0f0..2aa741af40a1 100644
--- a/products/error_tracking/frontend/components/IssueSeverityTag.tsx
+++ b/products/error_tracking/frontend/components/IssueSeverityTag.tsx
@@ -1,4 +1,4 @@
-import { LemonTag, type LemonTagType } from '@posthog/lemon-ui'
+import clsx from 'clsx'
import type { ErrorTrackingQueryIssueSeverity } from '~/queries/schema/schema-general'
@@ -11,30 +11,52 @@ export const ISSUE_SEVERITY_OPTIONS: { label: string; value: IssueSeverity }[] =
{ label: 'Critical', value: 'critical' },
]
-export function issueSeverityTagType(severity: IssueSeverity | null | undefined): LemonTagType {
+export function issueSeverityLabel(severity: IssueSeverity | null | undefined): string {
+ if (!severity) {
+ return 'No severity'
+ }
+ return ISSUE_SEVERITY_OPTIONS.find((option) => option.value === severity)?.label ?? severity
+}
+
+function issueSeverityColor(severity: IssueSeverity | null | undefined): string {
if (severity === 'critical') {
- return 'danger'
+ return 'text-danger'
}
if (severity === 'high') {
- return 'warning'
+ return 'text-warning'
}
- if (!severity) {
- return 'muted'
+ if (severity === 'medium') {
+ return 'text-purple'
}
- return 'default'
+ return 'text-muted'
}
-export function issueSeverityLabel(severity: IssueSeverity | null | undefined): string {
- if (!severity) {
- return 'No severity'
- }
- return ISSUE_SEVERITY_OPTIONS.find((option) => option.value === severity)?.label ?? severity
+function issueSeverityIcon(severity: IssueSeverity | null | undefined): JSX.Element {
+ const activeBars = severity ? ISSUE_SEVERITY_OPTIONS.findIndex((option) => option.value === severity) + 1 : 0
+
+ return (
+ <svg aria-hidden viewBox="0 0 11 9" className="size-3">
+ {[2.5, 4.5, 6.5, 8.5].map((height, index) => (
+ <rect
+ key={height}
+ x={index * 3}
+ y={9 - height}
+ width="2"
+ height={height}
+ rx="0.5"
+ fill="currentColor"
+ opacity={index < activeBars ? 1 : 0.2}
+ />
+ ))}
+ </svg>
+ )
}
export function IssueSeverityTag({ severity }: { severity: IssueSeverity | null | undefined }): JSX.Element {
return (
- <LemonTag type={issueSeverityTagType(severity)} size="small">
+ <span className={clsx('inline-flex items-center gap-1 text-xs font-medium', issueSeverityColor(severity))}>
+ {issueSeverityIcon(severity)}
{issueSeverityLabel(severity)}
- </LemonTag>
+ </span>
)
}
diff --git a/products/error_tracking/frontend/components/IssueStatusButton.tsx b/products/error_tracking/frontend/components/IssueStatusButton.tsx
index 628b1474afce..94e3df37b56c 100644
--- a/products/error_tracking/frontend/components/IssueStatusButton.tsx
+++ b/products/error_tracking/frontend/components/IssueStatusButton.tsx
@@ -1,6 +1,5 @@
-import { LemonButton, LemonMenuOverlay } from '@posthog/lemon-ui'
-
import { useHogfetti } from 'lib/components/Hogfetti/Hogfetti'
+import { Button, Tooltip, TooltipContent, TooltipTrigger } from 'lib/ui/quill'
import { ErrorTrackingIssue } from '~/queries/schema/schema-general'
@@ -27,39 +26,20 @@ export const IssueStatusButton = ({
return (
<>
<HogfettiComponent />
- <LemonButton
- type="primary"
- onClick={handleResolve}
- tooltip={
- status === 'active'
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <Button variant="primary" onClick={handleResolve} data-attr="error-tracking-resolve">
+ {status === 'active' ? 'Resolve' : 'Reopen'}
+ </Button>
+ }
+ />
+ <TooltipContent>
+ {status === 'active'
? ISSUE_STATUS_CONFIG.resolved.intentLabel
- : ISSUE_STATUS_CONFIG.active.intentLabel
- }
- data-attr="error-tracking-resolve"
- sideAction={
- status === 'active'
- ? {
- dropdown: {
- placement: 'bottom-end',
- overlay: (
- <LemonMenuOverlay
- items={[
- {
- label: 'Suppress',
- onClick: () => onChange('suppressed'),
- tooltip: ISSUE_STATUS_CONFIG.suppressed.intentLabel,
- },
- ]}
- />
- ),
- },
- }
- : undefined
- }
- size="small"
- >
- {status === 'active' ? 'Resolve' : 'Reopen'}
- </LemonButton>
+ : ISSUE_STATUS_CONFIG.active.intentLabel}
+ </TooltipContent>
+ </Tooltip>
</>
)
}
diff --git a/products/error_tracking/frontend/components/IssueStatusSelect.test.tsx b/products/error_tracking/frontend/components/IssueStatusSelect.test.tsx
new file mode 100644
index 000000000000..7c260063adc0
--- /dev/null
+++ b/products/error_tracking/frontend/components/IssueStatusSelect.test.tsx
@@ -0,0 +1,19 @@
+import '@testing-library/jest-dom'
+
+import { render, screen } from '@testing-library/react'
+import userEvent from '@testing-library/user-event'
+
+import { IssueStatusSelect } from './IssueStatusSelect'
+
+describe('IssueStatusSelect', () => {
+ it('updates the issue status from the menu', async () => {
+ const user = userEvent.setup()
+ const onChange = jest.fn()
+ render(<IssueStatusSelect status="active" onChange={onChange} />)
+
+ await user.click(screen.getByLabelText('Status: Active'))
+ await user.click(await screen.findByText('Resolved'))
+
+ expect(onChange).toHaveBeenCalledWith('resolved')
+ })
+})
diff --git a/products/error_tracking/frontend/components/IssueStatusSelect.tsx b/products/error_tracking/frontend/components/IssueStatusSelect.tsx
index b61aa77f70b2..2eaebfc167dc 100644
--- a/products/error_tracking/frontend/components/IssueStatusSelect.tsx
+++ b/products/error_tracking/frontend/components/IssueStatusSelect.tsx
@@ -1,81 +1,53 @@
-import { useState } from 'react'
-
-import { IconChevronDown } from '@posthog/icons'
-import { LemonButton } from '@posthog/lemon-ui'
-
import {
- DropdownMenu,
- DropdownMenuContent,
- DropdownMenuGroup,
- DropdownMenuItem,
- DropdownMenuTrigger,
-} from 'lib/ui/DropdownMenu/DropdownMenu'
+ Select,
+ SelectContent,
+ SelectGroup,
+ SelectGroupLabel,
+ SelectItem,
+ SelectTrigger,
+ SelectValue,
+} from 'lib/ui/quill'
import { ErrorTrackingIssue } from '~/queries/schema/schema-general'
import { ISSUE_STATUS_OPTIONS } from '../utils'
-import { StatusIndicator } from './Indicators'
+import { getIssueStatusConfig, StatusIndicator } from './Indicators'
export const IssueStatusSelect = ({
status,
options = ISSUE_STATUS_OPTIONS,
onChange,
+ size = 'sm',
}: {
status: ErrorTrackingIssue['status']
options?: ErrorTrackingIssue['status'][]
onChange: (status: ErrorTrackingIssue['status']) => void
+ size?: 'sm' | 'default'
}): JSX.Element => {
- const [showPopover, setShowPopover] = useState(false)
-
- const _onChange = (status: ErrorTrackingIssue['status']): void => {
- setShowPopover(false)
- onChange(status)
- }
-
- return (
- <DropdownMenu open={showPopover} onOpenChange={setShowPopover}>
- <DropdownMenuTrigger
- className="flex items-center hover:bg-fill-button-tertiary-hover p-[0.1rem] rounded cursor-pointer"
- role="button"
- >
- <StatusIndicator status={status} className="ml-1 text-xs text-secondary" />
- <IconChevronDown />
- </DropdownMenuTrigger>
- <IssueStatusDropdown status={status} options={options} onChange={_onChange} />
- </DropdownMenu>
- )
-}
-
-function IssueStatusDropdown({
- status,
- options,
- onChange,
-}: {
- status: ErrorTrackingIssue['status']
- options: ErrorTrackingIssue['status'][]
- onChange: (status: ErrorTrackingIssue['status']) => void
-}): JSX.Element {
return (
- <DropdownMenuContent>
- <DropdownMenuGroup>
- {options.map((option) => (
- <DropdownMenuItem
- key={option}
- className="text-base text-secondary hover:bg-fill-button-tertiary-hover hover:text-fill-button-tertiary px-1"
- asChild
- >
- <LemonButton
- fullWidth
- onClick={() => option !== status && onChange(option)}
- role="menuitem"
- size="xsmall"
- active={option === status}
- >
- <StatusIndicator status={option} withTooltip="right" />
- </LemonButton>
- </DropdownMenuItem>
- ))}
- </DropdownMenuGroup>
- </DropdownMenuContent>
+ <Select
+ value={status}
+ onValueChange={(nextStatus: ErrorTrackingIssue['status'] | null) => {
+ if (nextStatus && nextStatus !== status) {
+ onChange(nextStatus)
+ }
+ }}
+ >
+ <SelectTrigger size={size} className="gap-1" aria-label={`Status: ${getIssueStatusConfig(status).label}`}>
+ <SelectValue>
+ <StatusIndicator status={status} size="xsmall" className="text-secondary" />
+ </SelectValue>
+ </SelectTrigger>
+ <SelectContent align="start" alignItemWithTrigger={false}>
+ <SelectGroup>
+ <SelectGroupLabel className="py-1">Status</SelectGroupLabel>
+ {options.map((option) => (
+ <SelectItem key={option} value={option}>
+ <StatusIndicator status={option} size="xsmall" />
+ </SelectItem>
+ ))}
+ </SelectGroup>
+ </SelectContent>
+ </Select>
)
}
diff --git a/products/error_tracking/frontend/components/TableColumns.tsx b/products/error_tracking/frontend/components/TableColumns.tsx
index 9957f5ec48db..d29b842282dc 100644
--- a/products/error_tracking/frontend/components/TableColumns.tsx
+++ b/products/error_tracking/frontend/components/TableColumns.tsx
@@ -1,13 +1,13 @@
import { useActions, useValues } from 'kea'
import { useMemo } from 'react'
-import { IconChevronDown, IconChevronRight, IconMinus } from '@posthog/icons'
-import { LemonCheckbox, LemonSkeleton, Link } from '@posthog/lemon-ui'
+import { IconMinus } from '@posthog/icons'
+import { LemonCheckbox, Link } from '@posthog/lemon-ui'
import { ErrorTrackingRuntime } from 'lib/components/Errors/types'
import { getRuntimeFromLib } from 'lib/components/Errors/utils'
-import { TZLabel } from 'lib/components/TZLabel'
import { useFeatureFlag } from 'lib/hooks/useFeatureFlag'
+import { Button, ButtonGroup, SelectTriggerIcon } from 'lib/ui/quill'
import { Params } from 'scenes/sceneTypes'
import { urls } from 'scenes/urls'
@@ -17,10 +17,9 @@ import { bulkSelectLogic } from '../logics/bulkSelectLogic'
import { errorTrackingIssueSceneLogic } from '../scenes/ErrorTrackingIssueScene/errorTrackingIssueSceneLogic'
import { sourceDisplay } from '../utils'
import { AssigneeIconDisplay, AssigneeLabelDisplay } from './Assignee/AssigneeDisplay'
-import { AssigneeSelect } from './Assignee/AssigneeSelect'
+import { QuillAssigneeSelect } from './Assignee/QuillAssigneeSelect'
import { issueActionsLogic } from './IssueActions/issueActionsLogic'
import { issueFiltersLogic, updateFilterSearchParams } from './IssueFilters/issueFiltersLogic'
-import { issueQueryOptionsLogic } from './IssueQueryOptions/issueQueryOptionsLogic'
import { IssueSeveritySelect } from './IssueSeveritySelect'
import { IssueStatusSelect } from './IssueStatusSelect'
import { RuntimeIcon } from './RuntimeIcon'
@@ -73,7 +72,6 @@ export const IssueListTitleColumn = (props: {
const { updateIssueAssignee, updateIssueSeverity, updateIssueStatus } = useActions(issueActionsLogic)
const { severityUpdateInFlightIds } = useValues(issueActionsLogic)
const { dateRange, filterGroup, filterTestAccounts, searchQuery } = useValues(issueFiltersLogic)
- const { orderBy } = useValues(issueQueryOptionsLogic)
const hasSeverityRules = useFeatureFlag('ERROR_TRACKING_SEVERITY_RULES')
const checked = selectedIssueIds.includes(record.id)
@@ -129,7 +127,6 @@ export const IssueListTitleColumn = (props: {
)}
<IssueMetadata
record={record}
- orderBy={orderBy}
showSeverity={hasSeverityRules}
severityLoading={severityUpdateInFlightIds.includes(record.id)}
onStatusChange={(status) => updateIssueStatus(record.id, status)}
@@ -171,7 +168,6 @@ const IssueTitle = ({
const IssueMetadata = ({
record,
- orderBy,
showSeverity,
severityLoading,
onStatusChange,
@@ -179,55 +175,28 @@ const IssueMetadata = ({
onAssigneeChange,
}: {
record: ErrorTrackingIssue
- orderBy: string
showSeverity: boolean
severityLoading: boolean
onStatusChange: (status: ErrorTrackingIssue['status']) => void
onSeverityChange: (severity: NonNullable<ErrorTrackingIssue['severity']> | null) => void
onAssigneeChange: (assignee: ErrorTrackingIssue['assignee']) => void
}): JSX.Element => (
- <div className="flex items-center text-secondary h-[calc(var(--line-height)*1.3)]">
- <IssueStatusSelect status={record.status} onChange={onStatusChange} />
- <CustomSeparator />
- {showSeverity ? (
- <>
+ <div className="my-1 flex h-6 items-center text-secondary">
+ <ButtonGroup>
+ <IssueStatusSelect status={record.status} onChange={onStatusChange} />
+ {showSeverity ? (
<IssueSeveritySelect severity={record.severity} onChange={onSeverityChange} loading={severityLoading} />
- <CustomSeparator />
- </>
- ) : null}
- <AssigneeSelect assignee={record.assignee} onChange={onAssigneeChange}>
- {(anyAssignee) => (
- <div
- className="flex items-center hover:bg-fill-button-tertiary-hover p-[0.1rem] rounded cursor-pointer"
- role="button"
- >
- <AssigneeIconDisplay assignee={anyAssignee} size="xsmall" />
- <AssigneeLabelDisplay
- assignee={anyAssignee}
- className="ml-1 text-xs text-secondary"
- size="xsmall"
- />
- <IconChevronDown />
- </div>
- )}
- </AssigneeSelect>
- <CustomSeparator />
- {orderBy === 'first_seen' && (
- <>
- <TZLabel
- time={record.first_seen}
- className="border-dotted border-b text-xs ml-1"
- suffix="old"
- delayMs={750}
- />
- <IconChevronRight className="text-quaternary mx-0.5" fontSize="0.75rem" />
- </>
- )}
- {record.last_seen ? (
- <TZLabel time={record.last_seen} className="border-dotted border-b text-xs ml-1" delayMs={750} />
- ) : (
- <LemonSkeleton className="ml-1" />
- )}
+ ) : null}
+ <QuillAssigneeSelect assignee={record.assignee} onChange={onAssigneeChange}>
+ {(anyAssignee) => (
+ <Button variant="outline" size="sm">
+ <AssigneeIconDisplay assignee={anyAssignee} size="xsmall" />
+ <AssigneeLabelDisplay assignee={anyAssignee} className="text-xs text-secondary" size="xsmall" />
+ <SelectTriggerIcon />
+ </Button>
+ )}
+ </QuillAssigneeSelect>
+ </ButtonGroup>
</div>
)
diff --git a/products/error_tracking/frontend/components/VolumeSparkline/EventMarkers.tsx b/products/error_tracking/frontend/components/VolumeSparkline/EventMarkers.tsx
index bcf70e528085..8e5587b48eb7 100644
--- a/products/error_tracking/frontend/components/VolumeSparkline/EventMarkers.tsx
+++ b/products/error_tracking/frontend/components/VolumeSparkline/EventMarkers.tsx
@@ -10,7 +10,6 @@ import type { SparklineEvent } from './types'
export const EVENT_LABEL_BAR_GAP = 10
export const EVENT_LABEL_HEIGHT = 20
const EVENT_LABEL_MIN_GAP = 2
-const ANCHOR_RADIUS = 6
const DEFAULT_EVENT_COLOR = 'black'
export type EventMarkersProps = {
@@ -28,7 +27,7 @@ export const EventMarkers = memo(function EventMarkers({
dates,
onHover,
}: EventMarkersProps): JSX.Element | null {
- const { scales, dimensions, labels, theme } = useChartLayout()
+ const { scales, dimensions, labels } = useChartLayout()
const labelRefs = useRef<(HTMLDivElement | null)[]>([])
const [halfWidths, setHalfWidths] = useState<number[] | null>(null)
@@ -132,14 +131,7 @@ export const EventMarkers = memo(function EventMarkers({
strokeWidth={2}
/>
{/* The dot is a knockout against the chart surface, not literally white. */}
- <circle
- cx={anchorX}
- cy={plotBottom}
- r={ANCHOR_RADIUS}
- fill={theme.backgroundColor ?? 'white'}
- stroke={color}
- strokeWidth={2}
- />
+ <circle cx={anchorX} cy={plotBottom} r={3} fill={color} />
</g>
)
})}
diff --git a/products/error_tracking/frontend/components/VolumeSparkline/VolumeSparkline.stories.tsx b/products/error_tracking/frontend/components/VolumeSparkline/VolumeSparkline.stories.tsx
index 325a227ec167..00f2891434ef 100644
--- a/products/error_tracking/frontend/components/VolumeSparkline/VolumeSparkline.stories.tsx
+++ b/products/error_tracking/frontend/components/VolumeSparkline/VolumeSparkline.stories.tsx
@@ -90,7 +90,7 @@ export const CompactIssuesList: Story = {
data: buildData(),
layout: 'compact',
xAxis: 'minimal',
- className: 'w-[200px] h-10',
+ className: 'w-[200px] h-20',
},
}
diff --git a/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/ErrorTrackingIssueScene.tsx b/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/ErrorTrackingIssueScene.tsx
index e965340a2a33..da3ce3872d90 100644
--- a/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/ErrorTrackingIssueScene.tsx
+++ b/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/ErrorTrackingIssueScene.tsx
@@ -12,9 +12,9 @@ import { NotFound } from 'lib/components/NotFound'
import { Resizer } from 'lib/components/Resizer/Resizer'
import { ResizerLogicProps, resizerLogic } from 'lib/components/Resizer/resizerLogic'
import { SceneMenuBarFileItems } from 'lib/components/Scenes/SceneMenuBarFileItems'
-import ViewRecordingsPlaylistButton from 'lib/components/ViewRecordingButton/ViewRecordingsPlaylistButton'
import { useFeatureFlag } from 'lib/hooks/useFeatureFlag'
import { useWindowSize } from 'lib/hooks/useWindowSize'
+import { Button, ButtonGroup } from 'lib/ui/quill'
import { newInternalTab } from 'lib/utils/newInternalTab'
import { SceneExport } from 'scenes/sceneTypes'
import { urls } from 'scenes/urls'
@@ -30,7 +30,6 @@ import { miniBreakdownsLogic } from '../../components/Breakdowns/miniBreakdownsL
import { getEventMarkerColor } from '../../components/EventsTable/EventsTable'
import { ExceptionCard } from '../../components/ExceptionCard'
import { StackTraceActions } from '../../components/ExceptionCard/Tabs/StackTraceTab/StackTraceActions'
-import { StatusIndicator } from '../../components/Indicators'
import { issueActionsLogic } from '../../components/IssueActions/issueActionsLogic'
import {
ERROR_TRACKING_ISSUE_SCENE_LOGIC_KEY,
@@ -38,6 +37,7 @@ import {
} from '../../components/IssueFilters/issueFiltersLogic'
import { IssueSeveritySelect } from '../../components/IssueSeveritySelect'
import { IssueStatusButton } from '../../components/IssueStatusButton'
+import { IssueStatusSelect } from '../../components/IssueStatusSelect'
import { ErrorTrackingSetupPrompt } from '../../components/SetupPrompt/SetupPrompt'
import { StyleVariables } from '../../components/StyleVariables'
import { useErrorTagRenderer } from '../../hooks/use-error-tag-renderer'
@@ -146,32 +146,44 @@ export function ErrorTrackingIssueScene(): JSX.Element {
actions={
isMobile ? undefined : (
<div className="flex items-center gap-1">
- <StatusIndicator status={issue.status} withTooltip />
- {hasSeverityRules ? (
- <IssueSeveritySelect
- severity={issue.severity}
- onChange={updateSeverity}
- loading={severityUpdateInFlightIds.includes(issue.id)}
+ <ButtonGroup>
+ <IssueStatusSelect
+ status={issue.status}
+ onChange={updateStatus}
+ size="default"
/>
- ) : null}
- <IssueAssigneeSelect
- assignee={issue.assignee}
- onChange={updateAssignee}
- disabled={issue.status != 'active'}
- />
- <ViewRecordingsPlaylistButton
- filters={{
- ...getIssueReplayDateRange(
- issue.first_seen,
- lastSeen,
- selectedEvent?.timestamp ?? initialEventTimestamp
- ),
- filter_group: getIssueReplayFilterGroup(issue.id),
+ {hasSeverityRules ? (
+ <IssueSeveritySelect
+ severity={issue.severity}
+ onChange={updateSeverity}
+ loading={severityUpdateInFlightIds.includes(issue.id)}
+ size="default"
+ />
+ ) : null}
+ <IssueAssigneeSelect
+ assignee={issue.assignee}
+ onChange={updateAssignee}
+ disabled={issue.status != 'active'}
+ />
+ </ButtonGroup>
+ <Button
+ variant="outline"
+ onClick={() => {
+ const url = urls.replay(ReplayTabs.Home, {
+ ...getIssueReplayDateRange(
+ issue.first_seen,
+ lastSeen,
+ selectedEvent?.timestamp ?? initialEventTimestamp
+ ),
+ filter_group: getIssueReplayFilterGroup(issue.id),
+ })
+ newInternalTab(url)
}}
- size="small"
- type="secondary"
data-attr="error-tracking-issue-view-recordings"
- />
+ >
+ View recordings
+ <IconRewindPlay />
+ </Button>
<IssueStatusButton status={issue.status} onChange={updateStatus} />
</div>
)
@@ -180,19 +192,26 @@ export function ErrorTrackingIssueScene(): JSX.Element {
{isMobile && (
<div className="flex items-center gap-1.5 px-2 py-1.5 border-b flex-wrap">
- <StatusIndicator status={issue.status} withTooltip />
- {hasSeverityRules ? (
- <IssueSeveritySelect
- severity={issue.severity}
- onChange={updateSeverity}
- loading={severityUpdateInFlightIds.includes(issue.id)}
+ <ButtonGroup>
+ <IssueStatusSelect
+ status={issue.status}
+ onChange={updateStatus}
+ size="default"
/>
- ) : null}
- <IssueAssigneeSelect
- assignee={issue.assignee}
- onChange={updateAssignee}
- disabled={issue.status != 'active'}
- />
+ {hasSeverityRules ? (
+ <IssueSeveritySelect
+ severity={issue.severity}
+ onChange={updateSeverity}
+ loading={severityUpdateInFlightIds.includes(issue.id)}
+ size="default"
+ />
+ ) : null}
+ <IssueAssigneeSelect
+ assignee={issue.assignee}
+ onChange={updateAssignee}
+ disabled={issue.status != 'active'}
+ />
+ </ButtonGroup>
<IssueStatusButton status={issue.status} onChange={updateStatus} />
{!mobileDetailOpen && (
<LemonButton
diff --git a/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/ScenePanel/IssueAssigneeSelect.tsx b/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/ScenePanel/IssueAssigneeSelect.tsx
index 741d216e1a71..a082ed3e50b5 100644
--- a/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/ScenePanel/IssueAssigneeSelect.tsx
+++ b/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/ScenePanel/IssueAssigneeSelect.tsx
@@ -1,10 +1,9 @@
-import { ButtonPrimitive } from 'lib/ui/Button/ButtonPrimitives'
-import { MenuOpenIndicator } from 'lib/ui/Menus/Menus'
+import { Button, SelectTriggerIcon } from 'lib/ui/quill'
import { ErrorTrackingIssueAssignee } from '~/queries/schema/schema-general'
import { AssigneeIconDisplay, AssigneeLabelDisplay } from '../../../components/Assignee/AssigneeDisplay'
-import { AssigneeSelect } from '../../../components/Assignee/AssigneeSelect'
+import { QuillAssigneeSelect } from '../../../components/Assignee/QuillAssigneeSelect'
export const IssueAssigneeSelect = ({
assignee,
@@ -16,18 +15,14 @@ export const IssueAssigneeSelect = ({
onChange: (assignee: ErrorTrackingIssueAssignee | null) => void
}): JSX.Element => {
return (
- <div>
- <AssigneeSelect assignee={assignee} onChange={onChange}>
- {(anyAssignee, isOpen) => (
- <ButtonPrimitive disabled={disabled} data-state={isOpen ? 'open' : 'closed'}>
- <div className="flex items-center">
- <AssigneeIconDisplay assignee={anyAssignee} size="small" />
- <AssigneeLabelDisplay assignee={anyAssignee} className="ml-1" size="small" />
- </div>
- {!disabled && <MenuOpenIndicator className="ml-auto" />}
- </ButtonPrimitive>
- )}
- </AssigneeSelect>
- </div>
+ <QuillAssigneeSelect assignee={assignee} onChange={onChange}>
+ {(anyAssignee) => (
+ <Button variant="outline" disabled={disabled}>
+ <AssigneeIconDisplay assignee={anyAssignee} size="xsmall" />
+ <AssigneeLabelDisplay assignee={anyAssignee} className="text-xs text-secondary" size="xsmall" />
+ {!disabled && <SelectTriggerIcon />}
+ </Button>
+ )}
+ </QuillAssigneeSelect>
)
}
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 ad108c42550a..38f698908bc3 100644
--- a/products/error_tracking/frontend/scenes/ErrorTrackingScene/tabs/issues/IssuesList.tsx
+++ b/products/error_tracking/frontend/scenes/ErrorTrackingScene/tabs/issues/IssuesList.tsx
@@ -1,9 +1,10 @@
import { BindLogic, useValues } from 'kea'
import { useMemo } from 'react'
+import { IconArrowRight } from '@posthog/icons'
import { Tooltip } from '@posthog/lemon-ui'
-import { cn } from 'lib/utils/css-classes'
+import { dayjs } from 'lib/dayjs'
import { humanFriendlyLargeNumber } from 'lib/utils/numbers'
import { SceneStickyBar } from '~/layout/scenes/components/SceneStickyBar'
@@ -19,6 +20,7 @@ import {
import { InsightLogicProps } from '~/types'
import { IssueActions } from 'products/error_tracking/frontend/components/IssueActions/IssueActions'
+import { issueQueryOptionsLogic } from 'products/error_tracking/frontend/components/IssueQueryOptions/issueQueryOptionsLogic'
import { IssueListTitleColumn, IssueListTitleHeader } from 'products/error_tracking/frontend/components/TableColumns'
import { errorTrackingVolumeSparklineLogic } from 'products/error_tracking/frontend/components/VolumeSparkline/errorTrackingVolumeSparklineLogic'
import {
@@ -40,6 +42,7 @@ const VolumeColumn: QueryContextColumnComponent = (props) => {
const sparklineKey = record.id ?? 'issue-unknown'
const baseData = useSparklineData(record.aggregations, ERROR_TRACKING_LISTING_RESOLUTION)
const { spikeEventsByIssueId } = useValues(batchSpikeEventsLogic)
+ const { orderBy } = useValues(issueQueryOptionsLogic)
const spikeEvents = record.id ? (spikeEventsByIssueId[record.id] ?? []) : []
const data = useMemo(() => applyVolumeSpikeHighlights(baseData, spikeEvents), [baseData, spikeEvents])
@@ -48,7 +51,7 @@ const VolumeColumn: QueryContextColumnComponent = (props) => {
return (
<div className="flex w-full min-w-0 justify-center">
<div className="flex w-56 max-w-full min-w-0 flex-col">
- <div className="h-12 min-h-12 w-full">
+ <div className="h-20 min-h-20 w-full">
<VolumeSparkline
className="h-full"
data={data}
@@ -57,18 +60,29 @@ const VolumeColumn: QueryContextColumnComponent = (props) => {
sparklineKey={sparklineKey}
/>
</div>
- <div
- className={cn(
- 'flex h-3 w-full items-center justify-between gap-1 px-px text-[9px] leading-none text-muted',
- isBarHighlighted ? 'opacity-100' : 'opacity-0'
+ <div className="flex h-4 w-full items-center justify-between gap-1 px-1 text-[10px] leading-none text-muted">
+ {isBarHighlighted && hoveredDatum ? (
+ <>
+ <span className="min-w-0 truncate">{formatCompactVolumeHoverDate(hoveredDatum)}</span>
+ <span className="min-w-0 shrink-0 text-right tabular-nums">
+ {formatCompactVolumeHoverOccurrences(hoveredDatum)}
+ </span>
+ </>
+ ) : (
+ <div className="flex w-full items-center justify-end gap-1">
+ {orderBy === 'first_seen' ? (
+ <>
+ <span className="whitespace-nowrap">{dayjs(record.first_seen).fromNow()}</span>
+ <IconArrowRight className="size-2.5 shrink-0" />
+ </>
+ ) : null}
+ {record.last_seen ? (
+ <span className="whitespace-nowrap text-right">
+ {dayjs(record.last_seen).fromNow()}
+ </span>
+ ) : null}
+ </div>
)}
- >
- <span className="min-w-0 truncate">
- {hoveredDatum ? formatCompactVolumeHoverDate(hoveredDatum) : '\u00a0'}
- </span>
- <span className="min-w-0 shrink-0 text-right tabular-nums">
- {hoveredDatum ? formatCompactVolumeHoverOccurrences(hoveredDatum) : '\u00a0'}
- </span>
</div>
</div>
</div>