close
Skip to content

feat: validate page path doesn't exceed 255 characters#5704

Merged
kof merged 1 commit intowebstudio-is:mainfrom
zehjotkah:feat/validate-page-path-max-length
Apr 17, 2026
Merged

feat: validate page path doesn't exceed 255 characters#5704
kof merged 1 commit intowebstudio-is:mainfrom
zehjotkah:feat/validate-page-path-max-length

Conversation

@zehjotkah
Copy link
Copy Markdown
Contributor

What

Adds a 255-character limit validation to the page path in the builder's page settings.

Why

Previously, paths exceeding 255 characters would only cause a build failure. This change surfaces the error directly in the page settings UI, giving users immediate feedback when typing a path that's too long.

How

  • Added a .refine() to the DefaultPagePage Zod schema in packages/sdk/src/schema/pages.ts
  • Uses path.length <= 255 (safe because the upstream ASCII regex guarantees 1 byte = 1 character)
  • Error displays via the existing InputErrorsTooltip on the Path field, same as other validations (e.g., umlaut rejection)

Tests

Added boundary tests in packages/sdk/src/schema/pages.test.ts:

  • Path of exactly 255 characters → accepted ✅
  • Path of 256 characters → rejected with "Path can't exceed 255 characters" ✅

All 41 tests pass.

Add a .refine() to the DefaultPagePage Zod schema that rejects paths
longer than 255 characters. This surfaces the error in the builder's
page settings Path field instead of failing silently at build time.

- Added path.length <= 255 validation to DefaultPagePage
- Added boundary tests (255 accepted, 256 rejected)
- Error message: "Path can't exceed 255 characters"
@github-actions
Copy link
Copy Markdown

🚀 Deployed!

📍 Preview: https://pr-5704.development.webstudio.is

Note: Adding new commits will remove the safe-to-deploy label and require re-approval.

@kof kof temporarily deployed to development April 17, 2026 10:45 — with Image GitHub Actions Inactive
@kof kof temporarily deployed to development April 17, 2026 10:45 — with Image GitHub Actions Inactive
@kof kof merged commit 033e37a into webstudio-is:main Apr 17, 2026
21 of 24 checks passed
@kof
Copy link
Copy Markdown
Member

kof commented Apr 17, 2026

Merged, thank you!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants