Skip to content

Add Slack DM toggle for channel thread @-mentions#3554

Draft
adboio wants to merge 2 commits into
mainfrom
posthog-code/slack-mention-notifications-toggle
Draft

Add Slack DM toggle for channel thread @-mentions#3554
adboio wants to merge 2 commits into
mainfrom
posthog-code/slack-mention-notifications-toggle

Conversation

@adboio

@adboio adboio commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Problem

@-mentions in channel threads only surface in the polled Activity feed — if you're not in the app, you don't find out someone tagged you. PostHog/posthog#72087 adds backend-driven Slack DMs on mention (opt-in, via the team's existing Slack integration); this PR adds the client-side toggle for that preference.

Changes

  • New SlackMentionNotificationsSettings section rendered in Slack settings below the inbox-notifications block: a "Mention notifications" switch ("Get a Slack DM when someone @-mentions you in a channel thread"). Hidden unless the project-bluebird flag is on and a Slack workspace is connected (the parent section owns the connect prompt).
  • useCodeUserNotificationSettings / ...Mutations hooks (query + optimistic-update mutation with revert-and-toast on failure), following the useSignalUserAutonomyMutations pattern.
  • api-client: getCodeUserNotificationSettings / updateCodeUserNotificationSettings against the new /api/code/user_settings/ endpoint, with the CodeUserNotificationSettings type in @posthog/shared/domain-types.
  • Toggle is instrumented with SETTING_CHANGED (setting_name: "slack_mention_notifications").

Depends on PostHog/posthog#72087 — until that deploys, the settings fetch 404s and the section shows the switch in its default (off) state.

How did you test this?

Code review against the sibling Slack settings sections only — I (Claude, via a PostHog Code cloud task) could not run pnpm typecheck/pnpm lint or the app in this sandbox (no installed workspace), so CI is the verification here. No new unit tests: the hooks mirror useSignalUserAutonomyMutations and the component is presentational; sibling settings sections carry no component tests either.

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

Created with PostHog Code

Opt-in setting (default off) in the Slack settings section, gated behind the project-bluebird flag. Reads/writes the new /api/code/user_settings/ endpoint; delivery itself is backend-driven via the team's Slack integration (PostHog/posthog#72087).

Generated-By: PostHog Code
Task-Id: 69e0939c-e6e1-4efa-9d5e-771b88f03b5a
@adboio adboio self-assigned this Jul 17, 2026
@trunk-io

trunk-io Bot commented Jul 17, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit 029c2b5.

Generated-By: PostHog Code
Task-Id: 69e0939c-e6e1-4efa-9d5e-771b88f03b5a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant