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

[Feature Request] Allow making a system wide component from an existing screen element #130

Open
KallDrexx opened this issue Dec 28, 2023 · 1 comment
Assignees

Comments

@KallDrexx
Copy link
Collaborator

KallDrexx commented Dec 28, 2023

Sometimes you set up elements on one screen, and realize you want to repeat those elements on other screens. You can manually copy/paste from one screen to the other, but it can also make sense to make a system wide component out of that element, so that it's centrally managed for all screens it's relevant on.

This is important because it's not trivial to see the values you set for an existing element when trying to recreate it for a new component.

@vchelaru vchelaru self-assigned this Dec 29, 2023
@vchelaru
Copy link
Owner

This concept is similar to the concept in Visual Studio where you can select a block of code and extract method.

Phase 1:

  1. Right-click on an instance in a screen or a component
  2. Select the option "Create Component"
  3. A popup appears similar to the add component popup which asks the user for the name of the component. For now, we can make this just go into the root folder and we can add folder support later.
  4. When the user clicks OK, a new component is created with the desired name from the popup.
  5. The component should have its base type be set to the type of the selected instance from step 1. This should be initially tested with Container as the base type since that's the most common type, and then test it with more complex types later.
  6. Each child of the selected instance from step 1 should be copied in to the newly-created component
  7. Each variable from the default state for any of the copied instances should be copied over to the new component.
  8. Copy variables from the instance onto the newly-created component.

Phase 2:

  1. Add a checkbox that the user can select "Replace {InstanceName} and all children with an instance of the new component
  2. If checked, and if the user selects OK, delete all children of the instance that was selected and the instance itself
  3. Add a new instance with the same name that is of the type of the newly created component. All variables on the instance itself should remain.

Notes:

@vchelaru vchelaru removed their assignment Aug 23, 2024
@akaadream akaadream self-assigned this Aug 23, 2024
vchelaru added a commit that referenced this issue Sep 4, 2024
Create a component base on element instances #130
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants