[Resolved] PR #4942 new option to show/hide sketcher constraints

Post here if you have re-based and finalised code to integrate into master, which was discussed, agreed to and tested in other forums. You can also submit your PR directly on github.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Locked
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: PR #4942 new option to show/hide sketcher constraints

Post by abdullah »

uwestoehr wrote: Sat Sep 25, 2021 3:53 pm The problem for me was that I did not want to hide all but only the Datums.
So can we please rename the button text to "Hide all listed"?
"Hide all" implies for me to hide everything and the problem is still for me that the button does this in some cases, see below.
Of course we can. Should we go with "Hide", "Hide listed", "Hide filter selection", ...

Longer names force to have wider widget to fit the buttons, so I prefer shorter as far as it is clear what is done.
uwestoehr wrote: Sat Sep 25, 2021 3:53 pm Yes, this was indeed the problem. I was as totally confused. I am sorry, I did not want to annoy you, I needed the functionality yesterday in real-life and was upset that I could not achieve what I wanted.
By no means you have annoyed me. It is with merging and exposing a working functionality to the community that we can manage to achieve a meaningful "last" refining.

You were obviously expecting something else from the UI. If you (and the rest) hadn't "complain", then we wouldn't be discussing how to refine it.
uwestoehr wrote: Sat Sep 25, 2021 3:53 pm
My problem is that I still don't understand the feature. So for example:
- I filter the Datums
- I enable the tracking

result: everything is hidden, but not the datums. Why? I did not say that something should be hidden nor what is hidden.

- now I disable the tracking
-> nothing happens
- now I re-enable the button
-> nothing happens

So I don't understand why the first time enabling the tracking options.
I still think that the "tracking feature" is what you need and what you will use most. In fact, I came with it by mixing Chrisb request for more filters and your example of showing different sets of constraints to a client in an ergonomic way. So to say, it is made to fulfill your specific requirements.

I am going to translate into "Humanised software program" what you are doing.

1. The guy has selected "filter Datum" & We are not tracking => Show a list with the datums, do not change any visibility.
2. Hey! The guy has enabled the tracking, quick, hide every constraint not covered by the filter selection and show all the constraints corresponding to the filter => The guy wants only the datums, so show him just that.

(Note: Tracking means "show just what the filter selection says, hide everything else", this is the automation behind it).

3. Hey! The guy has disabled the tracking, he does not want that we continue tracking his filter selections => Stop tracking filter selection, do nothing (as we do not know what he wants to do and we were just asked to stop tracking).

4. He changed mind! Ok, check the filter, he has still the datum selection in the filter, we should hide everything not being a datum and show him just the datums => Show him just the datums
(Note: Because it was already the case that just the datum were being shown, there is no change, as no change is needed).

Hope this helps understanding the feature.

If you often change from geometric constraints to datum constraints to all, tracking and just selecting the right filter should be exactly what you want and really effortless. You save lots of clicks.

If this does not match what you want, then I did not understand your client example well. Feel free to describe your example with more detail and why this functionality is not what you have been waiting for. Maybe it can be improved or refined.
uwestoehr wrote: Sat Sep 25, 2021 3:53 pm Again regarding to the hide feature:
- restart FC
- I first select the datums
- then press the button "Hide All"

result: only the datums are hidden -> fine so far

- now I enable the track option
- then press the button "Hide All"

result: now ALL is hidden, despite that still only the datums are filtered.
So the button to hide behaves different and it confuses me in what circumstances it does what.

Sorry again in case I annyoed you.
Nop, you have not annoyed me. It is part of producing a nice feature ;)

Back to the "Humanised software program". Hope you are enjoying that:

1. The guy selected Datums in the filter && No tracking (the sketcher starts with it off not to make newbies wanna jump out of the window). => We update the list of constraints.
2. Quick, the guy wants to hide all the datums => Hide the datums (because we started with all shown, then everything but datums is shown. This is equivalent to shown only Geometric).
3. Hey! Tracking enabled, he wants just the filter selection. It is datums => Make sure to show all datums and hide everything else.
4. Oh! We are Tracking, but the guy just told us to override the tracking by hiding all listed => Hide all listed, which is equivalent to hide all datums. Because we come from a situation where only datums were shown, now we have all hidden (He must be happy with how well we comply with his commands;) Maybe we get a new processor for Santa...)

Note: Filter tracking means:
1. Upon checking the checkbox, adapt to the filter selection.
2. On every filter selection, perform automation to show just what is selected in the filter (i.e. to track the filter selection).
3. Between filter selections, obey the manual commands send via the buttons.

N.B.: I do not see much use of using the manual commands in combination with the tracking, other than arriving to the situation of having all hidden.

