Repository navigation
Description
Problem
src/components/layout/Navbar.tsx almost certainly renders role-dependent navigation (contributor/maintainer/sponsor dashboards, per UserRole in src/types/index.ts, plus the connect-wallet/connect-GitHub CTAs) and needs to reflect useAuth()'s user/loading state and useWallet()'s connection state correctly across every combination: logged out, logged in with no roles yet assigned, logged in with multiple roles (can a single AuthUser.roles: UserRole[] array hold more than one role simultaneously — e.g. someone who's both a maintainer and a sponsor? the type suggests yes), wallet connected vs. not, and the loading transitions between all of these on initial page load (since AuthContext's loading starts true and WalletContext has its own async initialization). A component this state-matrix-heavy is a prime location for rendering the wrong nav items during the loading window (e.g. briefly flashing "Connect GitHub" before AuthContext resolves an existing session, then flashing again to the logged-in state) or for incorrectly assuming a user has exactly one role when UserRole[] allows multiple, leading to a maintainer-and-sponsor user only ever seeing one of their two applicable dashboard links.
Why this is hard
- Requires reading
Navbar.tsx's actual current conditional-rendering logic in full to find every place it branches onuser,loading, walletaddress, and role membership, since this is exactly the kind of logic that accretes special cases over time and is easy to get subtly wrong without a systematic audit. - The multi-role case needs a real UX decision, not just a bug fix: if
rolescontains both"maintainer"and"sponsor", does the nav show both dashboard links, a role switcher, or default to one with a way to access the other? This requires making and implementing a deliberate choice given the type system explicitly allows it, rather than the nav silently only handling the single-role case because that's what was tested during development. - Loading-state flashing needs to be fixed by rendering a stable skeleton/neutral state during
AuthContext.loading === trueandWalletContext's equivalent initializing state, rather than defaulting to "logged out" appearance and correcting after — this requires auditing the exact initial render output against each context's true initial state. - Must verify this across real navigation scenarios: fresh load with a valid persisted token (should never flash logged-out), fresh load with no token (should correctly and immediately show logged-out, no flash of a phantom logged-in skeleton either), and the auth callback redirect flow (
/auth/callback→login()→ navbar update) transitioning live without a full page reload glitch.
Scope
- Fully audit
Navbar.tsx's conditional rendering against the real state matrix (auth loading/loaded × logged-in/out × wallet connected/not × single/multi-role). - Fix any loading-state flash by rendering a proper skeleton/neutral state tied to the real
loadingflags rather than defaulting to a specific auth state. - Implement and document a deliberate UX for the multi-role case.
- Verify the auth-callback-to-navbar-update transition is glitch-free without a full reload.
Acceptance criteria
- No flash of incorrect auth/wallet state on any fresh page load with a valid persisted session, verified via slow-network simulation to make the loading window visible.
- A test user with multiple roles sees a coherent, intentional multi-role nav experience, not just one role's links.
Activity
rupesh-kumar-sah commentedon Sep 14, 2026
Hello @maintainers,
I would like to resolve this issue. Here is my proposed execution plan:
Fix Navbar loading-state flashes and multi-role rendering logicwith clean React/Next.js components, responsive styling, and proper loading/error boundaries.Happy to pick this up today—please assign to me!
Chidubemkingsley commentedon Sep 26, 2026
@Chidubemkingsley has applied to work on this issue as part of the Stellar Wave Program's 9th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @Chidubemkingsley to this issue.
Marvellous805 commentedon Sep 26, 2026
@Marvellous805 has applied to work on this issue as part of the Stellar Wave Program's 9th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @Marvellous805 to this issue.
drips-wave commentedon Sep 26, 2026
Congratulations, @Chidubemkingsley! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on September 30, 2026.
🧑💻 @Chidubemkingsley: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.
Warning
When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.
🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.
🌊 Happy Wave 🌊
grantfox-oss commentedon Sep 27, 2026
🎉 This issue has been marked as completed on GrantFox!
@Chidubemkingsley's PR #564 was approved and merged by @chonilius.
🏆 @Chidubemkingsley: You earned 40 FoxPoints for this contribution! Your current tier: Builder (1,702 total points). Track your full progress on GrantFox.
👏 Great work, @Chidubemkingsley! Keep contributing to MergeFi.
drips-wave commentedon Sep 27, 2026
This issue has been completed by @Chidubemkingsley as part of the Stellar Wave Program's 9th Wave 🥳
😎 @Chidubemkingsley: You earned 200 Points for completing this issue! After the current Wave ends, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here. You can also Leave a review to share your experience working on this issue.
🧑💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.