Skip to content

Conversation

@colinl
Copy link
Collaborator

@colinl colinl commented Dec 15, 2025

Description

Fix widget enable/disable via ui_control node

Related Issue(s)

Partial fix for #711. Widget enable/disable fixed, but does not address widget show/hide

Checklist

  • [ x] I have read the contribution guidelines
  • Suitable unit/system level tests have been added and they pass
  • Documentation has been updated
    • Upgrade instructions
    • Configuration details
    • Concepts
  • Changes flowforge.yml?
    • Issue/PR raised on FlowFuse/helm to update ConfigMap Template
    • Issue/PR raised on FlowFuse/CloudProject to update values for Staging/Production
  • Link to Changelog Entry PR, or note why one is not needed.

Labels

  • Includes a DB migration? -> add the area:migration label

@Steve-Mcl
Copy link
Contributor

Partial fix for #711. Widget enable/disable fixed, but does not address widget show/hide

To include visibility fix, try adding:

            if (this.resizable === false && widget.state.visible === false) {
                classes.push('d-none')
            }

to ui/src/layouts/Group.vue at line 147 (inside getWidgetClass)

It is essentially stating: "If not wysiwyg editing (resizable false) and widget.state.visible is false, apply class d-hide"
d-hide remove the widget from webpage layout by setting display: none !important

@colinl
Copy link
Collaborator Author

colinl commented Dec 21, 2025

Excellent, that works if I pass msg.visible true or false direct to the widget.
It still doesn't work if I do it via the ui_control node. I will have a look at that.

@Steve-Mcl
Copy link
Contributor

Excellent, that works if I pass msg.visible true or false direct to the widget. It still doesn't work if I do it via the ui_control node. I will have a look at that.

Weird, it worked for me. Double check your msg is formatted to use

{ widgets: { show: ["id-of-node"], hide: [] } }

@colinl
Copy link
Collaborator Author

colinl commented Dec 21, 2025

It does work after I spell the node name correctly :)
I have done some more testing, with fully qualified node name, node not on screen when hiding and so on.
Ready for review.

Copy link
Contributor

@Steve-Mcl Steve-Mcl left a comment

Choose a reason for hiding this comment

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

Nice

@Steve-Mcl Steve-Mcl linked an issue Dec 21, 2025 that may be closed by this pull request
@Steve-Mcl
Copy link
Contributor

Another candidate for E2E tests here me thinks. Prevent regression or breakage of the features.
If you wanna gave a go pls. Also Happy to ship without E2E tests if we raise a follow up.

PS, in case it is not obvious, thanks very much for your contributions.
I wish I had more time to do more than test and review.
Hopefully we (FF) will be hiring more staff soon and this will ease up 🤞

@colinl
Copy link
Collaborator Author

colinl commented Dec 21, 2025

I will raise an issue for the E2E tests. I would like to get the remaining problems with chart options sorted first.

@Steve-Mcl Steve-Mcl merged commit ddb5563 into FlowFuse:main Dec 21, 2025
1 of 2 checks passed
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.

Show / hide widgets (finer granularity than on group level)

2 participants