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(inbox): start the agent from the main implement button (#130120)

Andrew Maguire433df8f3fd37
diff --git a/products/signals/frontend/inbox/components/detail/ImplementButton.stories.tsx b/products/signals/frontend/inbox/components/detail/ImplementButton.stories.tsx
index 634e249e621a..20da6fe2a7b2 100644
--- a/products/signals/frontend/inbox/components/detail/ImplementButton.stories.tsx
+++ b/products/signals/frontend/inbox/components/detail/ImplementButton.stories.tsx
@@ -56,7 +56,7 @@ export const ConnectGithub: Story = {
],
render: () => <ImplementButton report={report} />,
play: async ({ canvasElement }) => {
- await userEvent.click(await within(canvasElement).findByText('Implement'))
+ await userEvent.click(await within(canvasElement).findByLabelText('More implementation options'))
const implement = await waitFor(() => {
if (!reportGithubAccessLogic({ report }).values.repairNeeded) {
throw new Error('GitHub connection requirement has not resolved')
diff --git a/products/signals/frontend/inbox/components/detail/ImplementButton.test.tsx b/products/signals/frontend/inbox/components/detail/ImplementButton.test.tsx
index 7b6ee7f072eb..c6c6f9b68f35 100644
--- a/products/signals/frontend/inbox/components/detail/ImplementButton.test.tsx
+++ b/products/signals/frontend/inbox/components/detail/ImplementButton.test.tsx
@@ -71,15 +71,13 @@ describe('ImplementButton', () => {
return user
}
- it('offers implementation choices before starting a PostHog agent', async () => {
+ it('starts a PostHog agent from the main button without opening the options', async () => {
const user = userEvent.setup()
render(<ImplementButton report={makeReport()} />)
await user.click(screen.getByTestId('inbox-report-create-pr'))
- expect(createPrFromReport).not.toHaveBeenCalled()
- await user.click(screen.getByTestId('inbox-report-create-pr-submit'))
-
+ expect(screen.queryByTestId('inbox-report-create-pr-submit')).not.toBeInTheDocument()
expect(createPrFromReport).toHaveBeenCalledWith(expect.objectContaining({ id: 'report-1' }), undefined)
expect(jest.mocked(captureInboxReportAction).mock.calls[0][0].extra).toEqual({
has_feedback: false,
@@ -168,7 +166,7 @@ describe('ImplementButton', () => {
render(<ImplementButton report={report} />)
const access = reportGithubAccessLogic({ report })
await waitFor(() => expect(access.values[status === 503 ? 'failed' : 'repairNeeded']).toBe(true))
- await user.click(screen.getByTestId('inbox-report-create-pr'))
+ await user.click(screen.getByTestId('inbox-report-create-pr-steer'))
await user.click(screen.getByTestId('inbox-report-copy-implementation-prompt'))
expect(copyToClipboard).toHaveBeenCalledWith(
expect.stringContaining('report ID: report-1'),
diff --git a/products/signals/frontend/inbox/components/detail/ImplementButton.tsx b/products/signals/frontend/inbox/components/detail/ImplementButton.tsx
index c978142db3e7..fe8bcbd58b4d 100644
--- a/products/signals/frontend/inbox/components/detail/ImplementButton.tsx
+++ b/products/signals/frontend/inbox/components/detail/ImplementButton.tsx
@@ -130,9 +130,10 @@ export function ImplementButton({
size="small"
className="[--lemon-button-hover-depth:0px]"
icon={<IconPullRequest />}
- onClick={() => setChoicesOpen(true)}
+ onClick={() => submit(instructions)}
loading={isCreatingPr}
- tooltip="Choose how to implement this report"
+ disabledReason={disabledReason}
+ tooltip="Start a PostHog agent to implement this report"
data-attr={surface === 'triage_mode' ? 'inbox-triage-create-pr' : 'inbox-report-create-pr'}
sideAction={{
tooltip: 'More implementation options',
diff --git a/products/signals/frontend/inbox/components/triage/TriageCard.test.tsx b/products/signals/frontend/inbox/components/triage/TriageCard.test.tsx
index da62f4a11dce..43b655abaa83 100644
--- a/products/signals/frontend/inbox/components/triage/TriageCard.test.tsx
+++ b/products/signals/frontend/inbox/components/triage/TriageCard.test.tsx
@@ -101,7 +101,7 @@ describe('TriageCard', () => {
if (entrypoint === 'keyboard') {
logic.actions.createPrForCurrent()
} else {
- fireEvent.click(screen.getByText('Implement').closest('button')!)
+ fireEvent.click(screen.getByLabelText('More implementation options'))
expect(screen.getByText('Copy prompt for your agent')).toBeInTheDocument()
if (status === 200) {
fireEvent.click(screen.getByText('Implement with PostHog').closest('button')!)