fix: Deep-link Slack settings to the correct anchor#2479
Merged
Conversation
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
oliverb123
approved these changes
Jun 4, 2026
VojtechBartos
approved these changes
Jun 4, 2026
Contributor
|
Reviews (1): Last reviewed commit: "fix: Deep-link Slack settings to the cor..." | Re-trigger Greptile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 theuseAnchorhook, which matcheslocation.hash.slice(1)against an elementiddirectly (<h2 id="integration-slack">).#setting=integration-slackmatches no element id, so no scroll/highlight happened. The full settings scene has no URL handler that reads asetting=hash param on load.(For reference, the originally-reported 404 was a separate, earlier issue — the section path was already corrected to
project-integrationsin #2477; this PR fixes the remaining hash.)Changes
Changed the deep-link hash from
#setting=integration-slackto the bare-anchor form#integration-slack.This matches exactly what PostHog's own
urls.settings(section, settingId)helper generates (viacombineUrl, a value-less hash key) and whatuseAnchorresolves to the Slack integration heading. The section path staysproject-integrations, the canonical alias ofenvironment-integrationswhere theintegration-slacksetting lives.How did you test this?
SettingsMap.tsx,settingsSceneLogic.ts,settingsLogic.ts,Settings.tsx,useAnchor.ts,urls.ts) thatintegration-slackis the real setting id, thatproject-integrationsis the canonical section, and thatuseAnchorscrolls to the bare#integration-slackanchor while#setting=...does not resolve on load.Automatic notifications
Created with PostHog Code