feat(fdc3) - Modified Fdc3 native client to allow argumetns from ctor; improved documentation, added client factory to allow shell specific client creation#1253
Open
lilla28 wants to merge 2 commits intomorganstanley:mainfrom
Conversation
improved documentation, added client factory to allow shell specific client creation; Refactor FDC3 startup properties and channel selector; Introduce Fdc3StartupProperties class, replacing Fdc3Properties for startup configuration and updating all references. Refactor IDesktopAgentClientFactory and IStartupModuleHandler to use the new property structure, centralizing FDC3 startup logic. Move ModuleChannelSelector to Shared library for broader reuse. Expand and clarify README with detailed guidance on channel selector integration, UI responsibilities, and app channel usage. Improve ChannelHandler to trigger channel selector UI updates after channel joins. Refactor ContextListener unsubscribe logic for robust async error handling. Remove obsolete NativeInProcess module type and update project dependencies. Overall, enhance maintainability, clarity, and container UI integration.
5d795be to
c703e97
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.
Description:
The most recent updates simplify in-process app onboarding and make the Desktop Agent client easier to configure in host applications.
Key improvements:
DesktopAgentClientcan now be instantiated with explicit values for AppId, InstanceId, initial user channel, and opened app context (with environment variable fallbacks).IDesktopAgentClientFactoryabstraction: Allows the host (e.g., ComposeUI Shell) to create and wireIDesktopAgentinstances in a shell-specific way while keeping the client implementation decoupled.Fdc3StartupPropertiesmodel: Provides a structured way for in-process apps to register their FDC3 identity information so they can participate correctly in the FDC3 ecosystem.Additional changes in the desktop agent service and startup modules (internal behavior updates). This commit focused primarily on the client-side and dependency injection story.
Usage
Registering the Desktop Agent client (default)
The simplest way to use the client is to register it via dependency injection:
Explicit configuration (optional)
If an application does not set the following environment variables, we can now pass them directly into the
DesktopAgentClientconstructor:AppIdentifier.AppIdAppIdentifier.InstanceIdFdc3StartupParameters.Fdc3ChannelId(initial user channel to join)Fdc3StartupParameters.OpenedAppContextId(context identifier to request from the FDC3 backend/middleware if the app was opened via thefdc3.opencall)Example manual registration (useful for native hosts):
Using the shell-specific factory
To support shell-specific wiring and to allow multiple in-process apps to coexist, we must allow consumers implementing and registering
IDesktopAgentClientFactoryin their host.The factory can be used by modules to obtain a ready-to-use
IDesktopAgent. The factory should be able to match theFdc3Propertiesset viaRegisterInProcessAppPropertiesAsyncwhile returning back the client to properly identify the instance which was started using theIModuleLoader. A callback will ensure that theIDesktopAgentis ready once the initialization step is finished on the client implementation and ready for use by the consumers:Registering in-process app properties
In-process apps can register their identity information via
Fdc3Properties:Snapshots:
