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(workflows): keep the page visible while giving preview feedback and clarify step reach (#120103)

Daniel Marchuke8a6e86afdfc
diff --git a/products/workflows/frontend/Broadcasts/BroadcastsFeaturePreview.tsx b/products/workflows/frontend/Broadcasts/BroadcastsFeaturePreview.tsx
index ac21380b6329..e86e3fe23909 100644
--- a/products/workflows/frontend/Broadcasts/BroadcastsFeaturePreview.tsx
+++ b/products/workflows/frontend/Broadcasts/BroadcastsFeaturePreview.tsx
@@ -14,7 +14,7 @@ export function BroadcastsFeaturePreview(): JSX.Element {
surface="broadcasts"
dismissKey="broadcasts-feature-preview"
prompt="Broadcasts is new. Is it doing what you need?"
- modalTitle="Help shape broadcasts"
+ feedbackTitle="Help shape broadcasts"
feedbackPlaceholder="Tell us what works, what doesn’t, or what you’d change"
// Line up with the search box and table below, which sit flush with the tab content.
className="my-2"
diff --git a/products/workflows/frontend/Broadcasts/ComposerDraftFeedback.tsx b/products/workflows/frontend/Broadcasts/ComposerDraftFeedback.tsx
index 50ef13ad5964..bf13bb9125a7 100644
--- a/products/workflows/frontend/Broadcasts/ComposerDraftFeedback.tsx
+++ b/products/workflows/frontend/Broadcasts/ComposerDraftFeedback.tsx
@@ -16,7 +16,7 @@ export function ComposerDraftFeedback(): JSX.Element {
surface="broadcasts-composer-draft"
dismissKey="broadcasts-composer-draft-feedback"
prompt="Did PostHog AI get this broadcast right?"
- modalTitle="Help us improve AI drafts"
+ feedbackTitle="Help us improve AI drafts"
feedbackPlaceholder="What did you have to change, or what did it get wrong?"
className="m-0"
data-attr="broadcasts-composer-draft-feedback"
diff --git a/products/workflows/frontend/FeaturePreviewFeedbackBanner.test.tsx b/products/workflows/frontend/FeaturePreviewFeedbackBanner.test.tsx
index 0210a15c2ac3..6f27910cafc0 100644
--- a/products/workflows/frontend/FeaturePreviewFeedbackBanner.test.tsx
+++ b/products/workflows/frontend/FeaturePreviewFeedbackBanner.test.tsx
@@ -24,7 +24,7 @@ const renderBanner = (dismissKey = 'test-banner'): void => {
surface="broadcasts"
dismissKey={dismissKey}
prompt="Is this doing what you need?"
- modalTitle="Help shape it"
+ feedbackTitle="Help shape it"
feedbackPlaceholder="What would you change?"
data-attr="test-banner"
/>
@@ -44,7 +44,7 @@ describe('FeaturePreviewFeedbackBanner', () => {
})
it('records the rating against the survey as soon as a thumb is clicked', () => {
- // Someone who rates and never opens the modal still has to count, so the rating cannot wait
+ // Someone who rates and never writes a note still has to count, so the rating cannot wait
// for the written feedback.
renderBanner()
fireEvent.click(screen.getByTestId('test-banner-thumbs-up'))
diff --git a/products/workflows/frontend/FeaturePreviewFeedbackBanner.tsx b/products/workflows/frontend/FeaturePreviewFeedbackBanner.tsx
index f6a031dc9c94..71875a387a52 100644
--- a/products/workflows/frontend/FeaturePreviewFeedbackBanner.tsx
+++ b/products/workflows/frontend/FeaturePreviewFeedbackBanner.tsx
@@ -3,7 +3,7 @@ import posthog from 'posthog-js'
import { useEffect, useState } from 'react'
import { IconThumbsDown, IconThumbsDownFilled, IconThumbsUp, IconThumbsUpFilled } from '@posthog/icons'
-import { LemonBanner, LemonButton, LemonModal, LemonTextArea } from '@posthog/lemon-ui'
+import { LemonBanner, LemonButton, LemonTextArea } from '@posthog/lemon-ui'
import { lemonBannerLogic } from 'lib/lemon-ui/LemonBanner/lemonBannerLogic'
import { uuid } from 'lib/utils/dom'
@@ -29,7 +29,7 @@ export interface FeaturePreviewFeedbackBannerProps {
/** Remembers a dismissal per person, so the banner does not come back on every visit. */
dismissKey: string
prompt: string
- modalTitle: string
+ feedbackTitle: string
feedbackPlaceholder: string
/** Spacing around the banner, for surfaces whose content isn't inset. */
className?: string
@@ -38,8 +38,9 @@ export interface FeaturePreviewFeedbackBannerProps {
/**
* The thumbs-up/thumbs-down strip a feature preview carries while we are still deciding whether to
- * keep it. The rating is recorded on click, so a rating survives someone who never opens the modal,
- * and the written note lands on the same submission id rather than a second response.
+ * keep it. The rating is recorded on click, so a rating survives someone who never writes a note,
+ * and the written note lands on the same submission id rather than a second response. The note box
+ * opens inside the banner, so the page stays visible while someone describes it.
*/
export function FeaturePreviewFeedbackBanner({
surveyId,
@@ -48,7 +49,7 @@ export function FeaturePreviewFeedbackBanner({
surface,
dismissKey,
prompt,
- modalTitle,
+ feedbackTitle,
feedbackPlaceholder,
className = 'm-2',
'data-attr': dataAttr,
@@ -57,6 +58,7 @@ export function FeaturePreviewFeedbackBanner({
const [submissionId, setSubmissionId] = useState<string | null>(null)
const [feedbackText, setFeedbackText] = useState('')
const [feedbackOpen, setFeedbackOpen] = useState(false)
+ const [feedbackSent, setFeedbackSent] = useState(false)
// LemonBanner renders nothing once the dismissal is persisted, so without this the impression
// is recorded on every visit for a banner nobody sees, and the response rate reads far too low.
const { isDismissed } = useValues(lemonBannerLogic({ dismissKey }))
@@ -107,14 +109,17 @@ export function FeaturePreviewFeedbackBanner({
feedback_surface: surface,
})
setFeedbackOpen(false)
+ setFeedbackSent(true)
setFeedbackText('')
}
return (
- <>
- <LemonBanner type="info" dismissKey={dismissKey} className={className}>
+ <LemonBanner type="info" dismissKey={dismissKey} className={className}>
+ <div className="flex flex-col gap-2">
<div className="flex flex-wrap items-center justify-between gap-2">
- <div className="text-secondary">{rating ? 'Thanks, your rating is saved.' : prompt}</div>
+ <div className="text-secondary">
+ {feedbackSent ? 'Thanks for the feedback.' : rating ? 'Thanks, your rating is saved.' : prompt}
+ </div>
<div className="flex items-center gap-1">
<LemonButton
type={rating === 'useful' ? 'primary' : 'secondary'}
@@ -136,33 +141,36 @@ export function FeaturePreviewFeedbackBanner({
/>
</div>
</div>
- </LemonBanner>
- <LemonModal
- title={modalTitle}
- description="Thanks, your rating is saved. What would make this better?"
- isOpen={feedbackOpen}
- onClose={() => setFeedbackOpen(false)}
- data-attr={dataAttr ? `${dataAttr}-feedback` : undefined}
- footer={
- <div className="flex justify-end gap-2">
- <LemonButton type="secondary" onClick={() => setFeedbackOpen(false)}>
- Not now
- </LemonButton>
- <LemonButton type="primary" disabled={!feedbackText.trim()} onClick={submitFeedback}>
- Send feedback
- </LemonButton>
+ {feedbackOpen ? (
+ <div className="flex flex-col gap-2" data-attr={dataAttr ? `${dataAttr}-feedback` : undefined}>
+ <div>
+ <div className="font-semibold">{feedbackTitle}</div>
+ <div className="text-secondary">What would make this better?</div>
+ </div>
+ <LemonTextArea
+ value={feedbackText}
+ onChange={setFeedbackText}
+ placeholder={feedbackPlaceholder}
+ minRows={3}
+ autoFocus
+ data-attr={dataAttr ? `${dataAttr}-feedback-text` : undefined}
+ />
+ <div className="flex justify-end gap-2">
+ <LemonButton type="secondary" size="small" onClick={() => setFeedbackOpen(false)}>
+ Not now
+ </LemonButton>
+ <LemonButton
+ type="primary"
+ size="small"
+ disabled={!feedbackText.trim()}
+ onClick={submitFeedback}
+ >
+ Send feedback
+ </LemonButton>
+ </div>
</div>
- }
- >
- <LemonTextArea
- value={feedbackText}
- onChange={setFeedbackText}
- placeholder={feedbackPlaceholder}
- minRows={4}
- autoFocus
- data-attr={dataAttr ? `${dataAttr}-feedback-text` : undefined}
- />
- </LemonModal>
- </>
+ ) : null}
+ </div>
+ </LemonBanner>
)
}
diff --git a/products/workflows/frontend/Workflows/hogflows/tree/HogFlowTreeFeaturePreview.tsx b/products/workflows/frontend/Workflows/hogflows/tree/HogFlowTreeFeaturePreview.tsx
index d57c2659d950..df31177b291b 100644
--- a/products/workflows/frontend/Workflows/hogflows/tree/HogFlowTreeFeaturePreview.tsx
+++ b/products/workflows/frontend/Workflows/hogflows/tree/HogFlowTreeFeaturePreview.tsx
@@ -13,7 +13,7 @@ export function HogFlowTreeFeaturePreview(): JSX.Element {
surface="workflow_tree_editor"
dismissKey="workflow-tree-feature-preview"
prompt="We’re trialling a new list based workflow view. What do you think?"
- modalTitle="Help shape the new workflow view"
+ feedbackTitle="Help shape the new workflow view"
feedbackPlaceholder="Tell us what works, what doesn’t, or what you’d change"
data-attr="workflow-tree-feature-preview"
/>
diff --git a/products/workflows/frontend/Workflows/overview/WorkflowOverviewFeedback.tsx b/products/workflows/frontend/Workflows/overview/WorkflowOverviewFeedback.tsx
index 93521bec7c73..cae8d8f0a057 100644
--- a/products/workflows/frontend/Workflows/overview/WorkflowOverviewFeedback.tsx
+++ b/products/workflows/frontend/Workflows/overview/WorkflowOverviewFeedback.tsx
@@ -13,7 +13,7 @@ export function WorkflowOverviewFeedback(): JSX.Element {
surface="workflow_overview_tab"
dismissKey="workflow-overview-feature-preview"
prompt="We're trying out an overview for workflows. Is it useful?"
- modalTitle="Help shape the workflow overview"
+ feedbackTitle="Help shape the workflow overview"
feedbackPlaceholder="Tell us what's useful, what's missing, or what you'd change"
className=""
data-attr="workflow-overview-feature-preview"
diff --git a/products/workflows/frontend/Workflows/overview/WorkflowStepReach.tsx b/products/workflows/frontend/Workflows/overview/WorkflowStepReach.tsx
index c11c49528455..089f3a1b510d 100644
--- a/products/workflows/frontend/Workflows/overview/WorkflowStepReach.tsx
+++ b/products/workflows/frontend/Workflows/overview/WorkflowStepReach.tsx
@@ -1,6 +1,7 @@
import { useActions, useValues } from 'kea'
-import { LemonButton, LemonSkeleton, LemonTag, Link } from '@posthog/lemon-ui'
+import { IconInfo } from '@posthog/icons'
+import { LemonButton, LemonSkeleton, LemonTag, Link, Tooltip } from '@posthog/lemon-ui'
import { LemonProgress } from 'lib/lemon-ui/LemonProgress'
import { humanFriendlyNumber, percentage } from 'lib/utils/numbers'
@@ -74,10 +75,14 @@ export function WorkflowStepReach({ id, logicKey }: { id: string; logicKey: stri
data-attr="workflow-overview-step-reach"
>
<div className="flex flex-col gap-1">
- <h3 className="mb-0 text-base font-semibold">Step reach</h3>
+ <h3 className="mb-0 flex items-center gap-1 text-base font-semibold">
+ Step reach
+ <Tooltip title="A run that is waiting at a step counts for that step once it moves on.">
+ <IconInfo className="text-muted" />
+ </Tooltip>
+ </h3>
<span className="text-xs text-muted">
- How many runs finished each step in this date range, as a share of runs started. Runs still waiting
- at a step count once they move on.
+ How many runs got past each step in this date range, as a share of runs started.
</span>
</div>
{stepTotalsFailed || healthTotalsFailed ? (