-
-
Notifications
You must be signed in to change notification settings - Fork 514
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: button local variables #3314
base: develop
Are you sure you want to change the base?
Conversation
Well, as I see it we want 3 types of these local variables.
Once I started thinking about the data piping and backend structure to be able to do this (primarily needing to be able to host feedbacks), I realised that it would avoid a lot of complexity and risk of future bugs to make them part of the 'entity' system. Really the driving factor for this approach is 3; 1 & 2 are bonus side effects of this architecture. I am not set on the ui being this way, but it keeps the implementation simple. 2 isnt explicitly necessary, but I think it will be a nice thing to have to avoid having to repeat expressions in style elements. I don't know why I started with this one instead of the 'constant' value one |
OK, I'm fine if the UI looking different between the global and the local variables although I'd prefer some uniformity. If this proves to be superior maybe we carry it over to the global variables then. How will the expression type local variable behave if you set up two of them with cross references? E.g. local:var1 with the expression So, the constant type will have the options How about the feedback driven type? What is your UI suggestion for making the connection between the feedback and the variable? I'm not strongly against that implementation, but im not convinced yet. Local variables could be just like global variables with the same or similar UI and the only difference that they have is the scope of a control. A local variable that always reflects the result of an expression would not be possible that way, but tbh I fear more problems with that than the value is. We still have the unresolved challenge of circular references. The whole system of expressions that automatically subscribe to the needed values and automatically reevaluate in case of change has some appeal but also a lot of challenges and I think we will be better off when we try to avoid possible circular references and make the workflows more procedural. I think that will be much easier to understand for the users. Of course now we have established self reevaluating expressions and they are quite useful and we should keep them but maybe we can try to use them only for "terminal points". I have not a final solution for that problem and am very open for suggestions. When we solve the problem of circular references we also can introduce the functionality of the entity based expression type local variable with a internal feedback. Today we have internal: Variable: Check boolean expression for boolean values. That can be generic and then you just add that feedback, enter your expression and the feedback will always fill its local variable with the result of the expression. Technically it is the same as the expression type variable but we could avoid introducing many new and different entities. |
To explain some other decisions I made, I put these under the
To mitigate the risk of this, I have gone with an approach of lazily evaluating the expressions, so they will be evaluated when they are used rather than how we are doing feedbacks where we precalculate and cache the values. Of course the feedback based ones will need a different strategy, and will need some guard to prevent excessive recalculation which I havent begun thinking about
Yes, this would look the same as an action-group or the other composite action/feedbacks we have (logic and, logic or, logic if). In fact, unless we put the effort in to limit it, it will support all the recently added feedback logic operators
The reason I want this expression type is to avoid having to repeat myself in the style elements.
This branch is based off develop without any of the drawing work, to try and keep PRs small. But I am writing this for #3299 and what I think will be wanted for the new drawing, so some bits may be a bit weird and confusing when combined with the old buttons. I will answer the rest tomorrow, when I have some time to think about it more. |
If your expression produces a boolean then yes it is the same, but for any other value it isn't the same. So it would solve some use cases (with less technical complexity, and more user clicks), but not all of the use cases. It seems like the rest is based around the concern of circular references and trying to mitigate that, so with the lazy execution allowing circular references to be safe, maybe this is fine? |
2c1dc67
to
f157a05
Compare
WIP
Trying to build this as a new type of entity, in the hope that keeps things a bit simpler as these will need to support containing other entities (feedbacks)
TODO: