Skip to content

Comments

Fix input widget inconsistencies#2256

Merged
rafaellehmkuhl merged 4 commits intobluerobotics:masterfrom
ArturoManzoli:fix-input-widget-inconsistency
Nov 28, 2025
Merged

Fix input widget inconsistencies#2256
rafaellehmkuhl merged 4 commits intobluerobotics:masterfrom
ArturoManzoli:fix-input-widget-inconsistency

Conversation

@ArturoManzoli
Copy link
Contributor

@ArturoManzoli ArturoManzoli commented Nov 26, 2025

  • Added a customizable AlertIcon animated 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);
  • Fixed the input-widgets that didn't receive pointer events even if they were linked to a data-lake variable;
  • Fixed the SideConfigPanel that was with the wrong height calculation inside EditMenu
Screenshare.-.2025-11-26.6_28_28.PM.mp4
tooltip

close #2255
fix #1749

Copy link
Contributor

@ES-Alexander ES-Alexander left a comment

Choose a reason for hiding this comment

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

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(() => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this related to / fixing #1749?

Copy link
Contributor Author

@ArturoManzoli ArturoManzoli Nov 27, 2025

Choose a reason for hiding this comment

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

Yep, adding the issue to the PR

@ArturoManzoli ArturoManzoli force-pushed the fix-input-widget-inconsistency branch from a7d56d2 to f344920 Compare November 27, 2025 12:06
@ArturoManzoli ArturoManzoli force-pushed the fix-input-widget-inconsistency branch 2 times, most recently from 6b8d844 to 2f35ca8 Compare November 27, 2025 12:15
Copy link
Member

@rafaellehmkuhl rafaellehmkuhl left a comment

Choose a reason for hiding this comment

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

Besides the minor JSDocs thing, there's a few other things I think need to be addressed:

  1. The dial is not beng greyed-out when connected to read-only variables.
image
  1. 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.

  2. 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.

  3. The tooltip in the AlertIcon was implemented using the title attribute, which is not great since it needs a long (usually 2) hovering to appear. Better to use Vuetify's v-tooltip or a dedicated library like Floating UI.

  4. The AlertIcon is in a strange position now. Maybe better located in the center of the widget?

image

Comment on lines 21 to 37
defineProps<{
/**
*
*/
icon?: string
/**
*
*/
color?: string
/**
*
*/
animation?: 'pulse' | 'ping' | 'bounce' | 'spin' | ''
/**
*
*/
tooltip?: string
Copy link
Member

Choose a reason for hiding this comment

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

Missing docs here.

@ArturoManzoli
Copy link
Contributor Author

Besides the minor JSDocs thing, there's a few other things I think need to be addressed:

  1. The dial is not beng greyed-out when connected to read-only variables.

I really think we should not grey out when connected to read only variables. This would make it hard to read the values

  1. 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.

👍

  1. 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.

👍

  1. The tooltip in the AlertIcon was implemented using the title attribute, which is not great since it needs a long (usually 2) hovering to appear. Better to use Vuetify's v-tooltip or a dedicated library like Floating UI.

I'll replace it by the v-tooltip

  1. The AlertIcon is in a strange position now. Maybe better located in the center of the widget?

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

@rafaellehmkuhl
Copy link
Member

Besides the minor JSDocs thing, there's a few other things I think need to be addressed:

  1. The dial is not beng greyed-out when connected to read-only variables.

I really think we should not grey out when connected to read only variables. This would make it hard to read the values

I agree. It's just that all other widgets are being greyed-out, with the exception of the Dial.

@rafaellehmkuhl
Copy link
Member

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 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.

Copy link
Contributor

@ES-Alexander ES-Alexander left a comment

Choose a reason for hiding this comment

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

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 :-)

Comment on lines 24 to 25
:disabled="widgetStore.editingMode || !isConnected || !isInput"
:class="{ 'opacity-30': !isConnected }"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
: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
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

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
Copy link
Contributor

Choose a reason for hiding this comment

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

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed that

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."
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch! I'll fix that

Comment on lines 223 to 245
if (isInput.value && !widgetStore.editingMode) {
if (isConnected.value && !widgetStore.editingMode) {
Copy link
Contributor

Choose a reason for hiding this comment

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

We should only allow editing input variables, not any connected variable.

Comment on lines 234 to 256
if (!isInput.value) return
if (!isConnected.value) return
Copy link
Contributor

Choose a reason for hiding this comment

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

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
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if (widgetStore.editingMode || !isConnected.value || isInput.value) return
if (widgetStore.editingMode || !isConnected.value || !isInput.value) return

No modifying the value if:

  1. currently in edit mode (doing higher level interface editing)
  2. the widget is NOT connected to a variable
  3. the widget's connected variable is NOT an input

@ArturoManzoli
Copy link
Contributor Author

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 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.

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

@rafaellehmkuhl
Copy link
Member

rafaellehmkuhl commented Nov 27, 2025

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?

@ArturoManzoli ArturoManzoli force-pushed the fix-input-widget-inconsistency branch from 2f35ca8 to c0f2aa9 Compare November 28, 2025 11:25
@ArturoManzoli
Copy link
Contributor Author

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?

Indeed they were misaligned. Fixed now!

@ArturoManzoli
Copy link
Contributor Author

@ES-Alexander @rafaellehmkuhl

I think I’ve addressed all the issues you mentioned. In my tests, everything was working correctly now.

@ArturoManzoli ArturoManzoli force-pushed the fix-input-widget-inconsistency branch 2 times, most recently from 7c533b1 to de35bf5 Compare November 28, 2025 13:12
Copy link
Member

@rafaellehmkuhl rafaellehmkuhl left a comment

Choose a reason for hiding this comment

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

Everything working perfectly now! Boaaaaa

Copy link
Contributor

@ES-Alexander ES-Alexander left a comment

Choose a reason for hiding this comment

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

Almost there! Some minor code improvements, plus:

  1. 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:
    Image
    Image

  2. 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.

  3. 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.

  4. 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
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
: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]>
@ArturoManzoli ArturoManzoli force-pushed the fix-input-widget-inconsistency branch from de35bf5 to 048e04b Compare November 28, 2025 14:25
@ES-Alexander
Copy link
Contributor

Thanks again for all your hard work on this @ArturoManzoli - lots of good progress that our users will appreciate :-)

@rafaellehmkuhl
Copy link
Member

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.

@rafaellehmkuhl rafaellehmkuhl merged commit f35b91c into bluerobotics:master Nov 28, 2025
12 checks passed
@ES-Alexander ES-Alexander added the docs-needed Change needs to be documented label Nov 30, 2025
@ES-Alexander
Copy link
Contributor

ES-Alexander commented Nov 30, 2025

Docs note: unconnected/indicators/inputs differentiation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs-needed Change needs to be documented

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Input-widgets are not clickable even if connected to a data-lake variable Checkbox input widget gets behind other mini-widgets

3 participants