pcdshub / typhos

Automatic-yet-customizable Graphical User Interface Generation for Ophyd Devices
http://pcdshub.github.io/typhos
Other
16 stars 25 forks source link

Happi Plugin Refactor Plan (UX) #549

Open ZLLentz opened 1 year ago

ZLLentz commented 1 year ago

I'm creating this issue to document and gather feedback before I jump headfirst into a somewhat consequential refactor.

Background: Typhos plugin structure

Here is my plan:

SignalPlugin

HappiPlugin

The order of these fields will be:

I'd like to nail down the details here before proceeding: good idea? Bad? Misguided?

klauer commented 1 year ago

The background here is nicely written and comprehensive - thanks for the refresher.

As to the plan, I think it's good overall and agree with the path forward. As usual, I have my own opinions regarding potential implementation details. Let me see if I can convey what I'm thinking adequately...

I've mentioned before that I think the heavy reliance in PyDM on URIs like calc://a?b... with really long strings was an unfortunate or even bad design decision which is hostile to users. I think these attributes should contain structured data in a standard format (i.e., JSON) which can be more verbose and clear as to their intent. PyDM should bundle designer dialogs that help in modifying these in a sensible way.

I think a similar approach here could be beneficial (and would like to know what you think); it's an alternative to adding perhaps 5 or more fields to widgets that need to be handled separately in pyqt properties on widgets. In short, add a "device_source" field of type JSON that has a custom designer dialog that lets you easily search happi, select a component or subdevice or ..., or switch to a load string, etc. This should be well-formed JSON that corresponds with a dataclass that can be easily generated from Python as well, in case we want to programmatically generate them.

ZLLentz commented 1 year ago

You're right, including custom designer dialogs is a step up in UX from "well-named fields with tooltips" and lets us work with structured data instead of limiting us to "the user gave a string" as in my proposal and in the pydm-style long URI formulations. When I dive into this, I'll start by exploring what can be done in these custom dialogs.