feat: validate page path doesn't exceed 255 characters#5704
Merged
kof merged 1 commit intowebstudio-is:mainfrom Apr 17, 2026
Merged
feat: validate page path doesn't exceed 255 characters#5704kof merged 1 commit intowebstudio-is:mainfrom
kof merged 1 commit intowebstudio-is:mainfrom
Conversation
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"
|
🚀 Deployed! 📍 Preview: https://pr-5704.development.webstudio.is Note: Adding new commits will remove the |
Member
|
Merged, thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
.refine()to theDefaultPagePageZod schema inpackages/sdk/src/schema/pages.tspath.length <= 255(safe because the upstream ASCII regex guarantees 1 byte = 1 character)InputErrorsTooltipon the Path field, same as other validations (e.g., umlaut rejection)Tests
Added boundary tests in
packages/sdk/src/schema/pages.test.ts:All 41 tests pass.