Skip to content

Commit

Permalink
fix: show names on frontend (#20918)
Browse files Browse the repository at this point in the history
  • Loading branch information
daibhin authored Mar 14, 2024
1 parent 8b21327 commit cd2ead1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { LemonButton, LemonCollapse, Spinner } from '@posthog/lemon-ui'
import { useActions, useValues } from 'kea'
import { urls } from 'scenes/urls'

import { ErrorClusterSample } from '~/types'

import { sessionRecordingErrorsLogic } from './sessionRecordingErrorsLogic'

export function SessionRecordingErrors(): JSX.Element {
Expand Down Expand Up @@ -45,11 +47,11 @@ const ErrorPanelHeader = ({
}: {
occurrenceCount: number
sessionCount: number
example: { session_id: string; message: string }
example: ErrorClusterSample
}): JSX.Element => {
return (
<div className="w-full flex justify-between items-center gap-2">
<span className="truncate">{example.message}</span>
<span className="truncate">{example.input}</span>
<div className="flex items-center gap-2">
<span className="text-muted">
{occurrenceCount} occurrences / {sessionCount} sessions
Expand All @@ -62,12 +64,12 @@ const ErrorPanelHeader = ({
)
}

const ErrorPanelContent = ({ samples }: { samples: { session_id: string; message: string }[] }): JSX.Element => {
const ErrorPanelContent = ({ samples }: { samples: ErrorClusterSample[] }): JSX.Element => {
return (
<div className="flex flex-col space-y-2">
{samples.map((error) => (
<div key={error.session_id} className="flex justify-between items-center">
<span>{error.message}</span>
<span>{error.input}</span>
<LemonButton type="secondary" to={urls.replaySingle(error.session_id)}>
Watch recording
</LemonButton>
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -896,9 +896,11 @@ export interface SessionRecordingsResponse {
has_next: boolean
}

export type ErrorClusterSample = { session_id: string; input: string }

type ErrorCluster = {
cluster: number
samples: { session_id: string; message: string }[]
samples: ErrorClusterSample[]
occurrences: number
unique_sessions: number
}
Expand Down

0 comments on commit cd2ead1

Please sign in to comment.