mu-editor / mu

A small, simple editor for beginner Python programmers. Written in Python and Qt5.
http://codewith.mu
GNU General Public License v3.0
1.41k stars 435 forks source link

Feature Request: Add UI indication of which USB (or path) a tab's code is attached to #914

Open anecdata opened 5 years ago

anecdata commented 5 years ago

In the context of editing CircuitPython on macOS Mu, I almost always have multiple tabs open with identical code, all called code.py, running on similar devices, each on its own USB port. But unless I manually track which tab is which device (write down or order the tabs in the physical order of the devices on my desk, for example), it gets really confusing.

The motivation for this is developing and testing code that works on variations of hardware. I'll test an edit on one variation in one tab, then want to see how it behaves on a different variation in a different tab.

It would be nice to have some indication in the UI of which USB corresponds to which tab (or at least the open tab).

dybber commented 4 years ago

Hi anecdata.

Would it be a solution for you, to be able to select devices as currently discussed over here: https://github.com/mu-editor/mu/issues/988 ?

anecdata commented 4 years ago

Does that replace the "Load" button? I think it's fine. Anything that shows which USB the current macOS Mu editing tab is connected to is great, so it's apparent which code tab goes with which device.

ZanderBrown commented 4 years ago

Not sure doing this per tab is particularly valuable, the current proposal I would expect to be "global"

anecdata commented 4 years ago

If it's global, it doesn't help with this issue. What's desired for this issue is for the case of having multiple tabs open, each connected to a different device, but curently having no visual indication of which tab connects with which device.

dybber commented 4 years ago

And just to make sure, it wouldn't work for you to have two different Mu instances open, connected to separate devices?

anecdata commented 4 years ago

Well, it could be accomplished that way I suppose if I can run multiple instances in macOS (so I'd make an arbitrarily large number of copies of Mu.app with different names, or...?) - and then I still don't know what device in each one by visual inspection.

But tabs are so much easier. I may have 1, 3, or many, and the devices to which they connect will vary.

I'm not sure what the use case is for having tabs unless it's to talk to multiple devices, but Mu has tabs. It would just be really helpful if Mu visually confirmed for me what was in each tab.

After thinking it through, I don't think multiple instances does anything for this issue, since it's the lack of visual indicator ("Which device's code is in this tab?") that is the issue. It doesn't appear in tabs currently, and it wouldn't appear in each instance currently either.

dybber commented 4 years ago

The indicator could be solved (for example as in the screenshot in the issue I linked to), the difficult part would be to make Mu able to connect with multiple devices and switch between them. That will require much more engineering.

I can see your point though, on Mac it's actually pretty hard to open multiple instances of Mu (at least currently it is).

anecdata commented 4 years ago

the difficult part would be to make Mu able to connect with multiple devices and switch between them. That will require much more engineering.

But I do this all the time currently. I just have to manually remember which device is in which tab because there's no visual indicator (and it can get very confusing with more than 2 or 3).

anecdata commented 4 years ago

Maybe this will help:

Screen Shot 2020-02-16 at 2 26 12 PM

Each tab is a different USB device, but unless I remember the order I loaded them, I have no way to know which is which. And this in only 4.

Mu knows and keeps track of which is which - I've never had it get confused (Serial and Plotter are another matter entirely...), it just doesn't display it to the user.

The indicator could be USB Volume name, though that is not unique (mine always are, but most people don't change defaults).

More likely is the /dev/tty name, which is guaranteed to be unique, although not necessarily intuitive for human identification... requires a mapping of /dev/tty name to USB Volume name (which is only possible afaik on macOS with the verbose and challenging-to-parse system_profiler SPUSBDataType command), and /dev/tty names can vary each time a device is plugged in, or a new USB port is used. But, I know by now, for example, that /dev/tty.usbmodem1101 is the front port on my dock, and SiLabs driver devices plugged in later will always have a higher number than prior devices, e.g., /dev/tty.SLAB_USBtoUART249 was plugged in more recently than /dev/tty.SLAB_USBtoUART237.

So, ideally both USB Volume name and /dev/tty name :-)