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.

fix(replay-vision): fix word spacing in alert threshold sentence (#72920)

Arno Hillen161c07ca1545
diff --git a/products/replay_vision/frontend/replay_scanners/ActionEditorScene.tsx b/products/replay_vision/frontend/replay_scanners/ActionEditorScene.tsx
index c905ae653d2e..f003685ffa6f 100644
--- a/products/replay_vision/frontend/replay_scanners/ActionEditorScene.tsx
+++ b/products/replay_vision/frontend/replay_scanners/ActionEditorScene.tsx
@@ -452,44 +452,48 @@ function ConditionSection({ scannerId }: { scannerId: string }): JSX.Element {
{!everyMatch && (
<div className="flex flex-wrap items-center gap-2">
- <span className="text-sm">when the</span>
{isScorer ? (
- <LemonSelect
- size="small"
- value={actionForm.alert_metric}
- onChange={(value) => {
- if (!value) {
- return
- }
- setActionFormValue('alert_metric', value)
- // Count thresholds are always "at least" (the direction control is
- // hidden for them), so switching back to count clears any "at most".
- if (value === VisionAlertMetricEnumApi.Count) {
- setActionFormValue('alert_direction', VisionAlertDirectionEnumApi.Above)
- }
- }}
- options={[
- { value: VisionAlertMetricEnumApi.Count, label: 'number of matches' },
- { value: VisionAlertMetricEnumApi.AvgScore, label: 'average score' },
- ]}
- data-attr="vision-action-alert-metric"
- />
- ) : (
- <span className="text-sm">number of matches</span>
- )}
- {isAvg ? (
- <LemonSelect
- size="small"
- value={actionForm.alert_direction}
- onChange={(value) => value && setActionFormValue('alert_direction', value)}
- options={[
- { value: VisionAlertDirectionEnumApi.Above, label: 'is at least' },
- { value: VisionAlertDirectionEnumApi.Below, label: 'is at most' },
- ]}
- data-attr="vision-action-alert-direction"
- />
+ <>
+ <span className="text-sm">when the</span>
+ <LemonSelect
+ size="small"
+ value={actionForm.alert_metric}
+ onChange={(value) => {
+ if (!value) {
+ return
+ }
+ setActionFormValue('alert_metric', value)
+ // Count thresholds are always "at least" (the direction control is
+ // hidden for them), so switching back to count clears any "at most".
+ if (value === VisionAlertMetricEnumApi.Count) {
+ setActionFormValue('alert_direction', VisionAlertDirectionEnumApi.Above)
+ }
+ }}
+ options={[
+ { value: VisionAlertMetricEnumApi.Count, label: 'number of matches' },
+ { value: VisionAlertMetricEnumApi.AvgScore, label: 'average score' },
+ ]}
+ data-attr="vision-action-alert-metric"
+ />
+ {isAvg ? (
+ <LemonSelect
+ size="small"
+ value={actionForm.alert_direction}
+ onChange={(value) => value && setActionFormValue('alert_direction', value)}
+ options={[
+ { value: VisionAlertDirectionEnumApi.Above, label: 'is at least' },
+ { value: VisionAlertDirectionEnumApi.Below, label: 'is at most' },
+ ]}
+ data-attr="vision-action-alert-direction"
+ />
+ ) : (
+ <span className="text-sm">is at least</span>
+ )}
+ </>
) : (
- <span className="text-sm">is at least</span>
+ // One span, not one per word: adjacent flex items get the 8px control
+ // gap, which reads as doubled spacing between plain words.
+ <span className="text-sm">when the number of matches is at least</span>
)}
<LemonInput
type="number"