solidjs / solid-docs-next

SolidJS Docs.
https://docs.solidjs.com/
208 stars 225 forks source link

[Bug]: Sidebar doesn't change tab to reference when changing to a reference page #800

Open JoltCode opened 1 week ago

JoltCode commented 1 week ago

📝 Issue Description

The tabs on the left sidebar don't change according to whether it is a learn/reference section page.

📋 On which page(s) it occurs

All

🤔 Expected Behavior

When navigating to a reference page, the sidebar should change to reference, and vice versa for learn pages.

👀 Current Behavior

When you go to a reference page either via CMD+K or from a direct link, the sidebar is not on the correct tab.

🖥️ Browser

Arc Version 1.49.0 (51346) Chromium Engine Version 126.0.6478.127

📄 Additional Information

No response

JoltCode commented 1 week ago

It's weird because it looks like this is implemented but not working - https://github.com/solidjs/solid-docs-next/blob/8a386c1c4b666efac9a0f3a6bc98519da5a7b850/src/ui/layout/main-navigation.tsx#L143-L166

atilafassina commented 1 week ago

Right, thanks for finding this.

It works well on soft navigation, but hard navigation doesn't.

Reproduction steps

  1. Navigate to https://docs.solidjs.com/solid-router/reference/data-apis/create-async
  2. Observe it loads the sidebar for the router correctly, but shows the learn tab instead of reference