feat(install-wizard): support unresolved mapped objects in amp.yaml#1583
Draft
dionlow wants to merge 3 commits into
Draft
feat(install-wizard): support unresolved mapped objects in amp.yaml#1583dionlow wants to merge 3 commits into
dionlow wants to merge 3 commits into
Conversation
Adds runtime support for amp.yaml read objects declared with only a mapToName (no concrete objectName). When the InstallWizard encounters one, it prompts the user for the provider-side object name, fetches its field metadata via getObjectMetadataForConnection, and hydrates the manifest with the resolved object so downstream configuration continues unchanged. - New useObjectMetadataForConnectionQuery hook (ObjectsFieldsApi). - New ResolvedMappedObjectsProvider holds mapToName → resolution map and seeds from existing Installation.config on re-entry. - useManifest merges resolutions into the hydrated revision so the rest of the wizard (tabs, fields, mappings, draft, review) stays oblivious to the pre-resolution state. - New ResolveMappedObjectSubPage renders the input, handles API errors, and swaps the selectedObjects entry from mapToName → resolvedObjectName on success. - SelectObjectsStep and ObjectTabs show a "Needs setup" badge for unresolved objects; ConfigureObjectsStep adds an Edit affordance for previously resolved objects. - WizardContext gains a REPLACE_SELECTED_OBJECT action that preserves currentObjectIndex. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Plan is tracked internally; keeping it out of the public repo. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6f2eacb to
2781f53
Compare
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
Adds runtime support for
amp.yamlread objects declared with only amapToName(no concreteobjectName). When theInstallWizardencounters one, it prompts the user for the provider-side object name, fetches its field metadata viagetObjectMetadataForConnection, and hydrates the manifest with the resolved object so downstream configuration continues unchanged.useObjectMetadataForConnectionQueryhook (wrapsObjectsFieldsApi.getObjectMetadataForConnection).ResolvedMappedObjectsProviderholdsmapToName → resolutionand seeds from an existingInstallation.configon re-entry.useManifestmerges resolutions into the hydrated revision; every downstream consumer (tabs, fields, mappings, draft, review) stays oblivious to the pre-resolution state.ResolveMappedObjectSubPage— text input + inline error + submit; on success swaps the wizard's selection entry frommapToName→ resolvedobjectName.SelectObjectsStepandObjectTabsrender a "Needs setup" badge for unresolved objects.ConfigureObjectsStepgates on unresolved objects and adds an Edit affordance for ones that were previously resolved.WizardContextgains aREPLACE_SELECTED_OBJECTaction that preservescurrentObjectIndex.Design doc:
MAPPED_OBJECT_RESOLUTION_PLAN.md.Backend dependencies (confirm before merging)
HydratedIntegrationObjectmay arrive with empty/missingobjectNameand a populatedmapToName.Installation.config.read.objects[<resolvedName>]must be accepted on create with a user-chosenobjectNamethat isn't in the manifest, and must be echoed back on read so the wizard can rehydrate previously resolved objects.Test plan
Fixture setup
amp.yamlthat declares at least one read object withmapToName+mapToDisplayNamebut noobjectName(e.g.mapToName: customContacts).getHydratedRevision(objectName empty, mapToName set).Happy path
SelectObjectsSteplists the unresolved object by itsmapToDisplayNamewith a "Needs setup" badge. Selecting it works.ConfigureObjectsStepfor the unresolved tab,ResolveMappedObjectSubPagerenders with the prompt "Which object represents<mapToDisplayName>?".contacts) transitions into the normalFieldsContentflow with the provider's fields populated.createInstallationpayload:config.content.read.objects[<resolvedName>].objectName === <resolvedName>(not themapToName).API error path
Edit affordance
ResolveMappedObjectSubPage; the badge/state reverts to unresolved.Rehydration (re-entering an existing installation)
FieldsContent(noResolveMappedObjectSubPage).Regressions
objectNameread objects still render unchanged through Select → Configure → Review → Install.Configureflow (non-wizard) is unaffected — it usesuseManifestoutside theResolvedMappedObjectsProvider, which falls back to an empty resolutions map.yarn tsc --noEmitclean;yarn lintproduces no new errors.🤖 Generated with Claude Code