spyder-ide / spyder

Official repository for Spyder - The Scientific Python Development Environment
https://www.spyder-ide.org
MIT License
8.18k stars 1.58k forks source link

It's not clear what some actions in the new Options menus of Variable Explorer editors do #21824

Closed ccordoba12 closed 1 month ago

ccordoba12 commented 6 months ago
ccordoba12 commented 6 months ago

@jitseniesen, @CAM-Gerlach, what do you think about this one?

jitseniesen commented 6 months ago
  • In particular, I'm talking about Format, which we could rename to Set format for floating point numbers (or something like that). Furthermore, we could add a descriptive text to the dialog that opens after clicking on it with a link to the format syntax that users can set there.

Before the PR, this was a button with a tooltip with the text "Set format of floating-point numbers". The PR moved this to a menu item and an unintended consequence was that the tooltip disappeared, because menus do not show tooltips by default. So one solution may be to turn on toolTipVisible in the menu, but users may find it confusing to have tooltips in a menu as that is not very common (and I don't think we use tooltips in menus anywhere in Spyder).

We can change the name of the menu item, but I think that your proposed name is too long. Maybe Set format... or Set format for floats..., with the three dots indicating that a dialog will follow.

The text in the dialog itself should certainly be clarified.

  • Another option that I find difficult to understand is Column min/max. Just by reading that text, I don't understand what it does. And I tried to enable/disable it in a simple dataframe and I didn't see any difference.

I think I understood this option only by reading the code. The option Background colour colours the lowest numbers red and the highest numbers blue, with the rest given colours in between. If Column min/max is set, then the lowest/highest number in each column is coloured red/blue, otherwise the lowest/highest number in the entire dataframe is coloured red/blue.

The best description I can come up with is "Assign colours by column", but I don't think that is very clear either. This requires a fuller explanation elsewhere, either in a tooltip or in our documentation.

We can also consider removing that option. I can imagine situations where it could be useful but I'm not sure how much it is actually used, and it is hard to find out what it does.

ccordoba12 commented 6 months ago

or Set format for floats..., with the three dots indicating that a dialog will follow.

I like this suggestion because it works better for a menu entry (I know mine was too long).

The best description I can come up with is "Assign colours by column", but I don't think that is very clear either.

Yeah, that seems hard to explain with the action text alone. We could also say Assign colors by column min/max, but in other languages that could translate to a very long text (e.g. in Spanish it'd be Asignar colores según el max/min de cada columna).

This requires a fuller explanation elsewhere, either in a tooltip or in our documentation.

Since tooltips in menus are not an expected UI element, that's perhaps not an option. And improving our docs is a good idea but the interface should be easy enough to grasp on its own.

We can also consider removing that option. I can imagine situations where it could be useful but I'm not sure how much it is actually used, and it is hard to find out what it does.

Yeah, that's another option but I wouldn't like to remove current functionality because I'm sure some users rely on it and wouldn't be happy about it.

jitseniesen commented 6 months ago

A more radical idea is not to have the options (hamburger) menu, but instead have a toolbutton like :wrench: . That button opens up a dialog with a text field for the format string for floating point numbers and two checkbuttons, one for turning on/off the background colour and one for the column min/max option. The advantage is that we can use a bit more text in a dialog window and we can also add tooltips. However, this is quite a big thing to do before 6.0.

ccordoba12 commented 6 months ago

A more radical idea is not to have the options (hamburger) menu, but instead have a toolbutton like 🔧

This is a very good idea! @CAM-Gerlach, what do you think?

However, this is quite a big thing to do before 6.0.

I could give you a hand with it after we release beta1.

PhilipYip1988 commented 6 months ago

I think the col min/max applies the background color independently for each Series:

img001

Or across the entire DataFrame:

img002

The subtle difference can be seen in the DataFrame above.

It might be better to have a dropdown box with something like:

background color applied via: ['Series', 'DataFrame']

background color by: ['Series', 'DataFrame']

img003

Or if the checkbox option is preferred renaming "column min/max" to "color by Series" may be easier to read.

Using DataFrame and Series in this context is more consistent to pandas documentation and therefore should be clear to someone working with pandas.

The two primary data structures of pandas, Series (1-dimensional) and DataFrame (2-dimensional), handle the vast majority of typical use cases in finance, statistics, social science, and many areas of engineering.

jitseniesen commented 5 months ago

Here is a (non-functional) mock-up of what a dialog window can look like. I put the new toolbar button to the left of the refresh button, where the button for setting the format used to be.

My main doubt is whether I should combine the two groups ("Background color" and "Coloring algorithm") in one group with three options.

If this looks promising, then I can implement the functionality and submit a PR so that we can start fine tuning the text and the graphics layout. What do you think?

https://github.com/spyder-ide/spyder/assets/7941918/aee17993-202e-4362-86ef-b86e1c1354fb

ccordoba12 commented 5 months ago

This looks really nice, thanks @jitseniesen! My only suggestion is to leave the current Options menu and add this as an action called Additional preferences.

That way we would maintain consistency with the other editors and we could also add a Close action (with a shortcut) to that menu later on to solve issue #21814.