-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Lens] Formula transition enhancements #110298
Comments
Pinging @elastic/kibana-app (Team:KibanaApp) |
@MichaelMarcialis I was looking into this and there is one scenario I'm wondering about: Clicking on the formula tab would still allow switching back the existing formula. |
@flash1293: I'm not sure I'm understanding. Wouldn't this be exactly how the transition between formula and quick functions works today, just without the callout notifying users that the formula is still in effect? Or are you saying that no quick function should ever be pre-selected (whether transitioning from the formula tab or creating a new dimension)? I imagine that would be problematic from a defaults standpoint, as it would cause a visualization not to be rendered until the user has manually configured the required dimensions, correct? |
Yes, my question is about keeping this behavior if there is no "last selected quick function", but selecting it if we know about it. |
Are you saying in situations where there is no selected quick function (such as when a user manually adds a dimension to a visualization layer, prior to a field being selected) that we continue to show it in its unselected state when transitioning from formula to quick functions? If so, yes, I believe that makes sense. However, if a field has indeed been selected, I fear that allowing the quick functions to exist in a state where no function is selected creates more problems than it solves (both in the transition from formula to quick functions and the transition from static value to quick functions). Personally, I'd prefer a quick function always be selected if the field is known (either by recalling the last selected quick function or selecting the most likely function as a sensible default). |
Yes, exactly
Agreed. I think we are on the same page here, I will try to implement this (there are some code structure issues with this, this is why we split it out back then) and open a PR where we can iterate in case it's necessary |
I had a quick look at this issue and tried to understand how things will change with the proposed changes.
Notes:
|
Thanks for putting this matrix together, @dej611! Adding my questions/comments for you below: Scenario 5Are you asking what happens given the following scenario?
If so, I believe this is referring to the scenario @flash1293 and I discussed above, and that we should give the "Quick function" mode that default, unselected state (which I imagine would then also treat the visualization in the workspace as if that dimension has not been populated yet). There would be no callout indicating that a formula is still being applied, as it wouldn't be. Let me know if I've misunderstood though. Scenario 7If it's been detected that a user has customized their own formula, then I believe navigating from "Formula" to "Quick function" and then back to "Formula" mode should continue to retain that custom formula (and no longer auto-translate the previously selected quick function to formula). Doing so ensures that the user won't inadvertently lose their work. Scenario 8The result here depends on whether a quick function was selected in the first step:
Scenario 9Again, the result here depends on whether a quick function was selected in the first step AND whether a custom formula was authored in the second step:
Let me know if this makes sense or if you have any additional questions. |
I haven't covered this specific scenario in the matrix, so I'd call it Scenario 10 (will update the matrix), but yes Scenario 5 will fall into this as well. I've updated the matrix table to cover all scenarios now with all their variants. |
Thanks, @dej611. The updates to the matrix appear correct to me. |
Closing this because it's not planned to be resolved in the foreseeable future. It will be tracked in our Icebox and will be re-opened if our priorities change. Feel free to re-open if you think it should be melted sooner. |
The problem
Lens has recently seen the addition of a new "Formula" feature, allowing uses to write their own custom formula in situations where our "Quick functions" do not meet the user need. Users are able to freely move between these "Quick functions" and "Formula" using a tab-based interface, however the way transitions are handled between the tabs is a little rough around the edges.
When transitioning from the "Quick functions" tab to the "Formula" tab, we convert the last selected quick function into the equivalent formula automatically for the user (this is good). When transitioning from the "Formula" tab to the "Quick functions" tab, the visualization continues to use the custom formula, the "Select a function" field is in a null state (no quick function selected), and a warning message is presented to the user telling them that their formula is still being applied (this is bad). They are told they must select a quick function in order to overwrite their formula, destroying the formula in the process (this is also bad).
Ideally, we shouldn't be 1) scaring users with such a warning message, 2) unnecessarily overwriting any custom formula work, and 3) demanding that users take additional actions in order to quickly visualize both quick functions and formula results when transitioning between tabs.
Possible solution
My first instinct is to say that when transitioning from the "Formula" tab to the "Quick functions" tab, we should never allow for "Select a function" to be in a null state. A quick function should always be selected.
In this case, assuming the user has made a custom formula and then traverses from the "Formula" tab back to the "Quick functions" tab, I think we should revert to the last selected quick function prior to the user switching to make a custom formula.
We'd also need to make sure that whatever changes/customizations the user made in the "Formula" tab are not lost, so that if the user made a mistake and wishes to go back to "Formula", their custom formula remains.
This direction avoids needing to present the user with a warning message, prevents overwriting any custom formula they've created, and requires no extra action to visualize results when transitioning between tabs.
This enhancement may be related to: #75204
Example
The text was updated successfully, but these errors were encountered: