Skip to content

feat: expose slack agent configuration page via posthog code settings#2061

Open
posthog[bot] wants to merge 3 commits intomainfrom
posthog-code/settings-slack-tab
Open

feat: expose slack agent configuration page via posthog code settings#2061
posthog[bot] wants to merge 3 commits intomainfrom
posthog-code/settings-slack-tab

Conversation

@posthog
Copy link
Copy Markdown
Contributor

@posthog posthog Bot commented May 6, 2026

Summary

  • Adds a Slack tab to the settings sidebar (between GitHub and Signals) using the Phosphor SlackLogo icon.
  • The tab renders a Slack integration page with a short description and a Manage in PostHog Web button that opens the project-level Slack integration page in the user's active PostHog cloud region (/project/{projectId}/settings/project-posthog-code#integration-posthog-code-slack).
  • Until Slack is configurable directly from PostHog Code, this gives users a discoverable entry point — they were previously hunting through PostHog Web with no link from the app.

Test plan

  • Open Settings → Slack and verify the title Slack integration, description copy, and Manage in PostHog Web button render.
  • Click the button while signed in and confirm it opens the correct project Slack integration URL in the default browser (US/EU regions both honored via getPostHogUrl).
  • Sign out (or clear projectId) and confirm the button is disabled rather than opening a broken URL.

Created with PostHog Code

Adds a Slack tab in the settings sidebar that explains the integration
and links to the project-level Slack integration page in PostHog Web,
since the integration isn't yet configurable from PostHog Code itself.

Generated-By: PostHog Code
Task-Id: 510f78f8-695d-4c28-95e9-e309b049158a
@jonathanlab jonathanlab marked this pull request as ready for review May 6, 2026 16:47
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 6, 2026

Comments Outside Diff (2)

  1. apps/code/src/renderer/features/settings/components/sections/SlackSettings.tsx, line 24-35 (link)

    P2 Disabled button with no explanation for the user — per the project convention of disabling with a tooltip rather than silently, the button should carry a tooltip when projectId is missing so users know why nothing happens when they hover it.

    Rule Used: When disabling UI components based on certain cond... (source)

    Learned From
    PostHog/posthog#32600

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: apps/code/src/renderer/features/settings/components/sections/SlackSettings.tsx
    Line: 24-35
    
    Comment:
    Disabled button with no explanation for the user — per the project convention of disabling with a tooltip rather than silently, the button should carry a tooltip when `projectId` is missing so users know why nothing happens when they hover it.
    
    
    
    **Rule Used:** When disabling UI components based on certain cond... ([source](https://app.greptile.com/review/custom-context?memory=788b3d9d-2e6e-41e7-a14c-553ff0b3d06c))
    
    **Learned From**
    [PostHog/posthog#32600](https://github.com/PostHog/posthog/pull/32600)
    
    How can I resolve this? If you propose a fix, please make it concise.

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

  2. apps/code/src/renderer/features/settings/components/sections/SlackSettings.tsx, line 2 (link)

    P2 openUrlInBrowser is a generic OS utility but is imported from a GitHub-specific integration hook. This creates an unnecessary coupling between the Slack settings component and the GitHub integration module. The function should be sourced from a shared utilities location.

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: apps/code/src/renderer/features/settings/components/sections/SlackSettings.tsx
    Line: 2
    
    Comment:
    `openUrlInBrowser` is a generic OS utility but is imported from a GitHub-specific integration hook. This creates an unnecessary coupling between the Slack settings component and the GitHub integration module. The function should be sourced from a shared utilities location.
    
    
    
    How can I resolve this? If you propose a fix, please make it concise.
Prompt To Fix All With AI
Fix the following 2 code review issues. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 2
apps/code/src/renderer/features/settings/components/sections/SlackSettings.tsx:24-35
Disabled button with no explanation for the user — per the project convention of disabling with a tooltip rather than silently, the button should carry a tooltip when `projectId` is missing so users know why nothing happens when they hover it.

```suggestion
      <Flex>
        <Tooltip
          content="Sign in to a project to manage Slack settings"
          hidden={!!slackSettingsUrl}
        >
          <Button
            size="1"
            disabled={!slackSettingsUrl}
            onClick={() => {
              if (slackSettingsUrl) void openUrlInBrowser(slackSettingsUrl);
            }}
          >
            <ArrowSquareOutIcon size={12} />
            Manage in PostHog Web
          </Button>
        </Tooltip>
      </Flex>
```

### Issue 2 of 2
apps/code/src/renderer/features/settings/components/sections/SlackSettings.tsx:2
`openUrlInBrowser` is a generic OS utility but is imported from a GitHub-specific integration hook. This creates an unnecessary coupling between the Slack settings component and the GitHub integration module. The function should be sourced from a shared utilities location.

```suggestion
import { openUrlInBrowser } from "@features/integrations/utils/browser";
```

Reviews (1): Last reviewed commit: "feat: add Slack tab to settings linking ..." | Re-trigger Greptile

@jonathanlab jonathanlab changed the title feat: add Slack tab to settings linking to PostHog Web feat: expose slack agent configuration page via posthog code settings May 6, 2026
PostHog Code and others added 2 commits May 6, 2026 17:01
- Move openUrlInBrowser out of the GitHub hook into its own utility
  module so SlackSettings (and any future caller) doesn't depend on a
  feature-specific file.
- Wrap the disabled "Manage in PostHog Web" button in a Tooltip
  explaining why it's disabled when the user has no active project.

Generated-By: PostHog Code
Task-Id: 510f78f8-695d-4c28-95e9-e309b049158a
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