feat(ui-set): refine creation form workflow - #216
Conversation
UI Set creation needs structured dimensions and ordered component input. Add canvas presets, component management, and local-only submission feedback. Keep generation requests disconnected while the backend workflow is pending.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Adding a component reset every component card to expanded. Update only affected expansion indexes when components are added or removed. Keep creators' collapsed component layout intact.
UI Set drafts carried a stale generic canvas size alongside structured dimensions. Derive the canvas size from dimensions when creating drafts and requests. Ensure UI Set request metadata remains internally consistent.
UI Set drafts gained stable component identities and centralized canvas constraints. Keep form defaults stable across renders while submitting schema-transformed data. Cover component editing, canvas selection, and local UI Set submission.
|
/review -claude |
|
/review |
claude 已经关闭了,大家平时使用 “/review” 就好,目前默认是 gpt-5.6 sol |
There was a problem hiding this comment.
Reviewed the complete UI Set form, draft/schema conversion, caller integration, and localization changes. The structured canvas/component state and local-only submit behavior align with the issue contract, but the validation path has one localization regression noted inline. Focused tests could not run because the environment has Node 20.20.2 while pnpm 11 requires Node 22.13+ and imports the unavailable node:sqlite module.
| .int() | ||
| .refine(isUISetCanvasHeight, "Select a supported canvas height."), | ||
| }), | ||
| style: z.string().trim().min(1, "UI Set style is required."), |
There was a problem hiding this comment.
[P2] Localize UI Set validation messages
The form displays result.error.issues.map((issue) => issue.message) verbatim, but these new UI Set schema messages are hard-coded English strings. As a result, users with the Simplified Chinese locale see English errors when style, component names/descriptions, or supported dimensions are invalid, despite the PR adding the corresponding localized resources and the issue requiring localized validation. Emit translation keys/codes from validation (or map the issues through t) before rendering them.
Change Description
Implementation Approach
isCustomcomponent field and add localized UI Set labels and validation messages.Related Issue
Closes #208
Testing
pnpm.cmd exec vitest run src/features/generation/lib/asset-creation.test.ts src/i18n/resources.test.ts- passed.pnpm.cmd build- passed.Screenshots or Recordings
Not included.
Risks and Follow-ups
Checklist