Skip to content

feat(settings): show Slack workspace connection status#2200

Merged
dmarticus merged 2 commits into
mainfrom
posthog-code/slack-settings-connection-status
May 18, 2026
Merged

feat(settings): show Slack workspace connection status#2200
dmarticus merged 2 commits into
mainfrom
posthog-code/slack-settings-connection-status

Conversation

@dmarticus
Copy link
Copy Markdown
Contributor

@dmarticus dmarticus commented May 18, 2026

Problem

The Slack settings panel only showed a "Manage in PostHog" button — there was no way to see at a glance whether a Slack workspace was already connected to the project, or which workspace it was.

Changes

  • Add slackIntegrations / hasSlackIntegration selectors to integrationStore (mirrors the existing GitHub selectors).
  • SlackSettings now renders connection state above the manage button:
    • Loading spinner while integrations fetch.
    • One row per connected workspace (Slack logo, workspace name, relative "Created…" timestamp).
    • Empty-state row when nothing is connected.
  • Renamed the manage button local to manageButton / manageButtonWithTooltip for clarity.

Before

(no indication if we've connected or not)

image

After

(with connection)
image

(with no connection)
Screenshot 2026-05-18 at 12 02 28

How did you test this?

  • pnpm typecheck (ran via lint-staged on commit).
  • Manually opened Settings → Slack and verified: empty state when not connected, populated row when a workspace is connected, and that the tooltip-disabled state still shows when not signed in to a project.

Publish to changelog?

no

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 18, 2026

Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
apps/code/src/renderer/features/settings/components/sections/SlackSettings.tsx:93-97
The `typeof ... === "number"` branch in `createdAt` accepts a raw number, but `formatRelativeTimeLong` treats any number as Unix **milliseconds**`new Date(seconds)` would produce a date in early 1970. PostHog APIs consistently return ISO strings for `created_at`, so this branch is probably dead code. If it can ever be reached, the caller needs to convert seconds → ms first. Narrowing the guard to `string` only matches the actual API contract and avoids a silent wrong-date bug if a numeric value ever surfaces.

```suggestion
  const createdAt =
    typeof integration.created_at === "string"
      ? integration.created_at
      : null;
```

Reviews (1): Last reviewed commit: "feat(settings): show Slack workspace con..." | Re-trigger Greptile

Comment thread apps/code/src/renderer/features/settings/components/sections/SlackSettings.tsx Outdated
@dmarticus dmarticus merged commit 6551355 into main May 18, 2026
15 checks passed
@dmarticus dmarticus deleted the posthog-code/slack-settings-connection-status branch May 18, 2026 20:45
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.

2 participants