fix(InstallWizard): show auto-discovered optional fields on Additional page#1600
Draft
fix(InstallWizard): show auto-discovered optional fields on Additional page#1600
Conversation
When an amp.yaml object uses optionalFieldsAuto: all (without an explicit optionalFields list), the auto-discovered customer fields surface via manifest.getCustomerFieldsForObject(objectName).allFields rather than object.optionalFields. Sub-page routing and the Additional checkbox list both ignored that source, so the user landed on an empty Fields page and the Additional page itself was empty. - Update getSubPages() and useSubPageNavigation to treat an object as having optional fields when either the explicit list or auto-discovered customer fields are non-empty. - Merge auto-discovered customer fields into optionalFieldItems on the Additional page, deduping by field name and preferring explicit optionalFields so amp.yaml display names win. Closes #1599 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Closes #1599.
Summary
getSubPages()anduseSubPageNavigationnow consider an object to have optional fields when either the explicitoptionalFieldslist OR the auto-discovered customer fields (fromoptionalFieldsAuto: all) are non-empty. Auto-discovered fields surface viamanifest.getCustomerFieldsForObject(objectName).allFields.optionalFieldItemson the Additional page merges both sources, deduping by field name. ExplicitoptionalFieldsentries win on conflict so theamp.yaml-configured display names are preserved.Why
Before this change, an object whose
amp.yamldeclared onlyoptionalFieldsAuto: all(no explicitoptionalFields, no required fields, no mappings) would land on the empty Fields sub-page with "No configuration needed for X" — even though the user should have been able to pick from auto-discovered customer fields on the Additional sub-page.Test plan
optionalFieldsAuto: all→ wizard lands on Additional fields, all auto-discovered fields render as toggleable checkboxes.optionalFields:list → unchanged: lands on Additional, shows the explicit list.optionalFields:andoptionalFieldsAuto: all→ both render, explicit display names take precedence on duplicates.🤖 Generated with Claude Code