Skip to content

Conversation

@MakhBeth
Copy link
Contributor

No description provided.

@MakhBeth MakhBeth changed the title Defaults Streamline defaults value management Nov 13, 2025
Copilot finished reviewing on behalf of MakhBeth November 13, 2025 22:52
Copy link

Copilot AI left a 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 refactors default value management in OmegaForm by consolidating default value extraction logic and introducing more flexible configuration options.

  • Removes the defaultAST.ts file and moves deepMerge function to OmegaFormStuff.ts
  • Introduces a new defaultFromSchema configuration option with three modes: "only", "nope", and "merge"
  • Replaces the complex extractSchemaDefaults function with a simpler defaultsValueFromSchema implementation

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
packages/vue-components/stories/OmegaForm/Defaults.vue Adds comprehensive test story demonstrating various default value scenarios and configuration options
packages/vue-components/stories/OmegaForm.stories.ts Registers the new Defaults story component
packages/vue-components/src/components/OmegaForm/useOmegaForm.ts Updates default value logic to use new defaultsValueFromSchema function and implements defaultFromSchema configuration option
packages/vue-components/src/components/OmegaForm/defaultAST.ts Removes entire file containing previous default extraction implementation
packages/vue-components/src/components/OmegaForm/OmegaTaggedUnionInternal.vue Simplifies tagged union handling by removing complex default value extraction logic for union member switching
packages/vue-components/src/components/OmegaForm/OmegaFormStuff.ts Adds new deepMerge and defaultsValueFromSchema functions; refactors metadataFromAst (formerly flattenMeta) to return metadata and default values
packages/vue-components/tests/OmegaForm/WithDefaultConstructorPersistency.test.ts Updates test expectations to match new default value behavior
.changeset/slow-regions-sleep.md Documents the change as a minor version bump

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI commented Nov 13, 2025

@MakhBeth I've opened a new pull request, #561, to work on those changes. Once the pull request is ready, I'll request review from you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants