-
Notifications
You must be signed in to change notification settings - Fork 1
Add title and description metadata for source names #651
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
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>
nvaytet
left a comment
There was a problem hiding this 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?
| self.instrument_module = get_config(self._instrument) | ||
| self.processor_factory = instrument_registry[self._instrument].workflow_factory | ||
| self.instrument_config = instrument_registry[self._instrument] |
There was a problem hiding this comment.
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?
Summary
Introduces
SourceMetadataPydantic model to allow human-readable titles and descriptions for data sources (detectors, monitors, timeseries). This addresses the UX issue where internal identifiers likeendcap_forward_detectorare displayed in the UI instead of user-friendly names.SourceMetadatamodel withtitleanddescriptionfields toInstrumentclassThe title lookup falls back to the source name when no metadata is defined, ensuring backwards compatibility.
Closes #604
Example
Test plan
SourceMetadatamodel and lookup methods🤖 Generated with Claude Code