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

[blockly] Small improvements to blocks #2742

Merged
merged 5 commits into from
Sep 12, 2024

Conversation

mherwege
Copy link
Contributor

@mherwege mherwege commented Sep 6, 2024

When going through the available blocks, I saw potential for a few small improvements, which I collected in this PR:

  • Persistence previous...State and next...State blocks: add boolean shadow block for skip same, default false
  • Named timer blocks: add a undefined shadow block for context.
  • run rule or script block: make the parameter dictionnary input a shadow block

The above does not change functionality, but I find it cleaner to always a default attached to the input, even if it is not required for the code. It avoids users thinking they need to put something in. Having a default indicates the default will work unless they need something specific.

In addition to that, for the transform block, I made the transformation dropdown dependent on the installed transformations.

@mherwege mherwege requested a review from a team as a code owner September 6, 2024 06:47
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
@mherwege mherwege force-pushed the blockly_persistence branch from 851c89b to 41a03e4 Compare September 6, 2024 06:48
Copy link

relativeci bot commented Sep 6, 2024

#2249 Bundle Size — 10.83MiB (~+0.01%).

157a586(current) vs 920466e main#2248(baseline)

Warning

Bundle contains 2 duplicate packages – View duplicate packages

Bundle metrics  Change 1 change
                 Current
#2249
     Baseline
#2248
No change  Initial JS 1.89MiB 1.89MiB
No change  Initial CSS 576.5KiB 576.5KiB
Change  Cache Invalidation 18.22% 17.92%
No change  Chunks 226 226
No change  Assets 249 249
No change  Modules 2914 2914
No change  Duplicate Modules 149 149
No change  Duplicate Code 1.8% 1.8%
No change  Packages 96 96
No change  Duplicate Packages 2 2
Bundle size by type  Change 1 change Regression 1 regression
                 Current
#2249
     Baseline
#2248
Regression  JS 9.05MiB (~+0.01%) 9.05MiB
No change  CSS 863.17KiB 863.17KiB
No change  Fonts 526.1KiB 526.1KiB
No change  Media 295.6KiB 295.6KiB
No change  IMG 140.74KiB 140.74KiB
No change  HTML 1.36KiB 1.36KiB
No change  Other 871B 871B

Bundle analysis reportBranch mherwege:blockly_persistenceProject dashboard


Generated by RelativeCIDocumentationReport issue

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Copy link
Contributor

@florian-h05 florian-h05 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

Just one thing: The code of transformationOptions() can be simplified, I will push a commit for that soon.

@florian-h05 florian-h05 added enhancement New feature or request main ui Main UI labels Sep 12, 2024
@florian-h05 florian-h05 added this to the 4.3 milestone Sep 12, 2024
@florian-h05 florian-h05 changed the title [blockly] small improvements to blocks [blockly] Small improvements to blocks Sep 12, 2024
@florian-h05 florian-h05 merged commit d79efb7 into openhab:main Sep 12, 2024
8 checks passed
@mherwege mherwege deleted the blockly_persistence branch September 12, 2024 23:48
@stefan-hoehn
Copy link
Contributor

@mherwege Has this been updated in the docs?

@florian-h05
Copy link
Contributor

I don‘t think these minor changes (basically add shadow blocks where they were missing) needs a doc update. Do you agree?

@mherwege
Copy link
Contributor Author

mherwege commented Dec 16, 2024

@stefan-hoehn @florian-h05 I agree I don't think this needs further documentation. The purpose of this was to make things clearer when building Blockly rules, so it does not need all the documentation.

@stefan-hoehn
Copy link
Contributor

Agreed. It would be just nice if the pics would be updated but I myself refrain from doing so often as it is not worth the effort.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request main ui Main UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants