Skip to content

feat: add navigation loading skeleton#671

Merged
mikewheeleer merged 1 commit into
Talenttrust:mainfrom
AbuJulaybeeb:feature/navigation-11-skeleton
Jul 25, 2026
Merged

feat: add navigation loading skeleton#671
mikewheeleer merged 1 commit into
Talenttrust:mainfrom
AbuJulaybeeb:feature/navigation-11-skeleton

Conversation

@AbuJulaybeeb

Copy link
Copy Markdown
Contributor

Closes #647

What was done

  • Extracted navigation state into a custom useNavigation hook to facilitate handling edge cases (loading, error, and settled states).
  • Implemented a content-shaped loading skeleton in Navbar.tsx that matches the exact dimensions of the navigation list, utilizing existing animate-shimmer classes.
  • Introduced a fallback view for navigation failures.
  • Maintained a strict zero-layout-shift experience.

Why it was done

To prevent layout shift and confusing empty states when the application navigation is initializing or when data fetching causes the navigation to delay mounting.

How it was verified

  • Added comprehensive unit tests in Navbar.test.tsx simulating slow load, fast load, and error states.
  • Audited all 3 edge-case states dynamically with jest-axe to enforce accessibility standards (aria-busy, aria-hidden management, etc.).
  • npm run lint, npm test, and npm run build all pass successfully.

This implements a content-shaped loading skeleton for the Navbar to
prevent layout shift during initialization. It matches the shape of
the navigation links and replaces them while the state settles.

- Created useNavigation hook to handle route loading state
- Added animate-shimmer skeleton to Navbar when isLoading is true
- Set aria-hidden on skeleton and aria-busy on the nav wrapper
- Handled error state with a fallback message
- Added robust test coverage for loading, error, and settled states
@drips-wave

drips-wave Bot commented Jul 25, 2026

Copy link
Copy Markdown

@AbuJulaybeeb Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@mikewheeleer

Copy link
Copy Markdown
Contributor

solid PR @AbuJulaybeeb — clear diff, good coverage. merging 🙌

@mikewheeleer
mikewheeleer merged commit 6e0aa2e into Talenttrust:main Jul 25, 2026
1 check passed
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.

Add a loading skeleton to the navigation view

2 participants