Skip to content

fix: Deep-link Slack settings to the correct anchor#2479

Merged
joshsny merged 1 commit into
mainfrom
posthog-code/fix-slack-settings-deep-link
Jun 4, 2026
Merged

fix: Deep-link Slack settings to the correct anchor#2479
joshsny merged 1 commit into
mainfrom
posthog-code/fix-slack-settings-deep-link

Conversation

@joshsny
Copy link
Copy Markdown
Contributor

@joshsny joshsny commented Jun 4, 2026

Problem

In PostHog Code's Slack settings, the Manage in PostHog Web button opened the PostHog Integrations settings page but did not scroll to or highlight the Slack integration — it just landed on the section.

The link used the hash #setting=integration-slack. The PostHog settings scene scrolls to a specific setting via the useAnchor hook, which matches location.hash.slice(1) against an element id directly (<h2 id="integration-slack">). #setting=integration-slack matches no element id, so no scroll/highlight happened. The full settings scene has no URL handler that reads a setting= hash param on load.

(For reference, the originally-reported 404 was a separate, earlier issue — the section path was already corrected to project-integrations in #2477; this PR fixes the remaining hash.)

Changes

Changed the deep-link hash from #setting=integration-slack to the bare-anchor form #integration-slack.

This matches exactly what PostHog's own urls.settings(section, settingId) helper generates (via combineUrl, a value-less hash key) and what useAnchor resolves to the Slack integration heading. The section path stays project-integrations, the canonical alias of environment-integrations where the integration-slack setting lives.

How did you test this?

  • Verified against the PostHog web source (SettingsMap.tsx, settingsSceneLogic.ts, settingsLogic.ts, Settings.tsx, useAnchor.ts, urls.ts) that integration-slack is the real setting id, that project-integrations is the canonical section, and that useAnchor scrolls to the bare #integration-slack anchor while #setting=... does not resolve on load.
  • No automated tests added — this is a one-line URL string change with no existing test coverage for the link.

Automatic notifications

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

Created with PostHog Code

The "Manage in PostHog Web" button linked to `#setting=integration-slack`, but the PostHog settings scene scrolls to a setting via `useAnchor`, which matches `location.hash` against the element id directly. `#setting=integration-slack` matches no element, so the page opened on the Integrations section without scrolling to or highlighting the Slack integration.

Use the bare-anchor form `#integration-slack`, which is exactly what PostHog's own `urls.settings(section, settingId)` helper generates and what `useAnchor` resolves to the `<h2 id="integration-slack">` heading.

Generated-By: PostHog Code
Task-Id: eaa6b154-8c5b-485b-a16e-797894e2a03d
@joshsny joshsny marked this pull request as ready for review June 4, 2026 09:29
@joshsny joshsny enabled auto-merge (squash) June 4, 2026 09:29
@joshsny joshsny merged commit e8574bb into main Jun 4, 2026
18 checks passed
@joshsny joshsny deleted the posthog-code/fix-slack-settings-deep-link branch June 4, 2026 09:30
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Jun 4, 2026

Reviews (1): Last reviewed commit: "fix: Deep-link Slack settings to the cor..." | Re-trigger Greptile

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.

3 participants