Skip to content

fix: show fallback mobile docs title - #2626

Merged
vtushar06 merged 1 commit into
json-schema-org:mainfrom
Sravan1011:fix/mobile-sidebar-title
Nov 11, 2026
Merged

vtushar06 merged 1 commit into
json-schema-org:mainfrom
Sravan1011:fix/mobile-sidebar-title

Conversation

@Sravan1011

@Sravan1011 Sravan1011 commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

Bug fix. This change fixes the mobile documentation-sidebar title for routes that are not represented in the current hardcoded section-path arrays.

Issue Number:

Screenshots/videos:

Not applicable. This is a small text-only mobile-navigation fallback change.

If relevant, did you update the documentation?

No documentation update is required. The change fixes the website navigation UI and adds regression coverage.

Summary

On mobile viewports, SidebarLayout determines the blue navigation bar title using separate route-array checks. For routes such as /work-in-progress, no array matched and the intended fallback was unreachable because it checked router.pathname === null. Next.js provides a pathname, so the mobile title was blank.

This PR adds a getMobileSectionTitle helper that preserves the existing titles for recognized routes and returns Docs for any unlisted route. It replaces the repeated conditional headings with one heading and adds a Cypress component regression test for /work-in-progress.

Does this PR introduce a breaking change?

No. Existing mobile section titles are unchanged; unlisted documentation routes now show Docs instead of a blank title.

Checklist

  • Read, understood, and followed the contributing guidelines.
  • Ran ./node_modules/.bin/tsc --noEmit.
  • Added a Cypress component regression test for the fallback title.
    • Attempted to run the Cypress component test locally; Electron could not launch because of this environment’s Linux sandbox restriction.

@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

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

@codecov

codecov Bot commented Nov 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (ebe20c2) to head (b1078a5).

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #2626   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           31        31           
  Lines          737       737           
  Branches       229       229           
=========================================
  Hits           737       737           

☔ View full report in Codecov by Harness.
📢 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.

@Sravan1011

Copy link
Copy Markdown
Contributor Author

@vtushar06 can you review this and merge it

shivaminfo1
shivaminfo1 previously approved these changes Nov 11, 2026

@shivaminfo1 shivaminfo1 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks @Sravan1011, clean fix for the blank mobile docs title, with a test to back it. LGTM!

@Sravan1011

Copy link
Copy Markdown
Contributor Author

@shivaminfo1 can you merge this

@vtushar06
vtushar06 dismissed shivaminfo1’s stale review November 11, 2026 17:49

Posted from the wrong account by mistake.

@vtushar06 vtushar06 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks @Sravan1011, clean fix for the blank mobile docs title, with a test to back it. LGTM!

@vtushar06
vtushar06 merged commit 925ed38 into json-schema-org:main Nov 11, 2026
11 of 15 checks passed
@github-project-automation github-project-automation Bot moved this from Ready to review to Done in PR - Triage Group Nov 11, 2026

This branch was successfully deployed

1 active deployment
Preview — b1078a54 Deployed Nov 2, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

🐛 Bug: Broken mobile docs navigation header title due to unreachable router.pathname === null check in SidebarLayout

3 participants