website icon indicating copy to clipboard operation
website copied to clipboard

🐛 Bug: Navbar Active State Not Highlighting "Docs" and "Specification" on Related Pages

Open cbum-dev opened this issue 9 months ago • 3 comments

Describe the bug

Currently, the navbar does not highlight "Docs" or "Specification" as active when visiting pages related to specifications or documentation. This happens because the URL structure does not always contain /docs or /specification, making the active state logic ineffective.

This is little bit related to issue #1375 where previously the navbar was not active on tooling page. After fixing its working on both blogs and tooling page.

Steps To Reproduce

  1. Go to https://json-schema.org/draft/2019-09 (or any specification page).
  2. Notice that the "Specification" tab in the navbar is not highlighted as active.
  3. Similarly, visit any documentation-related page that does not contain /docs directly in the URL.
  4. The "Docs" tab does not show as active.

Expected Behavior

The "Specification" tab should be active when viewing any specification-related page (e.g., /draft/*). The "Docs" tab should be active when viewing any documentation-related page.

Screenshots

Image

Device Information [optional]

- OS:Linux
- Browser: Firefox
- version:

Are you working on this issue?

Yes

Do you think this work might require an [Architectural Decision Record (ADR)]? (significant or noteworthy)

Yes

cbum-dev avatar Mar 16 '25 18:03 cbum-dev

Navbar before. Image Navbar After. Image

@benjagm whats your thougts about this?

cbum-dev avatar Mar 16 '25 19:03 cbum-dev

Go ahead. Thanks.

benjagm avatar Mar 16 '25 19:03 benjagm

This is supposed to work as there is already an implementation for it, so please check this more in terms of bug than missing feature.

benjagm avatar Mar 16 '25 19:03 benjagm

Hi @cbum-dev , this issue is already fixed with this https://github.com/json-schema-org/website/pull/1537 PR , so I think we can close this as completed. Thank you !

Utkarsh-123github avatar Jun 28 '25 05:06 Utkarsh-123github