Skip to content

ix: resolve wiki breadcrumb crashes and browser redirect loop #346#413

Open
shivani11jadhav wants to merge 2 commits into
devpathindcommunity-india:masterfrom
shivani11jadhav:bugfix/wiki-breadcrumbs-loop
Open

ix: resolve wiki breadcrumb crashes and browser redirect loop #346#413
shivani11jadhav wants to merge 2 commits into
devpathindcommunity-india:masterfrom
shivani11jadhav:bugfix/wiki-breadcrumbs-loop

Conversation

@shivani11jadhav
Copy link
Copy Markdown

📝 Description

This PR addresses and completely resolves #346 by refactoring the local state architecture of the Wiki/Roadmap deep sub-pages into a modern, query-driven routing system. This fixes the client-side route crashes, state desynchronization, and the infinite back-navigation redirect loops.

🛠️ Changes Made

  • Decoupled Local State: Replaced the local useState hook for activeArticle inside src/app/wiki/page.tsx with Next.js App Router's dynamic hooks (useSearchParams and useRouter).
  • Unified Query Parameter System: Wired the sidebar and node selection to trigger a shallow history push via router.push('/wiki?article=id', { scroll: false }). This registers genuine browser history snapshots, fixing back-navigation gracefully.
  • Robust Nullish Defenses: Embedded double-nullish coalescing operators (??) across all breadcrumb extraction nodes and header text layouts to secure the interface from rendering crashes if invalid strings are queried.
  • Performance Optimization: Wrapped the primary search params consumers inside a React <Suspense> boundary to fulfill the Next.js static asset build criteria smoothly.

🧪 Verification & Testing

  • Validated via local TypeScript check (npx tsc --noEmit).
  • Confirmed that deep-linking directly via URL (e.g., /wiki?article=setup) successfully loads the targeted article content on mounting.
  • Verified that pressing the browser's native Back/Forward buttons smoothly steps through the visited wiki articles rather than dropping or blocking the router stack.

GSSoC '26 Contributor. Please review and merge this patch! 🙌

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Broken Breadcrumb Navigation and Redirect Loops on Deep Roadmap Sub-pages

1 participant