solidjs / solid-docs

SolidJS Docs.
https://docs.solidjs.com/
228 stars 275 forks source link

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

Closed JoltCode closed 1 month ago

JoltCode commented 4 months 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 4 months 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 4 months 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
brenelz commented 1 month ago

I couldn't seem to replicate this issue, but i could be doing something wrong

JoltCode commented 1 month ago

I couldn't seem to replicate this issue, but i could be doing something wrong

Looks like this was fixed! https://github.com/solidjs/solid-docs/commit/58356a0a969aa92014d30df6240146044ba90482

Thanks so much @atilafassina 😄🚀!