New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
All Platforms: Modally presented popover server driven components. #1838
Comments
Hello @bradleysmaskell This is a very interesting feature request. Implementing this is indeed harder than we'd like and it would be in our interest to create something to make it easier. Having said this, I think there might be an easier way to achieve this result. Have you tried the following?
By using the Global Context, when you update it from the modal, it should automatically update the other view. A native support in BeagleTo implement a native support for this in Beagle, we need:
We're developing a "version of Beagle" for SwiftUI and Compose called "Nimbus". We do have this feature there. Can you take a look at the implementation in Nimbus and tell us if it would work for you? If it does work for you, we can consider bringing it to Beagle. Link to this feature in nimbus: https://github.com/ZupIT/nimbus-docs/blob/main/specification/default-actions/navigation.md#more-on-states-and-events The example above navigates to a new screen. But, in Nimbus, we have the action "present", that works the same way, but opens a modal view instead. Summary
|
Hi, I'm passing here just to let you know that the Beagle team is taking some vacation time. We'll take 2 weeks off and be back at Feb 06. Feel free to keep commenting in this issue and we'll address it as soon as we're back. |
Thanks @Tiagoperes. We will try this approach and report back. |
Closing this due to inactivity. |
Use case
For context our BFF is written in Kotlin using Quarkus, client apps are written in Kotlin/Swift/reactJS.
In one of our server-driven screens we have a
ListView
component. One of theTemplate
s has aTouchable
component. When pressed we want to modally present a popover ViewController/Dialog which contains aServerDrivenComponent
and aContext
so that selections made in the popover update the parent Activity/ViewControllers context.Issues
Navigate.PresentModalView
action onNavigate
in Beagle andNavigate
is not extendable.ServerDrivenComponent
, there's no way to render the component.func execute(controller: BeagleController, origin: UIView)
the renderer onBeagleController
isprivate
and theBeagleEnvironment.renderer
is internal.fun execute(rootView: RootView, origin: View)
it's not clear what we need to call onRootView
to render aServerDrivenComponent
Because of these issues, we had to just create a custom action that presents/shows a preexisting client-driven view and have our custom action listen for events so that we can execute/handle cancellation/apply actions. After those actions are completed, to update the parent Activity/ViewController we had to do the following on both platforms.
Android
fragment.activity
oractivity
toBeagleActivity
internal
toBeagleActivity
and there's no way to refresh the screens content from the BFF or context we had to callfinish()
andstartActivity()
to get the updates from the popover screen, which causes the screen to disappear and be recreated which isn't the best user experience.iOS
BeagleController
to aBeagleScreenViewController
BeagleScreenViewController
we have to callreloadScreen(with screenType: ScreenType)
which doesn't deallocate and recreate the VC as it does on Android, but still causes the parent VC to flicker while it fetches it's data and presents it again.There's not really a lot of helpful documentation around this use case, so any advice would be really helpful.
Proposal
The text was updated successfully, but these errors were encountered: