Skip to content

Unhide "scripts"/triggerless rules from "Rules" view#4290

Draft
Nadahar wants to merge 1 commit into
openhab:mainfrom
Nadahar:unhide-triggerless
Draft

Unhide "scripts"/triggerless rules from "Rules" view#4290
Nadahar wants to merge 1 commit into
openhab:mainfrom
Nadahar:unhide-triggerless

Conversation

@Nadahar

@Nadahar Nadahar commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

As was discussed here: openhab/openhab-core#5462 (comment), there seem to be some agreement that we should move away from the "script" concept, even though the exact road to get there isn't clear.

There is no technical difference between a triggerless rule and a "script", except that a "script" has the Script tag applied to it. This tag triggers specific functionality in MainUI that hides the rule under "Rules" in rules-list.vue and makes it show up under "Scripts" instead. However, "Scripts" doesn't allow the user to access the rule itself, it opens the script editor for the first Action directly.

DSL rules that have the .script extension automatically gets the Script tag applied. For other scripting languages, you must specifically create it under "Scripts" to have the tag applied - but it also prevents you from seeing the YAML view, modifying various details, and adding triggers or conditions. If you create it under "Rules" instead, you don't have all these restrictions, and the only thing you can't do with such a rule is to add the Script tag, because that tag is "banned" and is ignored if you try.

This PR simply removes the hiding of rules with the Script tag from the "Rules" view and unbans the Script tag so that it's possible to add manually. Apart from that, nothing else is changed, "Scripts" behave as before.

I see this as a "soft" first step towards removing the artificial difference in treatment between rules with and without the Script tag.

…pt" tag

Signed-off-by: Ravi Nadahar <nadahar@rediffmail.com>
@relativeci

relativeci Bot commented Jun 18, 2026

Copy link
Copy Markdown

#5875 Bundle Size — 13.84MiB (~+0.01%).

9dda24d(current) vs efb9ad3 main#5873(baseline)

Warning

Bundle contains 2 duplicate packages – View duplicate packages

Bundle metrics  no changes
                 Current
#5875
     Baseline
#5873
No change  Initial JS 1.46MiB 1.46MiB
No change  Initial CSS 0B 0B
No change  Cache Invalidation 0% 0%
No change  Chunks 842 842
No change  Assets 981 981
No change  Modules 2743 2743
No change  Duplicate Modules 0 0
No change  Duplicate Code 0% 0%
No change  Packages 122 122
No change  Duplicate Packages 1 1
Bundle size by type  Change 1 change Regression 1 regression
                 Current
#5875
     Baseline
#5873
Regression  JS 11.53MiB (~+0.01%) 11.53MiB
No change  CSS 902.38KiB 902.38KiB
No change  IMG 638.41KiB 638.41KiB
No change  Fonts 526.1KiB 526.1KiB
No change  Media 295.6KiB 295.6KiB
No change  Other 847B 847B

Bundle analysis reportBranch Nadahar:unhide-triggerlessProject dashboard


Generated by RelativeCIDocumentationReport issue

@Nadahar Nadahar changed the title Unhide "scripts"/triggerless rules from rules Unhide "scripts"/triggerless rules from "Rules" view Jun 18, 2026
@florian-h05 florian-h05 marked this pull request as draft June 24, 2026 10:03
@florian-h05

Copy link
Copy Markdown
Contributor

I would like to discuss this properly in an issue before changing it, also with an outline what to change and how.

@Nadahar

Nadahar commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

Sure, I had just had this in the back of my mind for a while that it would be a nice "first step" so that "Scripts" weren't suddenly removed before users had "gotten used to" them showing in "Rules", and then suddenly the 5.2.0 release was getting very close, so I just did this.

The thing is that the whole thing is quite unnatural as it is, because you can create rules without triggers already. The only difference between that and a script is the Script tag, and the fact that once you have created something "as a script", you're not allowed to use conditions or add a trigger later.

The exception is DSL rules, where .script files are automatically tagged with Script (so that they end up under "Scripts"), so those you "can't free" from the limitations of the "Scripts view". But, since triggerless .rules files are now allowed, you can just "convert" it to a .rules file instead, which is the exact same thing, only that it shows up under "Rules" instead.

To me, changing this just means getting rid of an inconsistency/obstacle.

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.

2 participants