Skip to content

Fix profile tab routing#13835

Merged
dylanjeffers merged 2 commits intomainfrom
cursor/profile-tab-routing-62c4
Mar 6, 2026
Merged

Fix profile tab routing#13835
dylanjeffers merged 2 commits intomainfrom
cursor/profile-tab-routing-62c4

Conversation

@dylanjeffers
Copy link
Contributor

Fixes profile tab routing to correctly display the specified tab for profile sub-routes like /handle/albums.

This PR resolves a race condition in the useProfilePage hook where the activeTab was incorrectly reset to null and then overridden by the default tab logic before the URL tab could be applied. The fix ensures the URL tab parameter is prioritized during initialization and preserved when the profile handle changes.


Slack Thread

Open in Web Open in Cursor 

When navigating to profile sub-routes like /handle/albums or /handle/playlists,
the page was incorrectly showing the first tab instead of the tab specified in the URL.

This was caused by a race condition in useProfilePage where:
1. The profile handle change would reset activeTab to null
2. The default tab logic would then set it to the first tab
3. The URL tab effect would try to set the correct tab, but too late

Fixed by:
- Initializing activeTab state with the URL tab parameter if present
- Preserving the URL tab when resetting state on profile handle changes
- Adding params.tab to the dependency array of the reset effect

Also added a test to verify the fix works correctly.

Co-authored-by: Dylan Jeffers <dylanjeffers@users.noreply.github.com>
@cursor
Copy link
Contributor

cursor bot commented Mar 6, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@changeset-bot
Copy link

changeset-bot bot commented Mar 6, 2026

⚠️ No Changeset found

Latest commit: adc1f5b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@dylanjeffers dylanjeffers marked this pull request as ready for review March 6, 2026 20:26
@dylanjeffers dylanjeffers changed the title Profile tab routing Fix profile tab routing Mar 6, 2026
@dylanjeffers dylanjeffers merged commit 04cf0e3 into main Mar 6, 2026
4 checks passed
@dylanjeffers dylanjeffers deleted the cursor/profile-tab-routing-62c4 branch March 6, 2026 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants