From ae81520494a4a778e2f462f53df11c3d796afd6a Mon Sep 17 00:00:00 2001 From: Joe Knapper Date: Thu, 12 Feb 2026 22:35:41 +0000 Subject: [PATCH 1/5] Optional options in UI property control become dropdown --- src/openflexure_microscope_server/ui.py | 7 ++++++ .../labThingsComponents/inputFromSchema.vue | 23 +++++++++++++++++++ .../labThingsComponents/propertyControl.vue | 6 +++++ .../serverSpecifiedPropertyControl.vue | 1 + 4 files changed, 37 insertions(+) diff --git a/src/openflexure_microscope_server/ui.py b/src/openflexure_microscope_server/ui.py index d6c68290..53dd0647 100644 --- a/src/openflexure_microscope_server/ui.py +++ b/src/openflexure_microscope_server/ui.py @@ -83,6 +83,13 @@ class PropertyControl(BaseModel): read_back_delay: int = 1000 """The delay in ms before reading back the property.""" + options: list[str] = [] + """A list of options to pass to the UI for a dropdown. + + These options aren't validated in the UI in any way, and invalid + settings will only be rejected when selected. + """ + def property_control_for( thing: lt.Thing, property_name: str, **kwargs: Any diff --git a/webapp/src/components/labThingsComponents/inputFromSchema.vue b/webapp/src/components/labThingsComponents/inputFromSchema.vue index 70a80026..33adb079 100644 --- a/webapp/src/components/labThingsComponents/inputFromSchema.vue +++ b/webapp/src/components/labThingsComponents/inputFromSchema.vue @@ -1,5 +1,20 @@ From 5ae0f903d82a07e4649f07b66dc4044b47aad55c Mon Sep 17 00:00:00 2001 From: Joe Knapper Date: Fri, 13 Feb 2026 12:13:39 +0000 Subject: [PATCH 2/5] Use dropdown separated from dataType in Vue --- src/openflexure_microscope_server/ui.py | 4 ++-- .../labThingsComponents/inputFromSchema.vue | 22 +++++++++---------- .../labThingsComponents/propertyControl.vue | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/openflexure_microscope_server/ui.py b/src/openflexure_microscope_server/ui.py index 53dd0647..ff11ea68 100644 --- a/src/openflexure_microscope_server/ui.py +++ b/src/openflexure_microscope_server/ui.py @@ -1,6 +1,6 @@ """Functionality for communicating the required user interface for a thing.""" -from typing import Any +from typing import Any, Optional from pydantic import BaseModel @@ -83,7 +83,7 @@ class PropertyControl(BaseModel): read_back_delay: int = 1000 """The delay in ms before reading back the property.""" - options: list[str] = [] + options: Optional[list[str]] = None """A list of options to pass to the UI for a dropdown. These options aren't validated in the UI in any way, and invalid diff --git a/webapp/src/components/labThingsComponents/inputFromSchema.vue b/webapp/src/components/labThingsComponents/inputFromSchema.vue index 33adb079..e0b265cc 100644 --- a/webapp/src/components/labThingsComponents/inputFromSchema.vue +++ b/webapp/src/components/labThingsComponents/inputFromSchema.vue @@ -1,6 +1,6 @@