Repository navigation
feat(resource-kit): start a create form on a field's value default - #61
Merged
Merged
Conversation
ResourceField.createDefault took only 'now', for dates. A field whose column has
a database default, such as a priority select defaulting to Medium, opened as
None, although saving it empty stored Medium. createDefault now also takes
{ value }, which a create form starts on; explicit form defaults and edit forms
keep taking precedence.
|
Review complete. No issues found — approved ✅. This PR extends the resource-kit create-default mechanism so fields can declare a default as an object ( Reviewed commit: 3ce30b3 |
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.
Summary
A create form now opens on a field's database default instead of an empty control.
ResourceField.createDefaulttakes{ value }alongside'now'. A create form starts that field on the value: a priority select defaulting toMediumshows Medium, not None.defaultValues, such as a related list's parent) still wins, and edit forms still read the stored value.ResourceField.createDefaultdescribes both forms.Context
Found while dogfooding desktop v0.1.0-beta.4: a generated "New wishlist idea" form showed
Nonefor a required priority, and saving it empty storedMedium, so the data was right but the form hid the default. Once this lands inregistry-dist, the app template's generator will emitcreateDefault: { value }from the AppSpec field'sdefault(_metaonly says a column has a default, not which), and the desktop will move its registry pin.🤖 Generated with Claude Code
https://claude.ai/code/session_017WbsG7JQsKEMKNgVsc4psk