website icon indicating copy to clipboard operation
website copied to clipboard

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

Open kajalmishra0829 opened this issue 9 months ago • 12 comments

What kind of change does this PR introduce?

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

Issue Number:

  • #1535

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 avatar Mar 17 '25 05:03 kajalmishra0829

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[bot] avatar Mar 17 '25 05:03 github-actions[bot]

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

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

github-actions[bot] avatar Mar 17 '25 05:03 github-actions[bot]

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

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     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

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

codecov[bot] avatar Mar 17 '25 05:03 codecov[bot]

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[bot] avatar Mar 17 '25 05:03 github-actions[bot]

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[bot] avatar Mar 17 '25 06:03 github-actions[bot]

@benjagm please review this PR.

kajalmishra0829 avatar Mar 17 '25 06:03 kajalmishra0829

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

cbum-dev avatar Mar 17 '25 07:03 cbum-dev

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!

kajalmishra0829 avatar Mar 17 '25 07:03 kajalmishra0829

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

kajalmishra0829 avatar Mar 19 '25 04:03 kajalmishra0829

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 avatar Mar 19 '25 17:03 cbum-dev

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

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

@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.

kajalmishra0829 avatar Mar 20 '25 04:03 kajalmishra0829

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[bot] avatar Jun 14 '25 06:06 github-actions[bot]

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[bot] avatar Jun 14 '25 07:06 github-actions[bot]

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

github-actions[bot] avatar Jun 14 '25 07:06 github-actions[bot]