Fix input widget inconsistencies#2256
Conversation
ES-Alexander
left a comment
There was a problem hiding this comment.
Some positive updates here, and I think some miscommunication - likely on my part 😅
I've put comments as seems relevant.
| @@ -431,10 +432,15 @@ watch( | |||
|
|
|||
| const getMarginsFromBarsHeight = computed(() => { | |||
There was a problem hiding this comment.
Yep, adding the issue to the PR
a7d56d2 to
f344920
Compare
6b8d844 to
2f35ca8
Compare
rafaellehmkuhl
left a comment
There was a problem hiding this comment.
Besides the minor JSDocs thing, there's a few other things I think need to be addressed:
- The dial is not beng greyed-out when connected to read-only variables.
-
The greyed-out versions of the Slider and Dropdown components is almost invisible, looking like there's an empty space there instead of a widget.
-
I think the tooltip for the read-only was not implemented. It's an important one, since it's a direct communication to the user about what's happening.
-
The tooltip in the AlertIcon was implemented using the
titleattribute, which is not great since it needs a long (usually 2) hovering to appear. Better to use Vuetify'sv-tooltipor a dedicated library like Floating UI. -
The AlertIcon is in a strange position now. Maybe better located in the center of the widget?
| defineProps<{ | ||
| /** | ||
| * | ||
| */ | ||
| icon?: string | ||
| /** | ||
| * | ||
| */ | ||
| color?: string | ||
| /** | ||
| * | ||
| */ | ||
| animation?: 'pulse' | 'ping' | 'bounce' | 'spin' | '' | ||
| /** | ||
| * | ||
| */ | ||
| tooltip?: string |
I really think we should not grey out when connected to read only variables. This would make it hard to read the values
👍
👍
I'll replace it by the v-tooltip
I've tested on the center of the widget and it looks odd to me, covering too much of the main component. I think is better to place it on the lower right |
I agree. It's just that all other widgets are being greyed-out, with the exception of the Dial. |
I think it is ok to cover the mini-widget, as it's not working after all. The only case where it really hides the widget is the Checkbox. In the corner right now it's looking kinda odd. Anyway, no big deal about that if you prefer not change. Can we just standardize the position? As can be sheen in the screenshot, the icon is on a different position for each widget, so it does not look finished/polished. |
ES-Alexander
left a comment
There was a problem hiding this comment.
Nice to have some improvements to the alert setup, and to have the connected status separated out (although it seems to have been applied a little overzealously 😅)
Some comments/suggestions to clarify :-)
| :disabled="widgetStore.editingMode || !isConnected || !isInput" | ||
| :class="{ 'opacity-30': !isConnected }" |
There was a problem hiding this comment.
| :disabled="widgetStore.editingMode || !isConnected || !isInput" | |
| :class="{ 'opacity-30': !isConnected }" | |
| :class="{ 'pointer-events-none': !isInput }" | |
| :disabled="widgetStore.editingMode || !isConnected" |
I think when it's an output it's not disabled, so we don't want it to look greyed out (otherwise it's hard to read as an indicator) - we just don't want users to be able to change the value of it. I'm unsure whether pointer-events-none also prevents us from being able to do @rafaellehmkuhl's tooltip idea though (letting users know that it's an "indicator for the XXX output variable")...
I also think making it less opaque at the same time as disabling it is likely to make it hard to see at all, since disabling already makes it quite faint.
Similar ideas apply to the other widgets.
| ) | ||
|
|
||
| const isConnected = computed(() => { | ||
| return miniWidget.value.options.dataLakeVariable?.id || widgetStore.editingMode |
There was a problem hiding this comment.
| return miniWidget.value.options.dataLakeVariable?.id || widgetStore.editingMode | |
| return miniWidget.value.options.dataLakeVariable?.id |
Editing mode is a separate thing, right? If they all show up as disconnected (e.g. with the alert icon and all) when in editing mode then the user could think they're going crazy - especially if they just configured the variable 😅
There was a problem hiding this comment.
This is simply to prevent the AlertIcon from appearing in EditingMode. Otherwise, the UI would become crowded with unnecessary information, making it harder for the user to position the input widgets.
In any case, the configuration screen appears as soon as the user adds an input widget, naturally prompting them to configure it.
There was a problem hiding this comment.
Given this function is not just used for the alert icon, shouldn't that be handled as an additional conditional in the alert icon instead?
| class="value-display bg-[#FFFFFF22] border-[1px] rounded-md p-[2px] min-w-[40px] text-center elevation-1" | ||
| :class=" | ||
| isInput && isEditingValue | ||
| isConnected && isEditingValue |
There was a problem hiding this comment.
I believe this, and the others in this HTML section, were indeed supposed to be checking if it's an input (which already implies it's connected). The elements that are being selectively displayed are value-modifying elements, so they only make sense to display if the connected variable can be modified.
| color="#b9af1d" | ||
| animation="pulse" | ||
| class="absolute center ml-10 mt-[10px]" | ||
| tooltip="This element isn't connected to a data-lake variable yet. Right click and select options to configure it." |
There was a problem hiding this comment.
| tooltip="This element isn't connected to a data-lake variable yet. Right click and select options to configure it." | |
| tooltip="This element isn't connected to a data-lake variable yet. Click here to configure it." |
There was a problem hiding this comment.
Good catch! I'll fix that
| if (isInput.value && !widgetStore.editingMode) { | ||
| if (isConnected.value && !widgetStore.editingMode) { |
There was a problem hiding this comment.
We should only allow editing input variables, not any connected variable.
| if (!isInput.value) return | ||
| if (!isConnected.value) return |
There was a problem hiding this comment.
The dial should only be user-movable for input variables.
|
|
||
| const startEditingValue = (): void => { | ||
| if (widgetStore.editingMode || !isInput.value) return | ||
| if (widgetStore.editingMode || !isConnected.value || isInput.value) return |
There was a problem hiding this comment.
| if (widgetStore.editingMode || !isConnected.value || isInput.value) return | |
| if (widgetStore.editingMode || !isConnected.value || !isInput.value) return |
No modifying the value if:
- currently in edit mode (doing higher level interface editing)
- the widget is NOT connected to a variable
- the widget's connected variable is NOT an input
Sure, I agree with you. The positioning was already standardized on the last push. I didn't update the screenshots, but they all are now aligned |
That screenshot I took from the latest push. Maybe some changes were not pushed? |
Signed-off-by: Arturo Manzoli <[email protected]>
…riable type Signed-off-by: Arturo Manzoli <[email protected]>
…ting on editMenu Signed-off-by: Arturo Manzoli <[email protected]>
2f35ca8 to
c0f2aa9
Compare
Indeed they were misaligned. Fixed now! |
|
I think I’ve addressed all the issues you mentioned. In my tests, everything was working correctly now. |
7c533b1 to
de35bf5
Compare
rafaellehmkuhl
left a comment
There was a problem hiding this comment.
Everything working perfectly now! Boaaaaa
There was a problem hiding this comment.
Almost there! Some minor code improvements, plus:
-
It seems there's some inconsistent placement - checkboxes are centered, but sliders are shortened and right aligned within their box (with the alert icon off to the left), and switches are left-aligned:


-
Per the first image, it's also apparently possible for a slider to end up with a different value than the variable it controls, although I'm not sure that's high enough priority to fix.
-
I also found an intermittent issue where creating elements (I noticed it with both sliders and toggle switches) can sometimes link them together, seemingly at the hash level:
Screen.Recording.2025-11-28.at.8.04.31.pm.mov
which then stayed linked after a Cockpit refresh.
-
There was also an issue where created elements sometimes don't appear in the interface (even though they're listed in the widget list), but I wasn't able to replicate that
If 2-4 are difficult to investigate, I don't think they need to be fixed in this PR.
| }) | ||
|
|
||
| const isInteractive = computed(() => { | ||
| return !!miniWidget.value.options.dataLakeVariable?.id && isInput.value && !widgetStore.editingMode |
There was a problem hiding this comment.
| return !!miniWidget.value.options.dataLakeVariable?.id && isInput.value && !widgetStore.editingMode | |
| return isConnected.value && isInput.value && !widgetStore.editingMode |
It seems more expressive (and easier to maintain) to reuse the named calculation.
|
|
||
| const startEditingValue = (): void => { | ||
| if (widgetStore.editingMode || !isInput.value) return | ||
| if (!isInteractive.value || !isConnected.value) return |
There was a problem hiding this comment.
| if (!isInteractive.value || !isConnected.value) return | |
| if (!isInteractive.value) return |
Connectedness is checked for as part of interactivity, so checking again here is redundant.
| @update:model-value="handleToggleAction" | ||
| ></v-checkbox> | ||
| <v-tooltip | ||
| text="This element is on display mode. To make it interactive, create or select a different data-lake variable" |
There was a problem hiding this comment.
| text="This element is on display mode. To make it interactive, create or select a different data-lake variable" | |
| text="This element is in display mode. To make it interactive, create or select a user-controlled data-lake variable" |
| text="This element is on display mode. To make it interactive, create or select a different data-lake variable" | ||
| location="top" | ||
| open-delay="500" | ||
| :disabled="isInteractive || !isConnected" |
There was a problem hiding this comment.
| :disabled="isInteractive || !isConnected" | |
| :disabled="isInput || !isConnected" |
Otherwise it shows the tooltip in edit mode even when connected to an input variable.
…d to data-lake variable Signed-off-by: Arturo Manzoli <[email protected]>
de35bf5 to
048e04b
Compare
|
Thanks again for all your hard work on this @ArturoManzoli - lots of good progress that our users will appreciate :-) |
|
As we decided externally I'm going to merge this PR as it is and @ES-Alexander will work on some of the suggested fixes so we can fast-forward the Beta release. |
|
Docs note: unconnected/indicators/inputs differentiation |
AlertIconanimated component that can be used to call user's attention on specific parts of the system (tooltip when hovering it not captured by the screen recorder);SideConfigPanelthat was with the wrong height calculation insideEditMenuScreenshare.-.2025-11-26.6_28_28.PM.mp4
close #2255
fix #1749