Hope you enjoyed that!

Best,
abdullah
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: PR #4942 new option to show/hide sketcher constraints

Post by abdullah »

chennes wrote: Sat Sep 25, 2021 5:59 pm
abdullah wrote: Sat Sep 25, 2021 5:53 pm I am open to ideas to make it more self explanatory.
Some ideas for that checkbox text:
  • "Visibility tracks filter"
  • "Show only filtered constraints"
  • "Update constraint visibility on filter change"
  • "Auto-show constraints for chosen filter"
These are probably starting to get a little verbose, but it's a hard idea to convey quickly.
I like them all. Probably the second one is the clearest (also when thinking of translations). The third gives a good idea that there is an update on filter change, which is important, but there is also an update on enabling the button. Let's see what others think.

Verbosity is not so much a problem for the checkbox text, there is "plenty" horizontal space in the widget for a checkbox.

Verbosity is indeed an issue for the text of the tabs, and for the text of the buttons (as buttons are arranged in two columns).
wsteffe
Posts: 461
Joined: Thu Aug 21, 2014 8:17 pm

Re: PR #4942 new option to show/hide sketcher constraints

Post by wsteffe »

I would like to propose also the following variation of the widget design, which, in my opinion would be more uniform (same logic used for all actions):

The first level selector (View, Automation, List) should have just 2 items: (Visibility, List)
The two buttons named Hide a and Show should be replaced by a second selector with 3 alternative entries
(Set, Add, Remove)

Case 1 first selector= Visibility, second selector= Set:
The behaviour should be that one of current tracking mode
Case 2 first selector= Visibility, second selector= Add:
Every time a new filter selection is done that selection is immediately made visible (without changing visibility status of other groups)
Case 3 first selector= Visibility, second selector= Remove:
Every time a new filter selection is done that selection is immediately made hidden (without changing visibility status of other groups)

When first selector= List, the filters selections are set in, added to or removed from the list instead of the visibility status.
chrisb
Veteran
Posts: 53930
Joined: Tue Mar 17, 2015 9:14 am

Re: PR #4942 new option to show/hide sketcher constraints

Post by chrisb »

If we have this show and hide, would it be sensible to have a toggle on the spce key as shortcut?
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: PR #4942 new option to show/hide sketcher constraints

Post by GeneFC »

chrisb wrote: Sat Sep 25, 2021 8:44 pm If we have this show and hide, would it be sensible to have a toggle on the spce key as shortcut?
I would not do that.

The space key works for a specific selected item or a group of selected items. Extending the space key application to an entire class of items would be breaking new ground.

Gene
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: PR #4942 new option to show/hide sketcher constraints

Post by uwestoehr »

abdullah wrote: Sat Sep 25, 2021 6:23 pm Of course we can. Should we go with "Hide", "Hide listed", "Hide filter selection", ...
"Hide listed constraints"
Because this is what it should do. The user filters then all constraints in the list are hidden.
We can also put the buttons upon each other.

abdullah wrote: Sat Sep 25, 2021 6:23 pm Note: Filter tracking means:
1. Upon checking the checkbox, adapt to the filter selection.
2. On every filter selection, perform automation to show just what is selected in the filter (i.e. to track the filter selection).
3. Between filter selections, obey the manual commands send via the buttons.
And here I see the problem. You automatize only one side. As user I want the full control - deciding what and how. So either I first select an object and then perform the action (hiding or showing) or I first define the action and then the object. The UI as it is, is to select first the object and then the action. This concept should be consistently used.

The tracking only shows the filtered objects, but never the other way round - everything than the filtered objects. Personally the latter is why I once made the PR. Sketches contain quickly too many objects and I need to hide some to keep the overview or to be able to discuss things.

So when tracking, then please both ways. Thus I opt to be able to select which tracking type is used, see my summary below.

abdullah wrote: Sat Sep 25, 2021 6:23 pm 4. Oh! We are Tracking, but the guy just told us to override the tracking by hiding all listed
Oh, FC is not following my will. I pressed the button to hide something, but I don't get what I want ;)
I don't think that pressing the button should overwrite anything. A click of a button is the users will, so he wants the particular action the button promises. As I once learned, it is "bad UI" that the same button behaves differently when there is no prior visible feedback "Hey user, note, when you press the button now, it will behave other than with out the option". And over the years my experience it that this indeed confuses users a lot. (Of course this statement does not apply to the standard OK buttons of dialogs.) So at least the button text must change to indicate this.

However, I don't think this is necessary. The Hide button should always hide all constraints in the list, see below my summary.

----------

A general UI remark: In FC we have 2 types of options:
- either an option performs an immediate action (e.g. the pad reverse option in PD)
- or a settings option
The tracker option however differs from this since it either have an immediate effect or not. This confused me a lot and I think we should avoid such a behavior.

