Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Update dashboard.test.ts to reflect the new required 'id' field (SnakeCaseIdentifierSchema) added to DashboardWidgetSchema. - Add meaningful snake_case id to every widget object in tests - Update WidgetActionTypeSchema tests: 'script' and 'api' are now valid types - Remove outdated assertion that 'script' should be rejected Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…onditional validation, easing naming, migrate HTTP schemas, rename theme enums, add responsive to ListView Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix UI protocol design flaws and merge duplicate specs
fix: UI protocol design defects — widget id, action type unification, conditional validation, naming consistency
Feb 24, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes multiple UI protocol design defects identified in issue #805, including missing widget IDs, inconsistent action types, absent conditional validation, and naming inconsistencies. The changes ensure protocol consistency, improve referenceability, and align with the project's naming conventions (snake_case for data values, camelCase for configuration keys).
Changes:
- Added required
idfield toDashboardWidgetSchemafor targetWidgets referencing in global filters - Unified
WidgetActionTypeSchemawithActionSchema.typeby adding missingscriptandapitypes - Added
.superRefine()conditional validation toPageSchemafor type-specific required fields - Renamed animation timing keys in
AnimationSchemato snake_case (ease_in,ease_out,ease_in_out) - Added
themeTokenreference support toTransitionConfigSchemafor theme animation token binding - Added
responsiveandperformancefields toListViewSchemafor consistency with other UI components - Migrated
HttpMethodSchema/HttpRequestSchemafromview.zod.tstoshared/http.zod.tswith backward-compatible re-exports - Renamed theme enums to
ThemeModeSchema/DensityModeSchema/WcagContrastLevelSchemawith deprecated aliases
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/spec/src/ui/dashboard.zod.ts | Added required id field to DashboardWidgetSchema, added script and api to WidgetActionTypeSchema |
| packages/spec/src/ui/dashboard.test.ts | Updated all 100+ widget test fixtures with id field, added 27 new tests for widget id and action type changes |
| packages/spec/src/ui/page.zod.ts | Added superRefine conditional validation for record_review and blank page types |
| packages/spec/src/ui/page.test.ts | Updated 5 existing tests and added 6 new tests for conditional validation |
| packages/spec/src/ui/theme.zod.ts | Renamed timing keys to snake_case, renamed enums to *Schema suffix with deprecated aliases |
| packages/spec/src/ui/theme.test.ts | Updated timing key references, added 3 new test suites for naming changes |
| packages/spec/src/ui/view.zod.ts | Replaced HttpMethod/Request definitions with imports from shared, added responsive/performance fields to ListView |
| packages/spec/src/ui/view.test.ts | Added 2 new test suites for responsive/performance and backward compatibility |
| packages/spec/src/ui/animation.zod.ts | Added themeToken field to TransitionConfigSchema |
| packages/spec/src/ui/animation.test.ts | Added test suite for themeToken support |
| packages/spec/src/shared/http.zod.ts | Added HttpMethodSchema and HttpRequestSchema migrated from view.zod |
| packages/spec/src/shared/http.test.ts | Added 2 test suites for migrated HTTP schemas |
| packages/spec/src/stack.test.ts | Updated 3 widget fixtures with required id field |
| ROADMAP.md | Updated last modified date and added 8 completed tasks documenting all schema changes |
20 tasks
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.
Addresses multiple UI protocol design issues: naming conflicts, missing referenceability, inconsistent action types, absent conditional validation, and misplaced shared schemas.
Schema changes
DashboardWidgetSchema— Add requiredid: SnakeCaseIdentifierSchemasoGlobalFilterSchema.targetWidgetscan actually reference widgetsWidgetActionTypeSchema— Addscriptandapito matchActionSchema.type(was missing 2 of 5 types)PageSchema— Add.superRefine()enforcingrecordReviewwhen type isrecord_review,blankLayoutwhen type isblankAnimationSchema(theme.zod) — Rename timing keys to snake_case:easeIn→ease_in,easeOut→ease_out,easeInOut→ease_in_outTransitionConfigSchema— Add optionalthemeTokenfor theme animation token bindingListViewSchema— Addresponsiveandperformancefields (already present on Dashboard/Component, was missing here)HttpMethodSchema/HttpRequestSchema— Move canonical definition toshared/http.zod.ts, re-export fromview.zod.tsThemeModeSchema/DensityModeSchema/WcagContrastLevelSchema; old names kept as deprecated aliasesExample: conditional page validation
Tests
32 new tests added covering all new behaviors. All existing tests updated for schema changes. 6507 tests pass.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.