-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Context
SourceMetadata (introduced Jan 2026, 9fb104e6) added human-readable titles for source names, used in source selectors, plot toolbars, and status widgets via Instrument.get_source_title(). However, AuxSourcesBase (introduced Oct 2025, 75ccc48c) predates this and uses a separate mechanism — pydantic Field metadata — that never got connected to the source title system.
Problem
When the dashboard renders auxiliary source configuration (e.g., LOKI's incident/transmission monitors), users see raw stream names like monitor1 instead of titles like "Incident Monitor". Two independent gaps cause this:
Gap A — Widget labels ignore field_info.title: ParamWidget._create_widget_for_field() always uses snake_to_camel(field_name) for the widget label (e.g., incident_monitor → "IncidentMonitor"). It never checks field_info.title. This is inconsistent with ModelWidget, PlotConfigModal, WorkflowStatusWidget, and PlotWidgets, which all respect field_info.title.
Gap B — Dropdown options show raw stream names: For Literal['monitor1'] fields, ParamWidget builds options as {str(val): val} → {'monitor1': 'monitor1'}. There is no mechanism to look up the human-readable title from SourceMetadata. The ConfigurationAdapter.get_source_title() method exists but is only called by the source selector (MultiChoice for detectors), not by the aux sources widget.
It should be noted that for the source names (as opposed to axus source names) the UI does indeed correctly display the titles.
Affected instruments
All instruments with aux sources are affected:
- LOKI:
incident_monitor(monitor1),transmission_monitor(monitor2) — titles defined in SourceMetadata but not displayed - DREAM:
cave_monitor(monitor_cave) - Bifrost:
detector_rotation,sample_rotation - DetectorROIAuxSources: ROI stream (different pattern — uses
render()for job-specific names)
Design tension
The aux source fields serve a dual purpose:
- Routing: Field values are stream names used by the backend for message routing (via
AuxSourcesBase.render()) - Display: Field names and values appear in the configuration UI
SourceMetadata was designed for the source selector (detector/monitor MultiChoice) where internal names map to display titles. The aux sources widget is a generic pydantic model renderer (ParamWidget) with no access to Instrument configuration.
Possible approaches
These are starting points for discussion, not prescriptions:
- Minimal fix: Make
ParamWidgetrespectfield_info.title(fixes Gap A only). Addtitle=to aux source Field definitions. This doesn't fix the dropdown option labels (Gap B). - Pass source metadata to ParamWidget: Thread
Instrumentor a title-lookup callable throughConfigurationAdapter→ConfigurationWidget→ParamWidgetso Literal option labels can useSourceMetadatatitles. This is more invasive but addresses both gaps. - Use Field
json_schema_extraor similar: Encode display titles in the aux source model itself, removing the need to look upSourceMetadataat render time. But this duplicates title information.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status