[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!
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 »

adrianinsaval wrote: Wed Oct 06, 2021 2:15 pm the command should be left as is, what I had in mind is to skip using that command when the selection filter is activated, so as a result of selecting a circle in 3d view it's associated constraint will be filtered in the list. The filter would be selected constraints + constraints associated to selected geometries
Ah! I did not understand you before. That is indeed a different behaviour. I had not thought of that. When selecting a circle, causing the widget to show the associated constraints in the list...

... it would not be a filter showing the selected constraints, but a filter showing the constraints associated to a given element...

... Some kind of constraint "inspection filter"...

I need to think about that... Thanks!
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 »

I thinking of this kind of ui rearrangement (it is WIP):
Screenshot_20211006_202205.png
Screenshot_20211006_202205.png (102.56 KiB) Viewed 4274 times
This way space would be made for a larger constraint list.
User avatar
adrianinsaval
Veteran
Posts: 5534
Joined: Thu Apr 05, 2018 5:15 pm

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

Post by adrianinsaval »

The items in that popup could be just checkboxes in a menu, I personally would prefer that because it's easier to dismiss (no ok/cancel buttons, no close button just click outside the menu or press esc). I would put it in a button called Options beside the show/hide buttons instead of using one with an icon, and if you want to go with an icon I suggest reusing the preferences icon instead of making a custom one.
And btw, thanks for all your work! You're awesome :)

Edit: it might make more sense to create a topic in the UI/UX subforum were it's more likely that gui gurus will see this and give meaningful feedback
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 »

adrianinsaval wrote: Wed Oct 06, 2021 7:57 pm The items in that popup could be just checkboxes in a menu, I personally would prefer that because it's easier to dismiss (no ok/cancel buttons, no close button just click outside the menu or press esc). I would put it in a button called Options beside the show/hide buttons instead of using one with an icon, and if you want to go with an icon I suggest reusing the preferences icon instead of making a custom one.
And btw, thanks for all your work! You're awesome :)

Edit: it might make more sense to create a topic in the UI/UX subforum were it's more likely that gui gurus will see this and give meaningful feedback
I like the idea of having the options more accessible. Specially the "tracking option" (as the others are no changed often). However, I do not quite like the lack of grouping and scalability of a dropdown menu or Qtoolbutton as a single source for options.

The think with using an icon instead of text is that of space. Text occupies space. I do not quite care much about which icon to use. I could go along with any.

The think with the checkboxes in a menu, in what I have seen, is that it lacks scalability. So one works today making it, and tomorrow one needs a radio button or else and the whole needs to be redone. Options/Preferences IMO need this scalability.

But I would be very much open to using the QMenu or QToolButton somehow for the tracking option. I have thought, yet I am not convinced, of making the show element list a QToolButton with the menu style (this is with the arrow pointing downwards at the right of the button), to add this option there as a drop down. The main problem is that I prefer to keep "List Control" and "Visualisation Control" separated conceptually.

I am open to more ideas and opinions...
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: Wed Oct 06, 2021 6:24 pm I thinking of this kind of ui rearrangement (it is WIP):
This looks good.
Could you maybe make a PR that one can compile it and play around? Then I could give proper feedback using real-life documents before you merge.
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 »

For some reason I cannot add a video showing the features so:

I have just merged the UI revamp of the Constraint Widget and the new Associated Constraints Filter.

Revamp

-> All settings have moved to an independent dialog. There is a new button with the settings icon to show it.
-> There is a new button "Restrict Visibility". This button triggers the showing of all the constraints in the list + hidding all the others.
-> This button has a drop down selector of checkable options. Currently there is just one option. It enables the "tracking" of visibility. This is intended as a shortcut to have the option at hand. There would be a second shortcut when layers are created. This shortcuts work in synchronism with the actual settings of the new independent settings dialog.
-> With this, the actual constraint list is longer.

Associated constraints filter

-> This is a filter that will restrict the list to the constraints associated to the selected elements.
-> Of course, it follows the "tracking" if activated and the new one time trigger button also works on it (as with all other filters).


Of course, I am always interested in bugs.
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: Thu Oct 07, 2021 9:40 pm This looks good.
Could you maybe make a PR that one can compile it and play around? Then I could give proper feedback using real-life documents before you merge.
Give it a good bang with real-life documents. This is always great.

I will gather all the feedback I receive.

As for dialog aesthetics and UX, feel free to discuss and/or propose a PR.
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 »

Ok. For those using Ubuntu PPA, the new UI is in the PPA now:
Screenshot_20211012_095720.png
Screenshot_20211012_095720.png (24.69 KiB) Viewed 3711 times
Open Issues:
Hierarchy - multi-filter - Datum/reference

There is still the open discussion on whether the multi-filter dialog should show a list or a tree.

In a nutshell a tree can be more visual in terms of separation and make better use of the space as the buttons at the bottom could go. A list is more flexible in defining dependencies. One can have different "hierarchies" of filters and groups of filters.

Related to this, I need to resolve the hierarchy of datum and Reference filters. I would like feedback in how you see this part hierarchically.

1. We have references in the constraint list. This is a reality unlikely to change.
2. We have a filter called "Datum". Should the filter comprise all Datum constraints and References? (This was the case before this feature started) or Should the filter comprise only actual constraints and not the references? (This is the current behaviour). In the current behaviour, if one wants to have both datum constraints and references, one should use either the "All" filter, or a multifilter having "Datum" and "Reference" selected.

This relates to the fact that the "Reference" filter might group a subset of "Datums" that may be of all the "Datums" subgroup types, but are not all of them, as it only applies to the ones that are "References". This all depends on the actual definition of the groups.

I am interested not only in the philosophical discussion, but the practicality of the choices.

EDIT: However, if one selects in a multi-filter "Radius", ATM, Reference and non reference Radius are shown. I just realised this doing some testing.

Length/Position of the multi-filter dialog

If we choose to keep the list for flexibility, it might be possible to make some calculations to dynamically resize the dialog if the parent window is big enough. It might be possible to "move" the dialog so that it appears closer to the button triggering it for convenience.

If there are any other open issues, now is the time to remind me.

Happy testing!!
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 »

There is another caveat for discussion and it relates to the behaviour of the setting "hide internal alignment".

It has always been the case that internal alignment constraints are filtered out of the list when this option was active. I think this is the intended behaviour. With the introduction of specific filters per constraint type, there is now a filter option "Internal Alignment".

The current behaviour ATM is showing Internal Alignment constraints regardless of the "hide internal alignment" setting. This is, it violates the setting. However, it appears that it is the only meaningful thing to do. An empty list is not better. But this is caveat 1 "for discussion".

The second caveat is when the "Internal Alignment" is selected in the multifilter. Currently, the "hide internal alignment" setting is enforced. This is, if active, the Internal Alignment constraints are not shown in the list. From the perspective of a "multiple filter" "all checked" being the same as an all filter. This is consistent. However, when only the "Internal Alignment" is selected in the multifilter, an empty list is shown. This is inconsistent with the behaviour under caveat 1, so this is Caveat 2 "for discussion".

If the behaviour of Caveat 1 is acceptable, one could deactivate the "Internal Alignment" checkbox if the "hide internal alignment" setting is active. The Check All and Uncheck All buttons of the multi-filter may need to change behaviour. Well, my question is:

Which one is the behaviour we want to have?
Syres
Veteran
Posts: 2891
Joined: Thu Aug 09, 2018 11:14 am

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

Post by Syres »

sgrogan wrote: ping
As it's been a little while since the Windows LP 0.20dev build has been updated, could you please compile a fresh build so more of the community can have a play, sorry test the Sketcher UI changes.
Done, 0.20.26155
Locked