Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI: Double clicking on group propagating the checked state #4179

Merged
merged 4 commits into from
Jun 26, 2024

Conversation

rldhont
Copy link
Collaborator

@rldhont rldhont commented Feb 8, 2024

When double clicking on a group label or checkbox, the new checked state of the group will be propagated through the tree to all the children.

With this capability, the user will be able to check all the layers contained in a group whatever the depth.

lizmap-dblclicking-treeview

@rldhont rldhont added user interface legend/layer tree Tool which displays the layer tree with legends backport release_3_7 labels Feb 8, 2024
@rldhont rldhont marked this pull request as ready for review February 8, 2024 11:07
@github-actions github-actions bot added this to the 3.8.0 milestone Feb 8, 2024
@Gustry
Copy link
Member

Gustry commented Feb 8, 2024

Nice idea !

assets/src/components/Treeview.js Outdated Show resolved Hide resolved
assets/src/components/Treeview.js Show resolved Hide resolved
@nboisteault nboisteault force-pushed the dblclick-treeview-legend-group branch from afb1652 to 8f25ca1 Compare February 8, 2024 16:08
@nboisteault
Copy link
Member

Sometimes the double click does not work. It might due to the label being linked to the checkbox.
@Gustry @mdouchin could you also test?

simplescreenrecorder-2024-02-08_17.16.42.mp4

@Gustry
Copy link
Member

Gustry commented Feb 9, 2024

Sometimes the double click does not work.

Indeed, I can confirm.
An idea, maybe an icon could be added, similar to the "I" ? (not the best, but similar)

@rldhont rldhont force-pushed the dblclick-treeview-legend-group branch 2 times, most recently from 89fbc0b to fbad033 Compare February 15, 2024 17:20
@rldhont rldhont added run end2end If the PR must run end2end tests or not and removed run end2end If the PR must run end2end tests or not labels Feb 19, 2024
@rldhont rldhont marked this pull request as draft February 20, 2024 09:34
@rldhont rldhont force-pushed the dblclick-treeview-legend-group branch from fbad033 to 23815ec Compare February 20, 2024 09:34
@rldhont rldhont force-pushed the dblclick-treeview-legend-group branch 2 times, most recently from 4f681bf to a0e41c9 Compare March 29, 2024 15:02
@rldhont rldhont added the run end2end If the PR must run end2end tests or not label Mar 29, 2024
@rldhont rldhont marked this pull request as ready for review March 29, 2024 15:03
@rldhont
Copy link
Collaborator Author

rldhont commented Mar 29, 2024

@Gustry @nboisteault @mdouchin It is ready for review!

Copy link
Member

@nboisteault nboisteault left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and approved!

@Gustry
Copy link
Member

Gustry commented Apr 2, 2024

Strange, I can't even try on the "Montpellier" project :

image

@nboisteault Which project did you use ?

@rldhont rldhont force-pushed the dblclick-treeview-legend-group branch from a0e41c9 to 90cd7d1 Compare April 15, 2024 08:58
@Gustry
Copy link
Member

Gustry commented Apr 15, 2024

My comments above remains valid, I don't have any chekbox to try on the "Montpellier" project. On which project are you trying ?

@rldhont
Copy link
Collaborator Author

rldhont commented Apr 15, 2024

My comments above remains valid, I don't have any chekbox to try on the "Montpellier" project. On which project are you trying ?

The "Montpellier" project activates the option to disabled checkboxes for groups.

I am using the "testsrepository/treeview" project.

@Gustry
Copy link
Member

Gustry commented Apr 15, 2024

I am using the "testsrepository/treeview" project.

Ok, but the first "group" in this project, it doesn't work for me with this PR.

@rldhont
Copy link
Collaborator Author

rldhont commented Apr 15, 2024

I am using the "testsrepository/treeview" project.

Ok, but the first "group" in this project, it doesn't work for me with this PR.

What do you mean by it doesn't work for me ?

@Gustry
Copy link
Member

Gustry commented Apr 15, 2024

