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

Add option for what to do when individual clicked on in diagram #402

Closed
Neriderc opened this issue Apr 10, 2023 · 18 comments · Fixed by #486, #490 or #491
Closed

Add option for what to do when individual clicked on in diagram #402

Neriderc opened this issue Apr 10, 2023 · 18 comments · Fixed by #486, #490 or #491
Labels
enhancement New feature or request
Milestone

Comments

@Neriderc
Copy link
Owner

I could even imagine a further improved setting, where I admit not to know if and how it could work:
If you want to add individuals to the displayed tree and you are in the "add to list" mode you need two clicks to get the enlarged diagram:

  1. at the individuals name in the diagram
  2. open GVE-diagram in the individual page

Could there be an "add clicked individual to diagram" option so that the enlarged diagram is shown immediately after the click on an individual?

Originally posted by @schuco in #396 (comment)

@Neriderc Neriderc added the enhancement New feature or request label Apr 10, 2023
@Neriderc Neriderc changed the title I like the new style with unfolding functionlity very much. Add option for what to do when individual clicked on in diagram Apr 10, 2023
@Neriderc
Copy link
Owner Author

Currently, when you click on an individual in the diagram, you either have URLs enabled - in which case the page of the individual will open, or you don't - in which case nothing happens.

We should remove the option for URLs, and replace this with a list of what should happen when an individual is clicked. This could have the following options:

  • Open individual's page in webtrees (default)
  • Add individual to list of starting individuals
  • Add individual to list of stopping individuals
  • Do nothing

@schuco
Copy link

schuco commented Apr 10, 2023

Replacing the URL option to get the enlarged functionality is an excellent idea.
The only disadvantage may be for those who aim on clickable pdf or svg files. They will finally have to switch to the regarding option. It may be mentioned that this option will provide URLs and other options will not

@Neriderc
Copy link
Owner Author

Hmm I did not think of that. One option is about the browser, and the other about the output, but currently the URL setting does both.

I think perhaps we will need to retain the URL option, which would only apply to output (SVG/PDF), and add this additional option for what happens when you click within the browser.

@Neriderc
Copy link
Owner Author

Replying to #232 (comment)

* you can choose the treatment of starting individuals in the advanced options (default, add to list, ...) . I personally would prefere to see this option field in the primary menu, as I want to know which reaction can be expected and also to be able to switch this setting easily

Ok we can consider that. Another option is to show a menu when clicking to get several options. We can in theory use a right click, but I do not like doing that as it prevents the user using the normal right click menu. We could, however, use the left click to show a menu.

* maybe these options can be even extended by an option, where a click does not result in going to the individuals page but rather in adding this individual to the list of starting persons without leaving GVExport.

Yes I think there are several options we can add here. Some of them more advanced than others, so we may need to consider carefully how this works.

@Neriderc
Copy link
Owner Author

          It looks like one may have different experiences and opinions on the same thing. As far as I have worked with the MyHeritage tree I found it much less comfortable and effective in exploring a relationship tree. Switching the tree to get ancestores or descendants of a presently displayed individual makes members of the tree disappear in the new display and visible connections get lost. GVExport, after expanding the tree with additional source individuals, keeps all relations visible which have been explored up to now. Of course you may have to zoom or move the diagram around.

Still I would like to propose a further improvement in GVExport to support stepwise exploring family relations by adding further source individuals:
The procedure now is:

  1. click on an individual you want to add as source individual.
  2. The individual person's page will open.
  3. You select "Charts" and roll down to select"GVExport"
    If you have selected "treatment of souce individuals" under "advanced settings" or you already have included more than one source individual an expanded diagram will appear.

My proposal would be:
In the diagram from GVExport there would be another clickable option below "full screen" and "search". This option would control what happens when you click on a name in the diagram.
Either the person's page is shown as it currently is, or a new diagram appears immediately, expanded to include the person clicked on.

Originally posted by @schuco in #456 (comment)

@Neriderc
Copy link
Owner Author

Neriderc commented Jun 1, 2024

This is now done. Feel free to update from the main branch and test it out!

This involved quite a few challenges that required quite a few changes, so it would be good to get confirmation everything is working ok.

You can find the new setting in the General settings -> Browser render options, where the auto-update option is.

@Neriderc Neriderc added this to the 2.1.22 milestone Jun 1, 2024
@schuco
Copy link

schuco commented Jun 1, 2024

I tried the new options to choose what happens when individual is clicked on.
Unfortunately this seems not to work in my case. Regardless which option I chose (add to list, open menu, do nothing, ...) the reaction is to open the individuals page.
I have set the admin option for starting persons to default, as I normally use "add to list", but no change. I made resets. I have an installation with graphgviz on the server.

One further proposal resp. whish not linked to the observation above. Could you add another option for what happens when individual is clicked on:
mark the clicked individual in the chart by a preselected colour (like option for starting persons)

@Neriderc
Copy link
Owner Author

Neriderc commented Jun 1, 2024

Unfortunately this seems not to work in my case. Regardless which option I chose (add to list, open menu, do nothing, ...) the reaction is to open the individuals page.

Hmm. This would probably happen if there is an error preventing the code from running (since part of the code blocks the normal action to follow the link). Could you check the browser console for any red error messages? Right click anywhere on the page, then choose "Inspect", then there should be a "Console" tab. If there are any red messages there, let me know what it says.

