: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.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
fix(signals): let multi-workspace users enable inbox Slack pings (#65382)
Joshua Snyder8d855d4d3652
diff --git a/frontend/src/scenes/inbox/components/config/SlackNotificationsSection.tsx b/frontend/src/scenes/inbox/components/config/SlackNotificationsSection.tsxindex 3c15bfb51d2d..46fa15362e27 100644--- a/frontend/src/scenes/inbox/components/config/SlackNotificationsSection.tsx+++ b/frontend/src/scenes/inbox/components/config/SlackNotificationsSection.tsx@@ -56,8 +56,8 @@ export function SlackNotificationsSection(): JSX.Element {useMountedLogic(integrationsLogic)useMountedLogic(userAutonomyLogic)const { slackIntegrations, integrationsLoading } = useValues(integrationsLogic)- const { autonomyConfig, autonomyConfigLoading } = useValues(userAutonomyLogic)- const { updateSlackNotifications } = useActions(userAutonomyLogic)+ const { autonomyConfig, autonomyConfigLoading, slackPickersExpanded } = useValues(userAutonomyLogic)+ const { updateSlackNotifications, setSlackPickersExpanded } = useActions(userAutonomyLogic)if (integrationsLoading && slackIntegrations === undefined) {return <LemonSkeleton className="h-20 w-full" />@@ -79,12 +79,16 @@ export function SlackNotificationsSection(): JSX.Element {const onToggleEnabled = (enabled: boolean): void => {if (enabled) {// Turning on just opens the workspace/channel pickers – the actual enable- // happens once a channel is chosen. Persist the workspace if it's unambiguous.+ // happens once a channel is chosen. Reveal them even when the workspace is+ // ambiguous (multiple connected) so the user can pick one; persist it now+ // only when it's unambiguous.+ setSlackPickersExpanded(true)if (effectiveIntegration && selectedIntegrationId === null) {updateSlackNotifications({ integrationId: effectiveIntegration.id })}} else {- // Disable by clearing the target.+ // Disable by clearing the target and collapsing the pickers.+ setSlackPickersExpanded(false)updateSlackNotifications({ integrationId: null, channel: null })}}@@ -111,8 +115,9 @@ export function SlackNotificationsSection(): JSX.Element {})}- // "On" means the pickers are visible; either an integration is explicitly selected or a channel is set.- const showPickers = selectedIntegrationId !== null || !!channel+ // "On" means the pickers are visible: the user expanded them, or a saved integration/channel+ // already implies an enabled state.+ const showPickers = slackPickersExpanded || selectedIntegrationId !== null || !!channelreturn (<div className="flex flex-col gap-3 rounded border bg-bg-light px-3 py-2.5">diff --git a/frontend/src/scenes/inbox/logics/userAutonomyLogic.ts b/frontend/src/scenes/inbox/logics/userAutonomyLogic.tsindex d3b0bcfaee0a..508aa4733149 100644--- a/frontend/src/scenes/inbox/logics/userAutonomyLogic.ts+++ b/frontend/src/scenes/inbox/logics/userAutonomyLogic.ts@@ -24,6 +24,9 @@ export const userAutonomyLogic = kea<userAutonomyLogicType>([channel?: string | nullminPriority?: SignalReportPriority | null}) => ({ updates }),+ // Ephemeral view state: whether the workspace/channel pickers are revealed. Lets a user+ // with multiple workspaces (and nothing saved yet) open the pickers to pick one.+ setSlackPickersExpanded: (expanded: boolean) => ({ expanded }),}),loaders({autonomyConfig: [@@ -52,6 +55,12 @@ export const userAutonomyLogic = kea<userAutonomyLogicType>([...('minPriority' in updates ? { slack_notification_min_priority: updates.minPriority ?? null } : {}),}),},+ slackPickersExpanded: [+ false,+ {+ setSlackPickersExpanded: (_, { expanded }) => expanded,+ },+ ],}),listeners(({ actions }) => ({setAutostartPriority: async ({ priority }) => {