feat(signals): add slack notification picker in inbox source settings#2174
Draft
Twixes wants to merge 3 commits into
Draft
feat(signals): add slack notification picker in inbox source settings#2174Twixes wants to merge 3 commits into
Twixes wants to merge 3 commits into
Conversation
Surfaces the new per-user Slack notification settings for the signals
inbox (workspace + channel + minimum priority) in the inbox source
settings panel. Reuses the existing /api/.../integrations/{id}/channels/
endpoint to populate the channel picker and the existing slack
Integration store, so no new auth setup is required — users connect
Slack once in PostHog Web and pick a channel here.
Pairs with the backend changes in PostHog/posthog#58774.
Generated-By: PostHog Code
Task-Id: 046d7425-f0b4-4ab4-97f8-cce0627927f0
Adds an in-app Slack connect flow so users no longer have to leave PostHog Code for the PostHog web settings page just to wire up notifications. Flow: clicking "Connect Slack workspace" in the inbox source settings opens the browser to PostHog Cloud's Slack OAuth authorize endpoint with `next=/account-connected/slack-integration?...`. PostHog Cloud completes OAuth, creates the team-level Slack `Integration`, and redirects to a landing page that fires a `posthog-code://slack-integration?...` deep link back into the app. The new `SlackIntegrationService` (main process) handles the deep link, emits a callback event, and the renderer hook refreshes the integrations list. Mirrors the existing `GitHubIntegrationService` so each provider's deep link handler stays isolated. Pairs with backend changes in PostHog/posthog#58774 that teach the `/account-connected/<kind>` page about the new `slack-integration` kind. Generated-By: PostHog Code Task-Id: 046d7425-f0b4-4ab4-97f8-cce0627927f0
… channels Switches the notification channel picker from a Radix Themes Select to the searchable, virtualized Combobox from @posthog/quill (the same component used by GitHubRepoPicker and BranchSelector). Workspaces commonly have hundreds of channels — the old Select was unsearchable and rendered every option upfront. Also rewires handleUpdateSlackNotifications to apply changes via setQueryData optimistically, rather than waiting for the round-trip + cache invalidation. On error, rolls back to the previous snapshot. This makes channel and minimum-priority picks reflect immediately, and surfaces failures via toast. Generated-By: PostHog Code Task-Id: 046d7425-f0b4-4ab4-97f8-cce0627927f0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Signals inbox items previously surfaced only in-app. Users wanting a heads-up when a new item lands and they're a suggested reviewer had no way to opt in.
Even after the initial Slack notifications work landed, picking a channel still required a detour through PostHog Web — users had to leave PostHog Code to install the Slack integration, then come back. That's too much friction for what should be a one-time setup.
Changes
Slack notifications surface under Inbox source settings — same surface as the existing "PR auto-start threshold" control.
SignalSlackNotificationsSettingscomponent with three controls:Integrationis connected; otherwise the single workspace is implied)./api/environments/{teamId}/integrations/{id}/channels/— same endpoint as Insight Alerts. Includes an explicit "Off — don't notify me" option.useSlackChannelshook caches the channel list for 5 min (server-side cache is already 1 h, so cheap refreshes).useSignalSourceManager.handleUpdateSlackNotificationstranslates camelCase patches to the snake_case API body and only sends the fields the caller touched, so editing notifications doesn't wipe the autostart-priority setting (and vice versa).SignalUserAutonomyConfigshared type andposthogClient.updateSignalUserAutonomyConfigextended with the new optional fields.In-app Slack connect flow so users no longer have to leave PostHog Code for PostHog Web.
SlackIntegrationServicein the main process. Mirrors the existingGitHubIntegrationServicebut registers a separateslack-integrationdeep-link key so each provider's handler stays isolated.slackIntegrationtRPC router (startFlow,onCallback,onFlowTimedOut,consumePendingCallback).useSlackIntegrationCallback(deep-link subscriber, drains pending callbacks on mount) anduseSlackConnect(button state machine — idle → connecting → idle/error/timed-out).SignalSlackNotificationsSettingsnow shows a Connect Slack workspace button that:/api/environments/{projectId}/integrations/authorize/?kind=slack&next=/account-connected/slack-integration?...,Integration,/account-connected/slack-integration(see the paired backend PR), which fires aposthog-code://slack-integration?integration_id=…deep link back into the app,Pairs with the backend changes in PostHog/posthog#58774.
How did you test this?
I'm an agent. Verified:
pnpm typecheck(underapps/code) is clean — no new errors introduced.pnpm exec biome checkis clean on every modified and new file.Publish to changelog?
no
Created with PostHog Code