Skip to content

Conversation

@rakesh2OO5
Copy link

Fixes #477

Summary

Server-renders the reference directory to prevent the initial sidebar flash and layout shift caused by client-only hydration.

Changes

  • Added a server-rendered Astro component for the reference directory
  • Kept client-side filtering as a progressive enhancement
  • Updated ReferenceLayout to render the directory during SSR

Result

  • Sidebar appears immediately on load
  • No visible flash or layout jump
  • Filtering behavior remains unchanged

@stalgiag
Copy link
Collaborator

Thanks! I will try to review this some time in the next month. If any other reviewers gets here first, please by all means feel free to review ahead of me.

@coseeian coseeian requested a review from stalgiag January 19, 2026 22:20
@coseeian
Copy link
Collaborator

coseeian commented Jan 19, 2026

I pulled the changes to test them locally, but I noticed some unexpected UX on the page, and it seems like we’re still seeing the flash in the original nav (screenshot below).

Screen.Recording.2026-01-20.at.06.20.01.mov

It looks like the 'flashing' persists because the issue might be rooted deeper in how the global NavPanels component handles initial resizing on the client side (the desktop isOpen state being false by default): https://github.com/processing/p5.js-website/blob/main/src/components/Nav/NavPanels.tsx

Since this affects every page and not just the Reference section, I think we might need to shift our focus to that core component to truly solve the flash issue described in #477.

@rakesh2OO5
Copy link
Author

rakesh2OO5 commented Jan 20, 2026

Thanks for the detailed investigation and for pointing me to NavPanels.tsx.
I’ve converted this PR to draft while I rework the fix to address the root hydration mismatch in the global nav rather than just the reference directory.
I’ll mark it ready for review once the revised approach is pushed.

@rakesh2OO5 rakesh2OO5 marked this pull request as draft January 20, 2026 05:24
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.

Consider using transitions or reduce use of JS in the nav links

3 participants