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

feat: add global system variable in builder #4896

Merged
merged 6 commits into from
Feb 22, 2025
Merged

Conversation

TrySound
Copy link
Member

Closes #4166

Now system is global variable and can be accessed in slots.

Legacy one can be deleted

image

Closes #4166

Now system is global variable and can be accessed in slots.
@TrySound TrySound requested review from kof and johnsicili February 21, 2025 06:13
Copy link
Contributor

@johnsicili johnsicili left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate

Click Global Root, click on system var, then click out and it duplicates.

Once it duplicates the system var doesn't have any data and it seems stuck there. Can't delete it.

dup.mp4

Info about delete legacy

Can we add one of those hints that informs the user about this option? I think the answer is always "it's safe to delete" if I understand the logic correctly and the user does not need to do anything else.

The first bug is preventing me from doing testing because both of my legacy projects with lots of good testing stuff have the corrupted global system var. Will need to test more once fixed. If the fix isn't retro active, that's okay, I can create a new project.

@TrySound
Copy link
Member Author

Fixed saving system variable. It can no longer can be edited.

Info about delete legacy

This option is more for us to cleanup templates and our own projects. Legacy system variable should not affect users.

@kof
Copy link
Member

kof commented Feb 22, 2025

If user is trying to use the legacy system variable, we are still using the right one, right? So its not gonna get them confused about "why is this not working inside slots?"?

@TrySound
Copy link
Member Author

Slots will have access only to global one. Body and deeper will have access only to page one defined on body. And deleting the one on body will replace references to global one just like with regular variables. So we just treat page system variable like regular one in this case.

Copy link
Member

@kof kof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

conceptual review

@johnsicili johnsicili self-requested a review February 22, 2025 17:31
Copy link
Contributor

@johnsicili johnsicili left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work!

I still think there should be info about Delete Legacy Variable.

Users will see it and wonder if they should do it and if there are any implications for it.

Maybe something like "The legacy variable is safe to delete as references will fallback to the system variable on the Global Root."

@TrySound
Copy link
Member Author

Or I'll just leave it as "Delete Variable" to not confuse anybody

@TrySound TrySound merged commit 23034da into main Feb 22, 2025
29 checks passed
@TrySound TrySound deleted the global-system.staging branch February 22, 2025 18:46
istarkov pushed a commit that referenced this pull request Feb 23, 2025
Closes #4166

Now system is global variable and can be accessed in slots.

Legacy one can be deleted

<img width="264" alt="image"
src="https://github.com/user-attachments/assets/1c1d60f5-6be2-4871-9970-3593e3e7c08a"
/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Access global variables within slots
3 participants