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(signals): let users steer Create PR from an inbox report (#91291)

posthog[bot]47e2e99af919
diff --git a/frontend/snapshots.yml b/frontend/snapshots.yml
index 2b34334424f2..d5a755631d07 100644
--- a/frontend/snapshots.yml
+++ b/frontend/snapshots.yml
@@ -6868,6 +6868,10 @@ snapshots:
hash: v1.k794b7964.4ab1f8cb97f347a2aae442ca814c70c538c54e4a9efb1c3cdd6681a56cad5e90.wVmcanELl0wz7-rhcnN8K5MGXmKMMxXELkYcCEpCxKs
scenes-app-inbox-cards--skeleton--light:
hash: v1.k794b7964.24c19ab5df1e4ccb843b1ad726752e3a98aeadaa08595e66cb4b41aff1a9e9a1.Y3z44tkU4jsAYUyXxfl72fTuZ0MKA6_S6TTNCKt5jSg
+ scenes-app-inbox-createprbutton--default--dark:
+ hash: v1.k794b7964.48c126cb2fbf7e2ff90a961fec1dbe587726b4fe10346c933e7948f0c5722fc6.o3rRliF1DHQt7OSgtsMeThXxAYCAkiUcKqRxRRaqvMg
+ scenes-app-inbox-createprbutton--default--light:
+ hash: v1.k794b7964.afd9c8a70584e887de98dc27361817c64057c32da340ceb85f4584212bfb2dad.J1FNKAVCovRg8LIuY9uoXEFCuQ6MlUp1kFs6aJ33X5Y
scenes-app-inbox-detail--pull-request--dark:
hash: v1.k794b7964.e3d35a1f32d39211cf8bd41914c83ec6e4ed9e0251e8b883a8fa62c048dc4165.na0HIQko2FwF9KTcKxD66kvttld6IbR_S0bejyK_1hs
scenes-app-inbox-detail--pull-request--light:
diff --git a/products/signals/frontend/inbox/components/detail/CreatePrButton.stories.tsx b/products/signals/frontend/inbox/components/detail/CreatePrButton.stories.tsx
new file mode 100644
index 000000000000..dc4ab3cb79aa
--- /dev/null
+++ b/products/signals/frontend/inbox/components/detail/CreatePrButton.stories.tsx
@@ -0,0 +1,33 @@
+import type { Meta, StoryObj } from '@storybook/react'
+import { waitFor, within } from '@testing-library/dom'
+import userEvent from '@testing-library/user-event'
+
+import { makeReport } from '../../__mocks__/inboxMocks'
+import { CreatePrButton } from './CreatePrButton'
+
+const meta: Meta<typeof CreatePrButton> = {
+ title: 'Scenes-App/Inbox/CreatePrButton',
+ component: CreatePrButton,
+ parameters: { layout: 'centered', testOptions: { snapshotTargetSelector: '.Popover' } },
+}
+export default meta
+
+type Story = StoryObj<typeof CreatePrButton>
+
+// The popover is closed until the trigger is pressed, so the story opens it — otherwise the
+// snapshot is of the same small button and the note box under review never renders. `findByText`
+// rather than `getByText`: the trigger mounts a kea logic chain reaching organization and user
+// state, so on a slow runner the play function can reach an empty canvas and fail the story.
+const openPopover: Story['play'] = async ({ canvasElement }) => {
+ await userEvent.click(await within(canvasElement).findByText('Create PR'))
+ await waitFor(() => {
+ if (!document.querySelector('.Popover')) {
+ throw new Error('popover not open yet')
+ }
+ })
+}
+
+export const Default: Story = {
+ render: () => <CreatePrButton report={makeReport({ title: 'Exceptions spiked after the 18 June deploy' })} />,
+ play: openPopover,
+}
diff --git a/products/signals/frontend/inbox/components/detail/CreatePrButton.test.tsx b/products/signals/frontend/inbox/components/detail/CreatePrButton.test.tsx
new file mode 100644
index 000000000000..48e4ca35e918
--- /dev/null
+++ b/products/signals/frontend/inbox/components/detail/CreatePrButton.test.tsx
@@ -0,0 +1,81 @@
+import '@testing-library/jest-dom'
+
+import { cleanup, render, screen } from '@testing-library/react'
+import userEvent from '@testing-library/user-event'
+
+import { initKeaTests } from '~/test/init'
+
+import { captureInboxReportAction } from '../../inboxAnalytics'
+import { inboxTaskKickoffLogic } from '../../inboxTaskKickoffLogic'
+import { SignalReport, SignalReportStatus } from '../../types'
+import { CreatePrButton } from './CreatePrButton'
+
+jest.mock('../../inboxAnalytics', () => ({
+ ...jest.requireActual('../../inboxAnalytics'),
+ captureInboxReportAction: jest.fn(),
+}))
+
+function makeReport(): SignalReport {
+ return {
+ id: 'report-1',
+ title: 'Exceptions spiked',
+ summary: 'summary',
+ status: SignalReportStatus.READY,
+ total_weight: 0,
+ signal_count: 1,
+ relevant_user_count: null,
+ artefact_count: 0,
+ is_suggested_reviewer: false,
+ created_at: '2026-06-11T10:00:00Z',
+ updated_at: '2026-06-11T10:00:00Z',
+ } satisfies SignalReport
+}
+
+describe('CreatePrButton', () => {
+ let createPrFromReport: jest.Mock
+
+ beforeEach(() => {
+ initKeaTests()
+ inboxTaskKickoffLogic.mount()
+ createPrFromReport = jest.fn()
+ jest.spyOn(inboxTaskKickoffLogic.actions, 'createPrFromReport').mockImplementation(createPrFromReport)
+ jest.mocked(captureInboxReportAction).mockClear()
+ })
+
+ afterEach(() => {
+ cleanup()
+ jest.restoreAllMocks()
+ })
+
+ async function openPopover(): Promise<ReturnType<typeof userEvent.setup>> {
+ const user = userEvent.setup()
+ render(<CreatePrButton report={makeReport()} />)
+ await user.click(screen.getByText('Create PR'))
+ return user
+ }
+
+ it('passes a typed note to the agent and marks the action as steered', async () => {
+ // The whole feature: a note in the box has to reach the prompt, or steering does nothing. The
+ // `has_feedback` flag is how we compare steered runs against unsteered ones.
+ const user = await openPopover()
+
+ await user.type(screen.getByRole('textbox'), ' Put the fix behind a flag. ')
+ await user.click(screen.getByTestId('inbox-report-create-pr-submit'))
+
+ expect(createPrFromReport).toHaveBeenCalledWith(
+ expect.objectContaining({ id: 'report-1' }),
+ 'Put the fix behind a flag.'
+ )
+ expect(jest.mocked(captureInboxReportAction).mock.calls[0][0].extra).toEqual({ has_feedback: true })
+ })
+
+ it('fires with no note when the box is empty, exactly as the old button did', async () => {
+ // Empty is the common case and must stay a one-press action, with no feedback appended.
+ const user = await openPopover()
+
+ await user.click(screen.getByTestId('inbox-report-create-pr-submit'))
+
+ expect(createPrFromReport).toHaveBeenCalledWith(expect.objectContaining({ id: 'report-1' }), undefined)
+ expect(jest.mocked(captureInboxReportAction).mock.calls[0][0].extra).toEqual({ has_feedback: false })
+ })
+})
diff --git a/products/signals/frontend/inbox/components/detail/CreatePrButton.tsx b/products/signals/frontend/inbox/components/detail/CreatePrButton.tsx
new file mode 100644
index 000000000000..886a29c4d4ed
--- /dev/null
+++ b/products/signals/frontend/inbox/components/detail/CreatePrButton.tsx
@@ -0,0 +1,121 @@
+import { useActions, useValues } from 'kea'
+import { useRef, useState } from 'react'
+
+import { IconChevronDown, IconPullRequest } from '@posthog/icons'
+import { LemonButton, lemonToast } from '@posthog/lemon-ui'
+
+import { LemonTextArea } from 'lib/lemon-ui/LemonTextArea'
+import { Popover } from 'lib/lemon-ui/Popover'
+
+import { captureInboxReportAction } from '../../inboxAnalytics'
+import { inboxTaskKickoffLogic } from '../../inboxTaskKickoffLogic'
+import { inboxReportDetailLogic } from '../../logics/inboxReportDetailLogic'
+import { SignalReport } from '../../types'
+
+// Same string desktop uses, so the note reads the same on both surfaces.
+const PLACEHOLDER = 'Add direction for the agent (optional)…'
+
+/**
+ * The detail-pane "Create PR" action. It opens a popover with an optional note instead of firing on
+ * click, so the reader can steer the agent (behind a flag, backend only, skip the migration) at the
+ * moment they have the most context. An empty note behaves exactly as the old fire-on-click button.
+ *
+ * A component, not a `ReportDetailAction`, because actions collapse into a `LemonMenu` on narrow
+ * layouts and a menu item can't own a popover — this mirrors `DiscussReportButton` for the same reason.
+ */
+export function CreatePrButton({ report }: { report: SignalReport }): JSX.Element {
+ const { isCreatingPr, aiConsentDisabledReason } = useValues(inboxTaskKickoffLogic)
+ // Already mounted by `ReportDetail`, so this reads the loaded value rather than starting a fetch.
+ const { hasLiveImplementationTask } = useValues(inboxReportDetailLogic({ reportId: report.id, report }))
+ const { createPrFromReport } = useActions(inboxTaskKickoffLogic)
+ const buttonRef = useRef<HTMLButtonElement>(null)
+ const [isOpen, setIsOpen] = useState(false)
+ const [feedback, setFeedback] = useState('')
+
+ const disabledReason =
+ aiConsentDisabledReason ??
+ (hasLiveImplementationTask
+ ? 'A PR task already exists for this report. Open it in the task log to continue.'
+ : undefined)
+
+ const submit = (): void => {
+ // Cmd/Ctrl + Enter submits straight from the textarea, so it never sees the trigger's
+ // `disabledReason` — each guard has to hold here too, or a press fires a paid run anyway.
+ if (isCreatingPr || hasLiveImplementationTask) {
+ return
+ }
+ if (aiConsentDisabledReason) {
+ lemonToast.error(aiConsentDisabledReason)
+ return
+ }
+ const trimmed = feedback.trim()
+ captureInboxReportAction({
+ report,
+ actionType: 'create_pr',
+ surface: 'detail_pane',
+ extra: { has_feedback: trimmed.length > 0 },
+ })
+ // The popover stays open on its spinner until the run is created and we navigate to it, so a
+ // failure leaves the note to retry with.
+ createPrFromReport(report, trimmed || undefined)
+ }
+
+ return (
+ <Popover
+ visible={isOpen}
+ onClickOutside={(event) => {
+ if (event.target instanceof Node && buttonRef.current?.contains(event.target)) {
+ return
+ }
+ setIsOpen(false)
+ }}
+ placement="bottom-end"
+ overlay={
+ <div className="flex flex-col gap-2 p-2 w-[22rem]">
+ <LemonTextArea
+ value={feedback}
+ onChange={setFeedback}
+ onPressCmdEnter={submit}
+ placeholder={PLACEHOLDER}
+ maxLength={4000}
+ rows={4}
+ autoFocus
+ rightFooter={<span className="text-xs text-tertiary">Cmd/Ctrl + Enter to create PR</span>}
+ />
+ <div className="flex justify-end">
+ <LemonButton
+ type="primary"
+ size="small"
+ icon={<IconPullRequest />}
+ onClick={submit}
+ loading={isCreatingPr}
+ disabledReason={disabledReason}
+ data-attr="inbox-report-create-pr-submit"
+ >
+ Create PR
+ </LemonButton>
+ </div>
+ </div>
+ }
+ >
+ <LemonButton
+ ref={buttonRef}
+ type="primary"
+ size="small"
+ icon={<IconPullRequest />}
+ // Keeps the chevron the plain button never had, so a returning reader sees it now
+ // opens a note box before it fires.
+ sideIcon={<IconChevronDown />}
+ active={isOpen}
+ loading={isCreatingPr}
+ // The trigger always opens, even when consent is missing or a PR task already exists;
+ // the reason sits on the submit inside, next to the thing it blocks.
+ tooltip="Have Self-driving open a pull request for this report"
+ onClick={() => setIsOpen((open) => !open)}
+ data-attr="inbox-report-create-pr"
+ >
+ Create PR
+ </LemonButton>
+ </Popover>
+ )
+}
diff --git a/products/signals/frontend/inbox/components/detail/ReportDetail.tsx b/products/signals/frontend/inbox/components/detail/ReportDetail.tsx
index c9cec0f98463..979ee8154805 100644
--- a/products/signals/frontend/inbox/components/detail/ReportDetail.tsx
+++ b/products/signals/frontend/inbox/components/detail/ReportDetail.tsx
@@ -36,6 +36,7 @@ import { SignalReportPriorityBadge } from '../badges/SignalReportPriorityBadge'
import { isStatusRedundantWithActionability, SignalReportStatusBadge } from '../badges/SignalReportStatusBadge'
import { ConventionalCommitScopeTag } from '../cards/ReportCard'
import { CommitContent } from './artefactTypes'
+import { CreatePrButton } from './CreatePrButton'
import { DetailSection } from './DetailSection'
import { DiscussReportButton } from './DiscussReportButton'
import { PrChecksSection } from './PrChecksSection'
@@ -44,7 +45,7 @@ import { PullRequestDiffPending, PullRequestDiffStat, PullRequestDiffStatSkeleto
import { PullRequestFilesChanged } from './PullRequestFilesChanged'
import { ReportActivitySection } from './ReportActivitySection'
import { ReportChart } from './ReportChart'
-import { useReportDetailActions } from './ReportDetailActions'
+import { canCreateImplementationPr, useReportDetailActions } from './ReportDetailActions'
import { ReportFeedbackFooter } from './ReportFeedbackFooter'
import { ReportSummaryBody } from './ReportSummaryBody'
import { ReportTasksSection } from './ReportTasksSection'
@@ -242,14 +243,14 @@ export function InboxDetailFrame({
// Create PR is the report's main call to action, so it takes the primary slot (styled like
// "Open in GitHub" on PR-bearing reports). The rest render inline as buttons on wide layouts
// and as a standard `LemonMenu` on narrow ones.
- const allReportActions = useReportDetailActions(report)
- const createPrAction = allReportActions.find((action) => action.key === 'create-pr')
+ const reportActions = useReportDetailActions(report)
+ const showCreatePr = canCreateImplementationPr(report)
+ const createPrButton = showCreatePr ? <CreatePrButton report={report} /> : null
// `ReportSummaryBody` renders Create PR under the Solution section, so the header only carries it
// when the summary has no Solution section — otherwise an actionable report shows it twice.
const summaryHasSolution = parseReportSummary(report.summary).sections.some(
(section) => section.kind === 'solution'
)
- const reportActions = allReportActions.filter((action) => action.key !== 'create-pr')
const overflowMenuItems: LemonMenuItem[] = reportActions.map((action) => ({
label: action.label,
icon: action.icon,
@@ -312,7 +313,7 @@ export function InboxDetailFrame({
<ReportSummaryBody
summary={report.summary}
chartPlacements={chartPlacements}
- createPrAction={createPrAction}
+ createPrButton={createPrButton}
pullRequestNote={pullRequestNote}
/>
) : (
@@ -486,19 +487,7 @@ export function InboxDetailFrame({
</LemonButton>
<div className="flex items-center gap-2">
{primaryAction}
- {createPrAction && !summaryHasSolution && (
- <LemonButton
- type="primary"
- size="small"
- icon={createPrAction.icon}
- loading={createPrAction.loading}
- tooltip={createPrAction.disabledReason ? undefined : createPrAction.tooltip}
- disabledReason={createPrAction.disabledReason}
- onClick={createPrAction.onClick}
- >
- {createPrAction.label}
- </LemonButton>
- )}
+ {!summaryHasSolution && createPrButton}
{/* Discuss is always available and stays inline as its own dropdown button. */}
<DiscussReportButton report={report} reportUrl={reportUrl} />
{/* Buttons inline on wide layouts; collapse into a standard LemonMenu kebab below @4xl. */}
diff --git a/products/signals/frontend/inbox/components/detail/ReportDetailActions.tsx b/products/signals/frontend/inbox/components/detail/ReportDetailActions.tsx
index 83dabd2f7438..608a7f9fad95 100644
--- a/products/signals/frontend/inbox/components/detail/ReportDetailActions.tsx
+++ b/products/signals/frontend/inbox/components/detail/ReportDetailActions.tsx
@@ -2,7 +2,7 @@ import { useActions, useValues } from 'kea'
import { router } from 'kea-router'
import { type MouseEvent, useState } from 'react'
-import { IconArchive, IconPullRequest, IconReceipt, IconUndo } from '@posthog/icons'
+import { IconArchive, IconReceipt, IconUndo } from '@posthog/icons'
import { lemonToast } from '@posthog/lemon-ui'
import api from 'lib/api'
@@ -10,9 +10,7 @@ import { urls } from 'scenes/urls'
import { captureInboxReportAction } from '../../inboxAnalytics'
import { inboxSceneLogic } from '../../inboxSceneLogic'
-import { inboxTaskKickoffLogic } from '../../inboxTaskKickoffLogic'
import { inboxBulkActionsLogic } from '../../logics/inboxBulkActionsLogic'
-import { inboxReportDetailLogic } from '../../logics/inboxReportDetailLogic'
import { INBOX_REPORT_SECTION_LIST_PARAMS, reportListLogic } from '../../logics/reportListLogic'
import { ACTIONABLE_ACTIONABILITY_VALUES, SignalReport, SignalReportStatus } from '../../types'
import { useReportArchive } from '../cards/useReportArchive'
@@ -55,24 +53,18 @@ export function canCreateImplementationPr(report: SignalReport): boolean {
}
/**
- * Detail-pane actions as data: Archive/Restore, Refund, and Create PR. Discuss is rendered
- * separately as a standalone dropdown button (`DiscussReportButton`) since it opens a question
- * popover rather than firing on click; rating a report lives at the end of the body
- * (`ReportFeedbackFooter`). Task creation is owned by `inboxTaskKickoffLogic`; archiving reuses the
- * shared `useReportArchive` dialog flow. Callers render these inline or inside a menu.
+ * Detail-pane actions as data: Archive/Restore and Refund. Create PR and Discuss are each rendered
+ * separately as a standalone dropdown button (`CreatePrButton`, `DiscussReportButton`) since they
+ * open a note popover rather than firing on click; rating a report lives at the end of the body
+ * (`ReportFeedbackFooter`). Archiving reuses the shared `useReportArchive` dialog flow. Callers
+ * render these inline or inside a menu.
*/
export function useReportDetailActions(report: SignalReport): ReportDetailAction[] {
- const { isCreatingPr, aiConsentDisabledReason } = useValues(inboxTaskKickoffLogic)
- // Already mounted by `ReportDetail` with these same props, so this reads the loaded value
- // rather than starting a second fetch.
- const { hasLiveImplementationTask } = useValues(inboxReportDetailLogic({ reportId: report.id, report }))
- const { createPrFromReport } = useActions(inboxTaskKickoffLogic)
const { reportArchived } = useActions(inboxBulkActionsLogic)
const { activeTab } = useValues(inboxSceneLogic)
const { loadSelectedReport } = useActions(inboxSceneLogic)
const [isRestoring, setIsRestoring] = useState(false)
- const showCreatePr = canCreateImplementationPr(report)
const isArchived = report.status === SignalReportStatus.SUPPRESSED
// Resolved reports are terminal – nothing to archive, restore, or kick off.
const isResolved = report.status === SignalReportStatus.RESOLVED
@@ -188,24 +180,5 @@ export function useReportDetailActions(report: SignalReport): ReportDetailAction
...(canRefund ? [refund] : []),
]
- if (showCreatePr) {
- actions.push({
- key: 'create-pr',
- label: 'Create PR',
- icon: <IconPullRequest />,
- loading: isCreatingPr,
- tooltip: 'Have Self-driving open a pull request for this report',
- disabledReason:
- aiConsentDisabledReason ??
- (hasLiveImplementationTask
- ? 'A PR task already exists for this report. Open it in the task log to continue.'
- : undefined),
- onClick: () => {
- captureInboxReportAction({ report, actionType: 'create_pr', surface: 'detail_pane' })
- createPrFromReport(report)
- },
- })
- }
-
return actions
}
diff --git a/products/signals/frontend/inbox/components/detail/ReportDetailLegacy.tsx b/products/signals/frontend/inbox/components/detail/ReportDetailLegacy.tsx
index c35ec7010e8c..eea10d9e8c06 100644
--- a/products/signals/frontend/inbox/components/detail/ReportDetailLegacy.tsx
+++ b/products/signals/frontend/inbox/components/detail/ReportDetailLegacy.tsx
@@ -36,6 +36,7 @@ import {
} from '../badges/sourceProductIcons'
import { ConventionalCommitScopeTag } from '../cards/ReportCard'
import { CommitContent } from './artefactTypes'
+import { CreatePrButton } from './CreatePrButton'
import { DetailSection } from './DetailSection'
import { DiscussReportButton } from './DiscussReportButton'
import { PrChecksSection } from './PrChecksSection'
@@ -50,7 +51,7 @@ import {
} from './PullRequestDiffPanel'
import { ReportActivitySection } from './ReportActivitySection'
import { ReportChart } from './ReportChart'
-import { useReportDetailActions } from './ReportDetailActions'
+import { canCreateImplementationPr, useReportDetailActions } from './ReportDetailActions'
import { ReportFeedbackFooter } from './ReportFeedbackFooter'
import { ReportTasksSection } from './ReportTasksSection'
import { SuggestedReviewersSection } from './SuggestedReviewersSection'
@@ -449,6 +450,10 @@ function InboxDetailFrameLegacy({
</div>
<div className="flex items-center gap-2 @2xl:shrink-0">
{primaryAction}
+ {/* The report's main call to action. Same gate and standalone button the redesign pane
+ uses, so a flag-off reader keeps Create PR. Never shows alongside the "Open in
+ GitHub" primary action — the gate is false once a PR exists. */}
+ {canCreateImplementationPr(report) && <CreatePrButton report={report} />}
{/* Discuss is always available and stays inline as its own dropdown button. */}
<DiscussReportButton report={report} reportUrl={reportUrl} />
{/* Buttons inline on wide layouts; collapse into a standard LemonMenu kebab below @4xl. */}
diff --git a/products/signals/frontend/inbox/components/detail/ReportSummaryBody.tsx b/products/signals/frontend/inbox/components/detail/ReportSummaryBody.tsx
index f63090b34f0e..1a035059aa64 100644
--- a/products/signals/frontend/inbox/components/detail/ReportSummaryBody.tsx
+++ b/products/signals/frontend/inbox/components/detail/ReportSummaryBody.tsx
@@ -1,13 +1,10 @@
import { ReactNode, useCallback, useMemo } from 'react'
-import { LemonButton } from '@posthog/lemon-ui'
-
import { LemonMarkdown } from 'lib/lemon-ui/LemonMarkdown'
import { ChartPlacements } from '../../utils/chartPlacement'
import { parseReportSummary } from '../../utils/reportSummary'
import { ReportChart } from './ReportChart'
-import { ReportDetailAction } from './ReportDetailActions'
const PROSE_CLASS =
'text-[15px] text-secondary leading-relaxed break-words [&>*+*]:mt-3.5 [&_[data-attr=report-chart]]:my-5 [&_li]:my-1 [&_ul]:my-2 [&_ol]:my-2 [&_h1]:mt-8 [&_h1]:text-lg [&_h2]:mt-8 [&_h2]:text-lg [&_h3]:mt-6 [&_h3]:text-base'
@@ -41,8 +38,8 @@ function SummaryMarkdown({ markdown, sourceOffset, chartPlacements, className }:
interface ReportSummaryBodyProps {
summary: string
chartPlacements: ChartPlacements
- /** The Create PR action, rendered under the Solution section when the report offers it. */
- createPrAction?: ReportDetailAction
+ /** The Create PR button, rendered under the Solution section when the report offers it. */
+ createPrButton?: ReactNode
/**
* Says a pull request with the fix is open and links to it. Rendered under the Solution section, or after
* the body when the summary has no sections, so a report never hides that its fix already shipped.
@@ -57,7 +54,7 @@ interface ReportSummaryBodyProps {
export function ReportSummaryBody({
summary,
chartPlacements,
- createPrAction,
+ createPrButton,
pullRequestNote,
}: ReportSummaryBodyProps): JSX.Element {
const parsed = useMemo(() => parseReportSummary(summary), [summary])
@@ -95,22 +92,7 @@ export function ReportSummaryBody({
chartPlacements={chartPlacements}
/>
{section.kind === 'solution' && pullRequestNote && <div className="mt-2">{pullRequestNote}</div>}
- {section.kind === 'solution' && createPrAction && (
- <div className="mt-2">
- <LemonButton
- type="primary"
- size="small"
- icon={createPrAction.icon}
- loading={createPrAction.loading}
- tooltip={createPrAction.disabledReason ? undefined : createPrAction.tooltip}
- disabledReason={createPrAction.disabledReason}
- onClick={createPrAction.onClick}
- data-attr="inbox-report-solution-create-pr"
- >
- {createPrAction.label}
- </LemonButton>
- </div>
- )}
+ {section.kind === 'solution' && createPrButton && <div className="mt-2">{createPrButton}</div>}
</section>
))}
{!hasSolutionSection && pullRequestNote}
diff --git a/products/signals/frontend/inbox/inboxTaskKickoffLogic.ts b/products/signals/frontend/inbox/inboxTaskKickoffLogic.ts
index 5fc3e0afdd03..32584a9a4868 100644
--- a/products/signals/frontend/inbox/inboxTaskKickoffLogic.ts
+++ b/products/signals/frontend/inbox/inboxTaskKickoffLogic.ts
@@ -153,7 +153,11 @@ export interface inboxTaskKickoffLogicActions {
createPrFailure: () => {
value: true
}
- createPrFromReport: (report: SignalReport) => {
+ createPrFromReport: (
+ report: SignalReport,
+ feedback?: string
+ ) => {
+ feedback: string | undefined
report: SignalReport
}
createPrSuccess: () => {
@@ -202,7 +206,7 @@ export const inboxTaskKickoffLogic = kea<inboxTaskKickoffLogicType>([
actions({
discussReport: (report: SignalReport, reportUrl: string, question: string) => ({ report, reportUrl, question }),
- createPrFromReport: (report: SignalReport) => ({ report }),
+ createPrFromReport: (report: SignalReport, feedback?: string) => ({ report, feedback }),
discussReportSuccess: true,
discussReportFailure: true,
createPrSuccess: true,
@@ -266,7 +270,7 @@ export const inboxTaskKickoffLogic = kea<inboxTaskKickoffLogicType>([
actions.discussReportFailure()
}
},
- createPrFromReport: async ({ report }) => {
+ createPrFromReport: async ({ report, feedback }) => {
if (values.aiConsentDisabledReason) {
lemonToast.error(values.aiConsentDisabledReason)
captureInboxReportActionCompleted({
@@ -282,7 +286,7 @@ export const inboxTaskKickoffLogic = kea<inboxTaskKickoffLogicType>([
await createReportTask(
report,
SIGNAL_REPORT_TASK_IMPLEMENTATION_RELATIONSHIP,
- buildCreatePrReportPrompt(report),
+ buildCreatePrReportPrompt(report, feedback),
'Implement report fix',
CREATE_PR_RUNTIME
)
diff --git a/products/signals/frontend/inbox/logics/inboxTriageLogic.ts b/products/signals/frontend/inbox/logics/inboxTriageLogic.ts
index 6f7cf5d785b2..d569437c7905 100644
--- a/products/signals/frontend/inbox/logics/inboxTriageLogic.ts
+++ b/products/signals/frontend/inbox/logics/inboxTriageLogic.ts
@@ -65,7 +65,11 @@ export interface inboxTriageLogicActions {
id: string | null
openMethod: import('../inboxAnalytics').InboxReportOpenMethod
} // inboxSceneLogic
- createPrFromReport: (report: SignalReport) => {
+ createPrFromReport: (
+ report: SignalReport,
+ feedback?: string | undefined
+ ) => {
+ feedback: string | undefined
report: SignalReport
} // inboxTaskKickoffLogic
archiveReport: (
@@ -374,7 +378,13 @@ export const inboxTriageLogic = kea<inboxTriageLogicType>([
if (!report || !values.canCreatePr || values.isCreatingPr || values.aiConsentDisabledReason) {
return
}
- captureInboxReportAction({ report, actionType: 'create_pr', surface: 'triage_mode' })
+ // Triage is a fast keyboard flow with no note box, so it never steers the agent.
+ captureInboxReportAction({
+ report,
+ actionType: 'create_pr',
+ surface: 'triage_mode',
+ extra: { has_feedback: false },
+ })
actions.createPrFromReport(report)
},
openCurrent: () => {