Skip to content

fix: hydration-safe initialization for useOverlays and useCollapsible - #4402

Merged
jpr5 merged 1 commit into
mainfrom
fix/tally-trigger-hydration
Apr 29, 2026
Merged

jpr5 merged 1 commit into
mainfrom
fix/tally-trigger-hydration

Conversation

@jpr5

@jpr5 jpr5 commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • useOverlays hook read URL hash + localStorage in useState initializer, producing different DOM on server vs client → React Support for custom props and middleware #418
  • useCollapsible hook read localStorage in useState initializer → same issue
  • Both now initialize with server-safe defaults and sync from client state in useEffect after hydration

Test plan

  • 338 tests pass
  • Dashboard loads at #matrix:depth,health with zero console errors
  • Overlay state persists correctly (URL hash + localStorage)
  • Collapsible category state persists across reloads

@vercel

vercel Bot commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
chat-with-your-data Building Building Preview, Comment Apr 29, 2026 1:06am
docs Building Building Preview, Comment Apr 29, 2026 1:06am
form-filling Building Building Preview, Comment Apr 29, 2026 1:06am
research-canvas Building Building Preview, Comment Apr 29, 2026 1:06am
travel Building Building Preview, Comment Apr 29, 2026 1:06am

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

📣 Social Copy Generator

Generate social media copies (Twitter/X, LinkedIn, Blog Post) for this PR using Claude.

  • Generate social media copies

@jpr5
jpr5 merged commit b136d85 into main Apr 29, 2026
10 of 11 checks passed
@jpr5
jpr5 deleted the fix/tally-trigger-hydration branch April 29, 2026 01:06
zeekay pushed a commit to Dream-AI-4444/CopilotKit that referenced this pull request Sep 11, 2026
…CopilotKit#4402)

## Summary
- `useOverlays` hook read URL hash + localStorage in `useState`
initializer, producing different DOM on server vs client → React CopilotKit#418
- `useCollapsible` hook read localStorage in `useState` initializer →
same issue
- Both now initialize with server-safe defaults and sync from client
state in `useEffect` after hydration

## Test plan
- [x] 338 tests pass
- [ ] Dashboard loads at `#matrix:depth,health` with zero console errors
- [ ] Overlay state persists correctly (URL hash + localStorage)
- [ ] Collapsible category state persists across reloads

This branch was successfully deployed

5 active deployments
Preview – research-canvas — 016f355c Deployed Apr 29, 2026 by vercel[bot]
Preview – travel — 016f355c Deployed Apr 29, 2026 by vercel[bot]
Preview – docs — 016f355c Deployed Apr 29, 2026 by vercel[bot]
Preview – form-filling — 016f355c Deployed Apr 29, 2026 by vercel[bot]
Preview – chat-with-your-data — 016f355c Deployed Apr 29, 2026 by vercel[bot]
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.

1 participant