----------

Summary of what I would change:
1. name the buttons "Hide listed constraints" and "Show listed constraints"
2. the buttons will in every case act the same - showing/hiding the listed constraints
3. the tracking option becomes a setting option, so it will not perform an immediate action when it is turned on
4. there will be a radio group to either turn on the option to track so that everything is hidden except of the filtered objects, or to track the opposite way, that only the filtered object is hidden
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: PR #4942 new option to show/hide sketcher constraints

Post by adrianinsaval »

uwestoehr wrote: Mon Sep 27, 2021 12:53 am1. name the buttons "Hide listed constraints" and "Show listed constraints"
"Hide listed" and "Show listed" should be enough, we already know we are dealing with constraints here
2. the buttons will in every case act the same - showing/hiding the listed constraints
I couldn't test yet but from what I understood in abdullahs explanation the buttons will always show/hide what's filtered no matter the checkbox state.
3. the tracking option becomes a setting option, so it will not perform an immediate action when it is turned on
that's terrible because IMO is what lead to your confusion, pressing the checkbox did nothing so you thought it didn't work, I expect a lot of people would think that.
4. there will be a radio group to either turn on the option to track so that everything is hidden except of the filtered objects, or to track the opposite way, that only the filtered object is hidden
If this would be done I propose to omit the checkbox altogether and instead have three radio button options in the automation tab: "None", "Show only listed" and "Hide only listed"
the last one could also be called "Show all except listed" if you guys like that more.

Ideally we would be able to select more than one filter at once and that would make the first tab entirely unnecesary IMO.
wsteffe
Posts: 461
Joined: Thu Aug 21, 2014 8:17 pm

Re: PR #4942 new option to show/hide sketcher constraints

Post by wsteffe »

uwestoehr wrote: Mon Sep 27, 2021 12:53 am The UI as it is, is to select first the object and then the action. This concept should be consistently used.
It is exactly this kind of consistency, or better the other way around (first select the action then the object), that I wanted to achive with the widget variant proposed in my previous post. With this variant Track/View/Hide are 3 alternative settings that are made before making the filter selection (upon which they are acting).

I have ranamed these settings to Set/Add/Remove in order
  • To make it clear that View/Hide are actually adding/removing the filtered object to the visualized ones.
  • To have more generic names which can be used also when the actions are performed on the selection List (instead of the visualization state). This solution assures a consistent interface across both List and Visualization controls.
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: PR #4942 new option to show/hide sketcher constraints

Post by uwestoehr »

adrianinsaval wrote: Mon Sep 27, 2021 4:14 am "Hide listed" and "Show listed" should be enough, we already know we are dealing with constraints here
OK, fine with me.

adrianinsaval wrote: Mon Sep 27, 2021 4:14 am I couldn't test yet but from what I understood in abdullahs explanation the buttons will always show/hide what's filtered no matter the checkbox state.
As abdullah wrote, the Tracking option would be overwritten, then it is active. Therefore sometimes the buttons hide all or everything but the filtered constrains.
The best is that you test it by yourself. That would also show what the issue with the option setting is and why this leads to confusion.
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: PR #4942 new option to show/hide sketcher constraints

Post by abdullah »

uwestoehr wrote: Mon Sep 27, 2021 1:19 pm
adrianinsaval wrote: Mon Sep 27, 2021 4:14 am I couldn't test yet but from what I understood in abdullahs explanation the buttons will always show/hide what's filtered no matter the checkbox state.
As abdullah wrote, the Tracking option would be overwritten, then it is active. Therefore sometimes the buttons hide all or everything but the filtered constrains.
The best is that you test it by yourself. That would also show what the issue with the option setting is and why this leads to confusion.
As far as I understand, Adrian got it right.

Testing shows exactly this. I do not understand the confusion.

This is what happens in your example file:
Peek 27-09-2021 20-08.gif
Peek 27-09-2021 20-08.gif (176.22 KiB) Viewed 1690 times
Therefore, the buttons do exactly the same with and without the tracking option checked.

I think you have misunderstood my comment that the "tracking option would be overwritten". When you change filter, if the tracking is checked, it will adapt the visualisation to that specific filter. If you have done that, but want to hide all the filtered, you can hit the "hide" button. If you do this, the visibility will no longer correspond to "tracking the filter selection" (because you manually decided to hide all constraints). This is what I meant as overriden (override the expected outcome of the automatic functionality with the express will of the user via the buttons). The button does exactly the same with the option checked or unchecked. Of course, if then the filter is changed again and the tracking is checked, it will do what the tracking mode does: adapt the view to the newly selected filter.
Locked