Skip to content

fix(tutorial): show Reset after loading a solved lesson URL - #1682

Open
brenelz wants to merge 1 commit into
v2-rebuildfrom
fix/tutorial-solved-hydration
Open

brenelz wants to merge 1 commit into
v2-rebuildfrom
fix/tutorial-solved-hydration

Conversation

@brenelz

@brenelz brenelz commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator

Loading a lesson URL with ?solved directly (or refreshing after a client-side Solve, when the refresh goes through the trailing-slash redirect) showed the solved code in the editor, but the button still said "Solve" and linked back to ?solved, so clicking it did nothing.

The tutorial pages are prerendered, so the HTML is the same with or without the query and always renders "Solve". Hydration keeps that server text and href, while the client-only REPL reads the real URL and loads the solution.

The button now reads ?solved only after hydration, using a signal set in onSettled. This follows the pattern from the docs' SSR guide. The REPL still reads the query directly, since it only renders on the client.

The solved state still lives only in the URL. Lesson links drop it, so leaving a lesson and coming back resets the code. That part is unchanged.

Verification

  • pnpm build, then I served dist/client with a static server and ran a Playwright script covering a fresh load, clicking Solve, a refresh, clicking Reset and a direct /tutorial/welcome?solved load. Each step showed the matching label and href. On v2.solidjs.com, the direct load shows "Solve" with href="/tutorial/welcome?solved".
  • tsc --noEmit and prettier --check pass.

🤖 Generated with Claude Code

@bolt-new-by-stackblitz

Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@netlify

netlify Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for solid-docs-v2 ready!

Name Link
🔨 Latest commit eb0c731
🔍 Latest deploy log https://app.netlify.com/projects/solid-docs-v2/deploys/6ae41821e65a5e63ea89f4cd
😎 Deploy Preview https://deploy-preview-1682--solid-docs-v2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

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