Skip to content

fix: ui state sync, curl escaping, SSR theme hydration, error boundary reset#611

Open
Markadrian6399 wants to merge 1 commit into
Haroldwonder:mainfrom
Markadrian6399:fix/ui-state-and-curl-fixes
Open

fix: ui state sync, curl escaping, SSR theme hydration, error boundary reset#611
Markadrian6399 wants to merge 1 commit into
Haroldwonder:mainfrom
Markadrian6399:fix/ui-state-and-curl-fixes

Conversation

@Markadrian6399
Copy link
Copy Markdown

@Markadrian6399 Markadrian6399 commented May 30, 2026

Summary

  • ApiRequestPanel — editableBody sync: Added useEffect to reset editableBody and clear JSON validation errors when the requestBody prop changes, fixing stale textarea content when switching between endpoints.
  • ApiRequestPanel — curl quote escaping: Header values in generateCurl now have " escaped to \" before interpolation, preventing syntactically invalid curl commands.
  • useTheme — SSR hydration fix: sysDark now initialises to false (server-safe) and is updated on the client inside useEffect, eliminating the hydration mismatch that occurred when the server rendered dark=false but the client immediately switched to dark=true.
  • AnchorErrorBoundary — resetKeys prop: Added a resetKeys?: unknown[] prop and getDerivedStateFromProps logic (standard React pattern) that automatically clears the caught error state when any key value changes, unblocking users stuck on the error screen after the parent swaps in a new component tree.

Test plan

  • Switch between endpoints in ApiRequestPanel — textarea should update to new body each time
  • Pass a header value containing " to ApiRequestPanel — generated curl should have \" and be valid
  • Render useTheme in an SSR environment (e.g. Next.js) — no hydration mismatch warning in console
  • Trigger an error in a child wrapped by AnchorErrorBoundary with resetKeys, then change a key value — error screen should clear automatically

closes #508
closes #509
closes #510
closes #511

…heme, add resetKeys to error boundary

- ApiRequestPanel: sync editableBody via useEffect when requestBody prop changes
- ApiRequestPanel: escape double quotes in header values inside generateCurl
- useTheme: initialise sysDark to false to prevent SSR/hydration mismatch
- AnchorErrorBoundary: add resetKeys prop + getDerivedStateFromProps to auto-reset error state

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 30, 2026

@Markadrian6399 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

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