Skip to content

Conversation

@SimonHeybrock
Copy link
Member

@SimonHeybrock SimonHeybrock commented Jan 8, 2026

Summary

Introduces SourceMetadata Pydantic model to allow human-readable titles and descriptions for data sources (detectors, monitors, timeseries). This addresses the UX issue where internal identifiers like endcap_forward_detector are displayed in the UI instead of user-friendly names.

  • Add SourceMetadata model with title and description fields to Instrument class
  • Wire instrument config through dashboard layer for title lookup
  • Update source selector widgets to display titles instead of internal names
  • Update plot cell toolbars to use source titles in display and tooltips
  • Add DREAM instrument source metadata as example

The title lookup falls back to the source name when no metadata is defined, ensuring backwards compatibility.

Closes #604

Example

image

Test plan

  • Unit tests added for SourceMetadata model and lookup methods
  • All existing tests pass (1903 passed)
  • Manual verification: workflow source selector shows titles
  • Manual verification: plot source selector shows titles
  • Manual verification: plot toolbar shows titles
  • Manual verification: WorkflowStatusWidget shows titles

🤖 Generated with Claude Code

SimonHeybrock and others added 2 commits January 8, 2026 12:53
Introduces `SourceMetadata` Pydantic model to allow human-readable titles
and descriptions for data sources (detectors, monitors, timeseries).

Key changes:
- Add `SourceMetadata` model with `title` and `description` fields
- Add `source_metadata` dict field to `Instrument` class
- Add `get_source_title()` and `get_source_description()` helper methods
- Wire instrument config through dashboard layer for title lookup
- Update source selector widgets to display titles instead of internal names
- Update plot cell toolbars to use source titles
- Add DREAM instrument source metadata as example

The title lookup falls back to the source name when no metadata is defined,
ensuring backwards compatibility.

Closes #604

Prompt: Please read #604 and then think about how this could
be accomplished. Where would titles be defined? How can the frontend app
access them? Developer a deep understanding, then get back to me with brief
thoughts idea, do not spell out a full solution yet.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The source title metadata was not being used consistently in the UI:
- WorkflowStatusWidget config toolbar displayed raw source_name
- Plot config modal (step 3 wizard) showed source names instead of titles

Fix by:
- Add get_source_title() to JobOrchestrator for widget access
- Update WorkflowStatusWidget._create_config_toolbar() to use titles
- Add instrument_config parameter to PlotConfigurationAdapter
- Add get_source_title() to PlotConfigurationAdapter
- Add instrument_config property to PlotOrchestrator
- Pass instrument_config through PlotConfigModal to the adapter

Prompt: The addition of source titles in this branch works in some cases,
but misses in others. In particular:
- The WorkflowStatusWidget still shows source_name directly instead of title
- The plot config modal (step 3 in wizard) still shows source names.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@SimonHeybrock SimonHeybrock marked this pull request as ready for review January 9, 2026 04:53
@github-project-automation github-project-automation bot moved this to In progress in Development Board Jan 9, 2026
@SimonHeybrock SimonHeybrock moved this from In progress to Selected in Development Board Jan 9, 2026
@nvaytet nvaytet self-assigned this Jan 9, 2026
Copy link
Member

@nvaytet nvaytet left a comment

Choose a reason for hiding this comment

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

I didn't see the source description being used for tooltips. Did I miss something?

Comment on lines 160 to +161
self.instrument_module = get_config(self._instrument)
self.processor_factory = instrument_registry[self._instrument].workflow_factory
self.instrument_config = instrument_registry[self._instrument]
Copy link
Member

Choose a reason for hiding this comment

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

Unrelated to this PR, but slightly weird that the result of get_config() is stored as instrument_module, while the instrument_config comes from using getitem on instrument_registry.
I'm just saying that the naming could lead someone reading the code that there is a mistake?

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

Labels

None yet

Projects

Status: Selected

Development

Successfully merging this pull request may close these issues.

Titles for source names

3 participants