Skip to content
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

No easy way to store and restore UI/Component state #2385

Open
DefiDebauchery opened this issue Mar 5, 2024 · 0 comments
Open

No easy way to store and restore UI/Component state #2385

DefiDebauchery opened this issue Mar 5, 2024 · 0 comments
Labels
feature request New feature request
Milestone

Comments

@DefiDebauchery
Copy link
Contributor

DefiDebauchery commented Mar 5, 2024

Summary

Create interoperable child export and import methods for View Components

What is the feature request for?

The core library

The Problem

I'm looking for solutions on how to store Component states in a way that can be easily reapplied. Imagine you want to store the current state of your Buttons and such (e.g. label, disabled, etc) so that after changing some of the elements, you can wholly restore the View to that previous point if needed.

ui.View's .to_components() method returns a dict, which appears to be used in the raw payloads. However, the internal function _component_to_item, which takes component data to convert to the respective Item, expects a class instance.

The Ideal Solution

Create separate public methods that will export children as their Component classes so they could be subsequently replaced in a View.

The Current Solution

No response

Additional Context

No response

@DefiDebauchery DefiDebauchery added the feature request New feature request label Mar 5, 2024
@Lulalaby Lulalaby added this to the v2.6 milestone Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature request
Projects
None yet
Development

No branches or pull requests

2 participants