One further proposal resp. whish not linked to the observation above. Could you add another option for what happens when individual is clicked on:
mark the clicked individual in the chart by a preselected colour (like option for starting persons)

Oh yes, I remember you suggesting this. I will create a new issue to track it.

@schuco
Copy link

schuco commented Jun 1, 2024

When I click the option to add individual to the list I get the console message/warning, which says empty string transmitted
grafik

@Neriderc
Copy link
Owner Author

Neriderc commented Jun 1, 2024

I think that's unlikely to be the cause of the issue, as generally warnings don't prevent future code from running, which I think is probably happening in this case. Do you get a red error if you try to click on something in the diagram?

@Neriderc
Copy link
Owner Author

Neriderc commented Jun 2, 2024

I think I've fixed this. I worked out how to disable "pretty URLs" as I believe you both have servers with this disabled, and I saw the issue that you are having. I thought I had accounted for this, but it seems the URL often shows the HTML code '%2F' instead of the character it stands for ('/'), and so I have updated the check to correct this before testing the URL.

I'm using the URL for a couple of things, but the important part here I think is the check for whether it is an individual. It looks for '/individual/' in the URL (which I believe is always in English, based on a quick glance at the webtrees source code). If this is not found, it is treated as a family record and the default action applies (if URLs are enabled, it would open the link).

This problem would not result in an error in the browser log, as no error would be encountered.

I have made this change in the main branch and tested that it works for me. If you could update from the main branch again and test it, that would be great!

@schuco
Copy link

schuco commented Jun 2, 2024

Now it works as expected - thank you!

Two issues to be corrected for the option "show menu":

  1. the popping up menu is sometimes partly hidden behind the general menu
  2. the menu is not shown in the fullscreen mode

This was linked to pull requests Jun 2, 2024
@Neriderc
Copy link
Owner Author

Neriderc commented Jun 2, 2024

Great!

Thank you for pointing out those issues. I think they were caused by a last minute change I made to fix when the menu wasn't appearing in the right place sometimes.

I've now merged in a new pull request. Hopefully that's the last of the issues, but please let me know if you find more!

@schuco
Copy link

schuco commented Jun 2, 2024

This works perfect!
The option "show menu" makes the new amendment much more powerful than I had expected. I think I will make "show menu" the default behaviour as it is easyer to make two clicks in the popup-menu than going back to the side menu and change settings there.

Another idea to amend this new option:
add the clicked individual to the clippings cart

@hartenthaler
Copy link

Hey, that is a beneficial new option! It allows me to cut and expand the tree dynamically! I will set the option to "show menu", too.

Now it is necessary to have the possibility to export the persons and families from GVExport zu the clippings cart. I know already how to do that. So time to finish #177 . Beside that, the suggested option "add the clicked individual to the clippings cart" by schuco makes some sense, too. But adding single persons is my opinion not enough, in most cases you need additionally the families of that person.

@schuco
Copy link

schuco commented Jun 5, 2024

Still using and enjoying the "show menu" option I have

  • another observation:
    when you click an individual in the lower part of the screen the popping up menu is partly outside the screen. Scrolling makes the menu to disappear.

  • and another proposal for an extension:
    In my workflow it is my first action in most cases to switch to fullscreen mode. Could there be an option to display the diagram immediately in full screen as soon as it is updated?
    Then it would be fine to have another option in the pop-up-menu to get the side menu directly from fullscreen mode without having to finish fullscreen mode by clicking "x".
    Having that would allow to do most of the work in fullscreen mode which should be especially helpful on tablets or even mobiles.

@schuco
Copy link

schuco commented Jun 5, 2024

@hartenthaler wrote:

Now it is necessary to have the possibility to export the persons and families from GVExport zu the clippings cart. I know already how to do that. So time to finish #177 . Beside that, the suggested option "add the clicked individual to the clippings cart" by schuco makes some sense, too. But adding single persons is my opinion not enough, in most cases you need additionally the families of that person.

I agree. To effectively work with webtrees mainly from a GVExport-fullscreen-interface, clicks on families should get a pop-up-menu simular to that of individuals.

@Neriderc
Copy link
Owner Author

Neriderc commented Jun 5, 2024

  when you click an individual in the lower part of the screen the popping up menu is partly outside the screen. Scrolling makes the menu to disappear.

I have created a new issue to track this. I will have to see what we can do about it, it's probably not a quick fix, but we should be able to fix it.

  In my workflow it is my first action in most cases to switch to fullscreen mode. Could there be an option to display the diagram immediately in full screen as soon as it is updated?
  Then it would be fine to have another option in the pop-up-menu to get the side menu directly from fullscreen mode without having to finish fullscreen mode by clicking "x".
  Having that would allow to do most of the work in fullscreen mode which should be especially helpful on tablets or even mobiles.

This change to show the settings in full screen is a lot more significant than it appears, for reasons that are hard to explain if you aren't familiar with web development. Not impossible, but I think this will not be done any time soon. I've created an issue so we don't forget, and I will get to this one day.

I agree. To effectively work with webtrees mainly from a GVExport-fullscreen-interface, clicks on families should get a pop-up-menu simular to that of individuals.

It should be relatively easy to add a menu for families once we decide what we want it to show. I feel it's best to wait until @hartenthaler has completed his planned work on the clippings cart to avoid conflicts and see if that work opens up nice possibilities for the menu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
3 participants