Skip to content

feat: load editor json from URL params#98

Merged
loggerhead merged 1 commit into
loggerhead:mainfrom
mondseon:codex/support-json-url-param
May 21, 2026
Merged

feat: load editor json from URL params#98
loggerhead merged 1 commit into
loggerhead:mainfrom
mondseon:codex/support-json-url-param

Conversation

@mondseon
Copy link
Copy Markdown
Contributor

@mondseon mondseon commented May 20, 2026

Summary

  • Load the editor's initial JSON from a json URL query parameter when present
  • Fall back to the existing example JSON when the parameter is absent
  • Add unit and e2e coverage for the URL parameter flow

Example

/editor?json=%7B%22hello%22%3A%22world%22%7D

Tests

  • pnpm vitest run __tests__/editorUrl.test.ts
  • pnpm tsc --noEmit
  • pnpm exec prettier --check src/containers/editor/editor/Editor.tsx src/containers/editor/editor/url.ts __tests__/editorUrl.test.ts e2e/tests/editor.spec.ts
  • pnpm exec next lint --file src/containers/editor/editor/Editor.tsx --file src/containers/editor/editor/url.ts

@loggerhead loggerhead merged commit 3d3f679 into loggerhead:main May 21, 2026
1 of 2 checks passed
@loggerhead
Copy link
Copy Markdown
Owner

Thanks for the PR!

@mondseon
Copy link
Copy Markdown
Contributor Author

Thanks for merging! I noticed json4u.com supports the new json URL parameter now, but json4u.cn still seems to serve the previous version. Is the .cn deployment updated separately?

@loggerhead
Copy link
Copy Markdown
Owner

Thanks for the reminder. I forgot that .cn requires manual deployment. It's been deployed just now.

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.

2 participants