m-labs / artiq

A leading-edge control system for quantum information experiments
https://m-labs.hk/artiq
GNU Lesser General Public License v3.0
436 stars 201 forks source link

GUI state management for interactive arguments #2624

Open SimonRenblad opened 6 hours ago

SimonRenblad commented 6 hours ago

ARTIQ Feature Request

See: https://forum.m-labs.hk/d/843-group-closes-after-clicking-submit-button-in-interactive-window

Problem this request addresses

Groups are not expanded by default in interactive arguments, and do not save GUI state across submissions.

Describe the solution you'd like

A way to save state / programmatically set the expanded state of the groups in interactive argument widgets.

Context / First Thoughts

My first thought was to expand the interactive context manager with an additional interface like interactive.set_expanded("<group_name>"). As I discussed in the forum post, there are some hurdles that make using the existing GUI state system for this a bit more complex (but not impossible ofc).

sbourdeauducq commented 6 hours ago

The expanded/closed status is very much a GUI thing and I don't think it should be in the experiment code. What about remembering, say, the status of the last 100 requests (identified just by experiment, request, and/or group name) and expanding accordingly?

SimonRenblad commented 6 hours ago

It would be possible, of course. There is still the case of how to handle interactive arguments from the same experiment running at the same time in different pipelines, as it may lead to some confusing behavior. That being said I'll spend some time working on this so we can see more concretely what behavior is desirable.

sbourdeauducq commented 6 hours ago

That's easy to handle, just make the key a tuple with the pipeline name as one of the elements.