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
Rule & Script editor: Various improvements #2362
Conversation
Job #1584: Bundle Size — 11.01MiB (~+0.01%).Warning Bundle contains 19 duplicate packages – View duplicate packages Bundle metrics
Bundle size by type
View job #1584 report View jimtng:rule-module-popup-title branch activity View project dashboard |
Is there no way to make it work from there? Maybe there's a different way it can be adjusted so it's not so awkward to change them label (e.g. make the label and description editable from the main rule's page instead of needing to click on the Your changes for Scripts are a great way to address Scripts though and I really like it. But I miss something similar for triggers, other actions and other conditions. Though in those cases the default generated label and description is pretty good. All the rest of the changes are 👍 in my book. |
@rkoshak (and others) I'd appreciate your feedback for this PR, thanks!
To me, it doesn't seem to make a lot of sense letting them edit it there because they haven't even defined what module to use. Furthermore, the placeholders can't provide the default values because they depend on the selected module type, which the user hasn't selected yet.
Ha! I did not even know that the pencil icon leads you to something different with a small popup script editor! I was focusing only on the big editor (not clicking on the pencil icon). Had you not mentioned it here, I wouldn't have known. Letting them edit directly on the rules page, hmm... I can give that a try, but in a separate PR. I am trying to keep this small.
Hmm I wonder if you realised that you can actually change them. Click on the existing trigger / other actions, and those two input fields are there at the top, you can type in them! At some point I was going to add labels for those, but decided not to. Here's what it would look like with labels: |
True, but the user knows what they want this trigger/condition/action to do at that point. The label and description should cover the "what" more than the "how" (they can click on it and look at the config to see the how) and the "what" is independent from what ever module is used. If they choose to fill in their own label and description, the defaults from the module wouldn't apply. Only if they are left blank would the defaults from the module get added. And does that actually get added? It doesn't show up in the Code tab unless the user overrides it with their own. I always assumed the default label and description was generated dynamically in the browser.
👍
Oh yes, I know you can change them from there. But it's awkward to:
It's not super intuitive and definitely awkward which is one reason I don't thing a lot of people use these to help documented their rules better. I personally am not as concerned about making it obvious that you can edit the label and description in that secondary dialog as I am concerned about the fact that it works differently between triggers and conditions from actions and you have to click through to change it after the fact instead of being able to set it while you are creating the trigger/condition/action in the first place. That extra step is annoying. |
The pencil icons are shown for:
After pondering a bit about this, I think that there's an inconsistency in the current UI that caused this confusion. The first one doesn't have the pencil icon, the second one does. When no pencil icon is visible for the module, clicking anywhere on the line brings you to the However, for those two above (Cron and Script), the pencil icon is visible, then:
Therein lies the inconsistency. This behaviour should be flipped:
WDYT, @rkoshak, @ghys, @florian-h05 ? I understand that the current behaviour makes for a more efficient / streamlined process, because once the module was chosen, people mostly just want to edit the cron/script. BTW this "behaviour flip" isn't currently a part of this PR, and indeed is not what this PR is about. Depending on our consensus, it can be implemented in a different PR |
I don't have a problem with flipping it but wonder if this is one of those rare cases where we can have our cake and eat it too. What if instead of flipping the behavior we added the pencil icon and removed the "click anywhere/>" from those triggers/actions/conditions to don't have a separate editor? Then the most common action remains streamlined but the way to get to the regular config dialog is more consistent. |
good idea, except, I like how curently I can click anywhere, within a large area rather than having to do a precision click on the pencil icon. This ability to click anywhere speeds up the process, which is probably why it was designed like this in the first place |
It's maybe a cludge but what it we simply add the pencil icon but leave the click anywhere? Can we remove the ">" symbol too? Then maybe it will be more clear what to expect when clicking. I do realize this mostly just moves the confusion and doesn't really solve it. But maybe it will help some users if the pencil icon is consistently shown. Another idea would be to eliminate the pencil icon entirely. Embed the "metadata" fields into the script editor and cron builder dialogs so there is no need to have two separate dialogs for those (and any future trigger/action/condition that needs it's own dialog). I don't know if that's feasible but it certainly would normalize the rule's page. They would all work the same. |
Actually, I think this is not a downside for people who want to edit the raw cron expression, it's actually a plus. |
Agreed 👍
Sounds fine to me.
Yes, might be true, but I don't think it is a large downside, especially compared to the improved consistency. This really reduces overall complexitiy of the rule editor and makes it more consistent, which I think is always a good thing. So it seems like this PR is not ready for review yet, correct? |
Since I designed those screens, a few remarks:
I'm good with it, especially in that 4-button screen.
Nice, but you changed the upper-right "Done" from "Save" - it is really a save though?
👍
I want to avoid native dropdowns in general as their rendering can be quite ugly sometimes. I don't think this is necessary. |
Indeed it's a Save, because if you clicked the Back link (top left) instead, the edited values will be discarded/not saved.
I tried reverting to the radio buttons but it takes up too much vertical space, even when only 2 languages installed (rulesdsl + ecma or ruby), causing a vertical scroll bar to show up. So I've converted it to smart-select with a Screenshot below
Should I add the titles/labels for the input fields on the create/edit module popup? |
d377ce2
to
dd46e65
Compare
Updated the original post with the latest state + screenshots |
Note: Now that Scripts don't go to rule-module-popup, perhaps these can be removed:
|
dd46e65
to
e8aaaad
Compare
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
e8aaaad
to
0545745
Compare
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
I will take care of the dirty handling in a seperate PR.
@@ -296,3 +296,16 @@ html | |||
|
|||
.sitemap-validation-dialog | |||
--f7-dialog-width 80% | |||
|
|||
// Align smart-select item with f7-list-input fields | |||
.aligned-smart-select |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice to have this style now available globally!
emits: ['newLanguage'], | ||
components: { | ||
RuleGeneralSettings | ||
}, | ||
computed: { | ||
editable () { | ||
console.log('module') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will remove this logging, seems like a leftover from development.
FYI to inspect the value of properties during development, the Vue DevTools browser extension is a great tool: https://github.com/openhab/openhab-webui/blob/main/bundles/org.openhab.ui/CONTRIBUTING.md#vue-devtools.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LOL thanks! I installed this but haven't taken the time to learn how to use it.
Missed these in openhab#2362 Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
Missed these in #2362. Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
Various improvements to the rule editor and script editor
Done
toSave
Script Editor:
Remove the Title/Description input in the Add [Trigger/Action/Condition]
They don't seem to apply to anything
Before:
After:
Change the popup title from
Edit module
toEdit [Trigger/Action/Condition]
Before:
After:
Change the title of script editor
Before:
After:
And when the action has a custom label:
So user can see whether it's an action script or a condition script from the editor's title
Removed pencil icons
Before:
After:
Allow changing the script module's title and description
Before:
Currently it's not possible to do this. There is no input / way to do it
After:
Also the "Scripting Language" selection has been changed into a smart-select sheet selection.