-
Notifications
You must be signed in to change notification settings - Fork 0
Add modern field types (slider, qrcode, geolocation) with configuration schemas #80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
…nused import Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
|
This PR is very large. Consider breaking it into smaller PRs for easier review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR extends ObjectStack's field type system with three modern field types (slider, qrcode, geolocation) to enhance UI capabilities and match enterprise platform features. It also adds comprehensive examples demonstrating cross-field validation patterns already supported by the existing schema.
Changes:
- Added three new field types (slider, qrcode, geolocation) with full configuration schemas and factory helpers
- Added comprehensive test coverage for new field types
- Created example objects (Product, Event) demonstrating modern fields and cross-field validation
- Updated 231+ auto-generated JSON schemas to include new field types
- Updated documentation to reflect new field types
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/spec/src/data/field.zod.ts | Added 3 new field types to FieldType enum, configuration properties for slider/qrcode fields, and factory helpers |
| packages/spec/src/data/field.test.ts | Added comprehensive test coverage for new field types and factory helpers |
| packages/spec/json-schema/*.json | Auto-generated JSON schemas updated to include new field types |
| examples/modern-fields/src/product.object.ts | Example object demonstrating slider, qrcode, and geolocation fields in a product catalog context |
| examples/modern-fields/src/event.object.ts | Example object demonstrating cross-field validation with 6 validation rules (contains critical bug) |
| examples/modern-fields/README.md | Comprehensive documentation for new field types and validation patterns |
| content/docs/references/*/meta.json | Added "root": true to subdirectory meta.json files; removed pages from parent meta.json (contains critical bug) |
| IMPLEMENTATION_SUMMARY.md | Detailed implementation summary and impact assessment |
| }, | ||
|
|
||
| // Cross-field validation rules | ||
| validation: [ |
Copilot
AI
Jan 23, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The property name should be validations (plural) to match the ObjectStack schema convention. Based on the existing CRM examples in the codebase (e.g., examples/crm/src/domains/crm/account.object.ts:212), validation rules are defined under the validations property, not validation.
| validation: [ | |
| validations: [ |
| "pages": [ | ||
| "data", | ||
| "ui", | ||
| "system", |
Copilot
AI
Jan 23, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "api" and "client-sdk" pages were removed from the pages array, but these directories still exist in the codebase (content/docs/references/api/ and content/docs/references/client-sdk/). Removing them from the navigation will break documentation accessibility. This change should be reverted, or if these sections are intended to be removed, the actual directories should be deleted as well.
Note: The Chinese version at content/docs/references/meta.cn.json still includes these pages, creating an inconsistency between language versions.
| "system", | |
| "system", | |
| "api", | |
| "client-sdk", |
Extends field type system with modern UI controls to match enterprise platform capabilities. Cross-field validation already exists in
CrossFieldValidationSchema- added usage examples.New Field Types
slider- Numeric range with visual feedbackqrcode- Multi-format barcode support (QR, EAN13, Code128, UPC-A/E, Code39)geolocation- GPS coordinates (alias for existinglocationtype)Cross-Field Validation Examples
Added
examples/modern-fields/src/event.object.tsdemonstrating validation patterns:Schema Changes
FieldTypeenum: Addedslider,qrcode,geolocationFieldSchema: Added config properties (step,showValue,marks,barcodeFormat,qrErrorCorrection,displayValue,allowScanning)Field.slider(),Field.qrcode(),Field.geolocation()Examples
examples/modern-fields/src/product.object.ts- Product catalog with barcodes, stock sliders, warehouse geolocationexamples/modern-fields/src/event.object.ts- Event management with 6 cross-field validation rulesOriginal 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.