Skip to content

[Fixed]: Navbar Active State Not Highlighting Docs and Specification related pages #1537

Merged
benjagm merged 3 commits intojson-schema-org:mainfrom
kajalmishra0829:fix/navbar-active-docs-spec
Jun 14, 2025
Merged

[Fixed]: Navbar Active State Not Highlighting Docs and Specification related pages #1537
benjagm merged 3 commits intojson-schema-org:mainfrom
kajalmishra0829:fix/navbar-active-docs-spec

Conversation

@kajalmishra0829
Copy link
Contributor

@kajalmishra0829 kajalmishra0829 commented Mar 17, 2025

What kind of change does this PR introduce?

  • Bugfix for Navbar Active State Not Highlighting Docs and Specification on related pages

Issue Number:

Screenshots
image
image
image

If relevant, did you update the documentation?
N/A

Summary

  • This PR fixes an issue where the navbar links for "Docs" and "Specification" were not highlighted as active when visiting related subpages.
  • Previously, the isActive condition only checked if the router.asPath started with /docs or /specification, which did not account for related subpages like /overview/... or /draft/....
    Changes Made
  • Updated the isActiveNav condition to include related subpaths:
    • Docs: Now considers /overview/... as part of the "Docs" section.
    • Specification: Now includes /draft/... as part of the "Specification" section.

Does this PR introduce a breaking change?
No

@kajalmishra0829 kajalmishra0829 requested a review from a team as a code owner March 17, 2025 05:48
@github-actions
Copy link

Hi @KajalMishra-29! Thanks a lot for your contribution!

I noticed that the following required information is missing or incomplete: issue reference

Please update the PR description to include this information. You can find placeholders in the PR template for these items.

Thanks a lot!

@github-actions
Copy link

github-actions bot commented Mar 17, 2025

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
website ✅ Ready (View Log) Visit Preview b5d2d7b

@codecov
Copy link

codecov bot commented Mar 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (72883db) to head (b5d2d7b).
Report is 35 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #1537   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           10        18    +8     
  Lines          396       448   +52     
  Branches       106       116   +10     
=========================================
+ Hits           396       448   +52     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link

Hi @KajalMishra-29! Thanks a lot for your contribution!

I noticed that the following required information is missing or incomplete: issue reference

Please update the PR description to include this information. You can find placeholders in the PR template for these items.

Thanks a lot!

1 similar comment
@github-actions
Copy link

Hi @KajalMishra-29! Thanks a lot for your contribution!

I noticed that the following required information is missing or incomplete: issue reference

Please update the PR description to include this information. You can find placeholders in the PR template for these items.

Thanks a lot!

@kajalmishra0829
Copy link
Contributor Author

@benjagm
please review this PR.

@cbum-dev
Copy link
Contributor

Hi @KajalMishra-29 this issue was assigned to me. Please read the community guidelines.

@kajalmishra0829
Copy link
Contributor Author

Hi @cbum-dev, I apologize for the confusion—I didn't realize the issue was assigned to you. I went ahead and resolved it, but if there's anything you'd like me to adjust or review, just let me know!

Copy link
Member

@DhairyaMajmudar DhairyaMajmudar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍🏻

@KajalMishra-29 But pls. take care from next time to not to open PRs for already issues, Thanks!

@kajalmishra0829
Copy link
Contributor Author

Thanks for the feedback, @DhairyaMajmudar! I’ll be more careful next time.

@cbum-dev
Copy link
Contributor

LGTM 👍🏻

@KajalMishra-29 But pls. take care from next time to not to open PRs for already issues, Thanks!

Changes made by her dont actually do the full job. For doing that either we have to put here all the urls or put all the blogs in the same folder.
Personally I am doing the second approach because its much more alligned with nextjs.

@cbum-dev
Copy link
Contributor

LGTM 👍🏻
@KajalMishra-29 But pls. take care from next time to not to open PRs for already issues, Thanks!

Changes made by her dont actually do the full job. For doing that either we have to put here all the urls or put all the blogs in the same folder. Personally I am doing the second approach because its much more alligned with nextjs.

What's your take in this @DhairyaMajmudar

@kajalmishra0829
Copy link
Contributor Author

kajalmishra0829 commented Mar 20, 2025

@cbum-dev I guess the approach you're suggesting would require modifying the code in multiple places. To avoid that, I opted for a shorter alternative by leveraging the fact that in the docs tab, inactive subpages always start from /overview, while in specification, inactive subpages start from /draft. I've also ensured that no other webpages follow this same pattern.

@Utkarsh-123github Utkarsh-123github moved this from Unclear to Waiting for others to Review in PR - Triage Group Jun 5, 2025
@github-actions
Copy link

Hi @KajalMishra-29! Thanks a lot for your contribution!

I noticed that the following required information is missing or incomplete: issue reference

Please update the PR description to include this information. You can find placeholders in the PR template for these items.

Thanks a lot!

@github-actions
Copy link

Hi @KajalMishra-29! Thanks a lot for your contribution!

I noticed that the following required information is missing or incomplete: issue reference

Please update the PR description to include this information. You can find placeholders in the PR template for these items.

Thanks a lot!

Copy link
Collaborator

@benjagm benjagm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some edge cases. Great work

@benjagm benjagm merged commit 5458a38 into json-schema-org:main Jun 14, 2025
8 of 9 checks passed
@github-project-automation github-project-automation bot moved this from Waiting for others to Review to Done in PR - Triage Group Jun 14, 2025
@github-actions
Copy link

Congratulations, @KajalMishra-29 for your first pull request merge in this repository! 🎉🎉. Thanks for your contribution to JSON Schema!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants