Add example CustomAgentforceView and wire ViewProvider in HomeScreen#35
Open
asikora-sf wants to merge 13 commits intosalesforce:devfrom
Open
Add example CustomAgentforceView and wire ViewProvider in HomeScreen#35asikora-sf wants to merge 13 commits intosalesforce:devfrom
asikora-sf wants to merge 13 commits intosalesforce:devfrom
Conversation
Replace componentTypes[] + reactComponentName with a componentMap Record<string, string> so each SDK component type maps to its own React Native component name.
Bridges the native SDK view customization to React Native via RCTRootView. - BridgeViewProvider: canHandle() checks pre-registered types, view() renders RCTRootView in SwiftUI - registerViewProvider/clearViewProvider native methods exposed to JS - ViewProvider passed to AgentforceClient init when registered
Replace Set<String> + single reactComponentName with a [String: String] dictionary mapping each component definition to its own React component. canHandle() checks map keys, view() looks up the component name per type.
e2763f4 to
b89f3e3
Compare
RCTRootView embedded in UIViewRepresentable was getting zero size because SwiftUI had no sizing information. Set sizeFlexibility and implement sizeThatFits so the React content measures correctly.
Bridges the native SDK view customization to React Native via ReactRootView. - BridgeViewProvider: canHandle() checks pre-registered types, GetView() renders ReactRootView in Compose - registerViewProvider/clearViewProvider React methods exposed to JS - ViewProvider passed to AgentforceConfiguration builder when registered
Change BridgeViewProvider from N:1 (multiple types → one component) to 1:1 mapping (each type → its own React component name). The register() method now accepts a Map<String, String> and GetView() looks up the per-type component name from the map. Also update registerViewProvider in AgentforceModule to read componentMap from the ReadableMap instead of componentTypes array + reactComponentName.
…ceService Exposes view provider registration to JS consumers: - setViewProviderDelegate() registers component types + React component name with native - clearViewProviderDelegate() removes registration - Cleanup in destroy()
Pass componentMap (Record<string, string>) to native registerViewProvider instead of componentTypes array + reactComponentName, matching the 1:1 design change in the native layers.
…istence - Adds Custom View Provider toggle to Feature Flags tab in Settings - Persists flag via UserDefaults (iOS) and SharedPreferences (Android) - Reads/writes in getFeatureFlags, setFeatureFlags, and configure paths
- CustomAgentforceView: React Native component that renders in place of native SDK views - Registered via AppRegistry in index.js for native RCTRootView/ReactRootView rendering - HomeScreen checks enableCustomViewProvider flag and registers the delegate on mount - Handles copilot/richText and copilot/markdown as an example
Use the new 1:1 componentMap format in registerViewProviderIfEnabled instead of the old componentTypes + reactComponentName.
Replace raw JSON dump with recursive ValueRenderer that breaks out nested objects and arrays into structured tables up to 6 levels deep. Deeper nesting progressively compacts padding and key widths to stay usable on mobile screens.
be185e9 to
667a4dc
Compare
CCX-Wu
approved these changes
Mar 7, 2026
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
CustomAgentforceViewReact Native component that renders in place of native SDK viewsAppRegistry.registerComponent()inindex.jsenableCustomViewProviderfeature flag on mountcopilot/richTextandcopilot/markdowntypesclearViewProviderDelegate()Stack
PR 6/6 (final) in the
viewproviderstack. Depends on PRs #30-#34.Test plan
copilot/richTextandcopilot/markdowncomponents render as React Native views with blue "Custom RN View" badgedefinitionandpropertiesprops from nativeHow to test end-to-end