Freshly load the map http://lizmap.local:8130/index.php/view/map?repository=testsrepository&project=treeview
Peek 2024-04-15 16-06

I do only double click

@rldhont
Copy link
Collaborator Author

rldhont commented Apr 15, 2024

Freshly load the map http://lizmap.local:8130/index.php/view/map?repository=testsrepository&project=treeview

I do only double click

Thanks. The first double click works, not the second one.

@Gustry
Copy link
Member

Gustry commented Apr 22, 2024

This PR is a good move, but I'm not 100% convinced by the approach, given the number of feedbacks on this. A double click is "unknown" on a web interface.

Fine to discuss

@rldhont
Copy link
Collaborator Author

rldhont commented Apr 24, 2024

@nboisteault @Gustry @mdouchin @mind84 @gioman @josemvm @guenterw

I proposed the double click to propagate checked status to tree children, but I can implement an other way to do so. What is your prefered way to propagate checked status to tree children:

  1. Double click
  2. Click right
  3. Click middle
  4. Long press click

@guenterw
Copy link

If I understand (translate) it correctly, it is the function that is used in QGIS with Ctrl+click.
Since not every user uses QGIS, I think the double-click is also best

@josemvm
Copy link
Collaborator

josemvm commented Apr 24, 2024

hi @rldhont for LWC >=3.7 we lost the text of the tooltip that is shown when the mouse passes over the layer name in the layer tree and i don't know if that was intentional... regardless of the choice, how do you intend to inform the user of the existence of this functionality?

however, i prefer double click

@Gustry
Copy link
Member

Gustry commented Apr 24, 2024

Yes, if the choice is between what @rldhont exposed this morning, my choice is also with double click as well.

I was wondering if the behavior of 3.6 should be back or similar. Let's go with this PR and see.

regardless of the choice, how do you intend to inform the user of the existence of this functionality?

For now, I'm not sure too. I want to integrate a tutorial like https://github.com/3liz/lizmap-javascript-scripts/tree/master/library/ui/driver_tutorial from @altheaFeu

@guenterw
Copy link

One more basic thought about the group checkboxes:
Since you have to decide whether to display them or not, I always choose to hide the group checkboxes.
For example, if you have a group of aerial images with a checkbox, with the aerial images of the last 10 years, then there is always the risk that the group is checked and thus all 10 aerial images are loaded on top of each other.
Or in the case of development plans: There is a group of development plans, including groups for 6 districts and the respective plans. Now it can make sense to show all plans for a district, but not necessarily for the whole municipality.

On the other hand, it often makes sense to activate all layers of a group. I would currently control this via the QGIS themes.

Thus, there is actually the desire to determine the display of the group checkbox per group.
But this then leads to an inconsistent picture of the legend. Is this acceptable?

@Gustry I think the tutorial is a good idea

@Gustry Gustry modified the milestones: 3.8.0, 3.9.0 Jun 7, 2024
Copy link

The Lizmap project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 2 months and is being automatically marked as "stale".
If there is no further activity on this pull request, it will be closed in two weeks.

@github-actions github-actions bot added the stale This ticket might be closed soon label Jun 24, 2024
@rldhont rldhont force-pushed the dblclick-treeview-legend-group branch from 90cd7d1 to 9bf44d3 Compare June 25, 2024 18:19
@rldhont rldhont removed the stale This ticket might be closed soon label Jun 25, 2024
Copy link

The Lizmap project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 2 months and is being automatically marked as "stale".
If there is no further activity on this pull request, it will be closed in two weeks.

@github-actions github-actions bot added the stale This ticket might be closed soon label Jun 26, 2024
@rldhont rldhont removed backport release_3_7 stale This ticket might be closed soon labels Jun 26, 2024
@rldhont rldhont merged commit 63bf5a3 into 3liz:master Jun 26, 2024
13 checks passed
@rldhont rldhont deleted the dblclick-treeview-legend-group branch July 8, 2024 06:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport release_3_8 legend/layer tree Tool which displays the layer tree with legends run end2end If the PR must run end2end tests or not user interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants