[Fixed]: Navbar Active State Not Highlighting Docs and Specification related pages
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
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
isActivecondition only checked if therouter.asPathstarted with/docsor/specification, which did not account for related subpages like/overview/...or/draft/....Changes Made - Updated the
isActiveNavcondition to include relatedsubpaths:- Docs: Now considers
/overview/...as part of the "Docs" section. - Specification: Now includes
/draft/...as part of the "Specification" section.
- Docs: Now considers
Does this PR introduce a breaking change? No
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!
built with Refined Cloudflare Pages Action
⚡ Cloudflare Pages Deployment
| Name | Status | Preview | Last Commit |
|---|---|---|---|
| website | ✅ Ready (View Log) | Visit Preview | b5d2d7be8146ebf6af79453ba9d2e4ad002d8fba |
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.
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!
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!
@benjagm please review this PR.
Hi @KajalMishra-29 this issue was assigned to me. Please read the community guidelines.
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!
Thanks for the feedback, @DhairyaMajmudar! I’ll be more careful next time.
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.
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 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.
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!
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!
Congratulations, @KajalMishra-29 for your first pull request merge in this repository! 🎉🎉. Thanks for your contribution to JSON Schema!