Difference between revisions of "GEPS 002: RelationView Expand and Collapse"

From Gramps
Jump to: navigation, search
(Code)
 
(26 intermediate revisions by 6 users not shown)
Line 1: Line 1:
 +
{{GEPS-Finished}}
 +
{{man menu|Status: Accepted and Completed in Gramps 3.0}}
 +
 
Proposed changes for enhancing RelationView by adding expand/collapse
 
Proposed changes for enhancing RelationView by adding expand/collapse
[[Category:GEPS]]
 
  
 
==Introduction==
 
==Introduction==
Line 13: Line 15:
  
 
The change does remember what families have been collapsed, so when you return to a person, you get the same view as previous view (for this session).
 
The change does remember what families have been collapsed, so when you return to a person, you get the same view as previous view (for this session).
 +
 +
The second proposed change is that siblings or children that have children themselves are shown in the same markup style (bold and italic) that the PedigreeView uses to show the same thing.
  
 
==Example/Screenshot==
 
==Example/Screenshot==
  
The first screenshot shows the RelationView as normal, but includes the "Collapse" icon (currently a magnifying glass with a minus sign.)
+
The first screenshot shows the RelationView as normal, but includes the "Collapse" triangle icons (the same icon used in the PeopleView). Also, the columns in the lower section have been shifted left to make more room. As you move your mouse over the triangles, they turn black, like in the PeopleView.
  
[[Image:expand-1.png|thumb]]
+
[[Image:expand-5.png|400px]]
  
The second screenshot shows the RelationView, and now includes the "Expand" icon (currently a magnifying glass with a plus sign.)
+
The collapsed view now fit into the window. Notice that Jessie McKinney is bold+italic to show that she has children (as does the PedigreeView).
  
[[Image:expand-2.png|thumb]]
+
[[Image:expand-4.png|400px]]
 
 
The third screenshot shows the RelationView with the suggestions made by Anne and Benny: the collapse list is kept based on the active person, and collapsed sections now have a nice summary text.
 
 
 
[[Image:expand-3.png|thumb]]
 
  
 
==Code==
 
==Code==
  
The changes necessary to implement these changes can be found [http://bubo.brynmawr.edu/~dblank/relationview-01.patch here]. This can be applied to version gramps30.
+
The code (version 03) necessary to implement these changes can be found [https://gramps-project.org/bugs/file_download.php?file_id=796&type=bug here]. This patch can be applied to version gramps30.
  
 
=== Options ===
 
=== Options ===
  
 
The families/parents to expand/collapse are kept in a list which hangs off of a dictionary entry of the active person's handle. The list is only kept during the current session; it will revert to all expanded when restarted.
 
The families/parents to expand/collapse are kept in a list which hangs off of a dictionary entry of the active person's handle. The list is only kept during the current session; it will revert to all expanded when restarted.
 
The icon can be changed to something better. I wanted a triangle like on the people view (">" when collapsed, "V" when expanded) but there wasn't anything like that in stock gtk icons). If someone is skilled in making these (or if you have a better idea) please help.
 
  
 
=== Impact ===
 
=== Impact ===
  
Requires three phrases for translation: "Expand/Collapse this section", "(%d children)", and "(%d siblings)".
+
Requires four phrases for translation: "Expand this section", "Collapse this section", "(%d children)", and "(%d siblings)".
  
 
Has a minimal screen impact.
 
Has a minimal screen impact.
  
 
The handles of families that are collapsed are placed into a list referenced by a dictionary lookup. A substantial number of families per active-person would have to be collapsed for this to have an effect on performance. This is deemed to be unlikely.
 
The handles of families that are collapsed are placed into a list referenced by a dictionary lookup. A substantial number of families per active-person would have to be collapsed for this to have an effect on performance. This is deemed to be unlikely.
 +
 +
The latest version with the summaries per collapsed line was a little more intrusive into existing code. The code that generates the RelationView is a combination of predetermined columns and dynamic rows counted as it generates entries. In a couple of places, the row was advanced in one place, but required a backup to put the summary on that line. I decided to implement it in such a manner as to keep similar logic together (ie, the code to count children is in the same method that prints the children, depending on collapse/expand).
 +
 +
I had to add '''person''' as an argument to a few methods. I gave it a None default in case these are called outside of this file (I didn't see any).
 +
 +
I also added a new GrampsWidget: an ExpandCollapseLabel. In addition, I added a parameter LinkLabel constructor, but made it backward compatible.
  
 
==Future versions==
 
==Future versions==
  
One could expand/collapse the siblings (which would make it so that the Show Siblings option would not be needed). However, this could make the screen too busy (considering that we would like to add some addition elements to this page).
+
One could expand/collapse the siblings (which would make it so that the Show Siblings option would not be needed). However, this could make the screen busier.
 +
 
 +
Other related changes one might consider to make to clean up this view:
 +
 
 +
# Add an edit button to top row, regardless of "Show edit" settings. How else do you edit the active person?
 +
::Not needed. The edit button is in the toolbar, as this is a view centered around that person [[User:Bmcage|bmcage]] 05:28, 5 September 2007 (EDT)
 +
:::True, but it might be more consistent if there were one. Families and Parents have an Edit button regardless. [[User:Dsblank|dsblank]] 08:03, 5 September 2007 (EDT)
 +
# Add active person to sibling list, but make it so that you can't click it. I get confused when the active person isn't in the list of the parent's children. The "(n siblings)" label would then change to just "(n+1 children)".
 +
# Move the "Show edit buttons in relation view" from Preferences to View menu to be consistent with "Show siblings" and "Show details".
 +
# Add "Last Change" date/time somewhere, maybe in top section above/below picture.
  
 
==User Contributions==
 
==User Contributions==
 +
 +
A discussion of these ideas can be found on the [http://gramps.1791082.n4.nabble.com/Proposed-changes-for-enhancing-RelationView-td1796091.html gramps-dev mailing list].
 +
 +
Also, Stian noticed a nitpick: the names of the children did not line up. How's this:
 +
 +
[[Image:indentation-1.png|400px]]
 +
 +
Line 912, gramps30/src/DataViews/_RelationView.py:
 +
 +
l.set_padding(32, 0)
 +
 +
and around line 8688:
 +
 +
        label = GrampsWidgets.BasicLabel("%d." % index)
 +
        label.set_width_chars(1)
 +
        hbox.pack_start(label,
 +
 +
==See also==
 +
* {{bug|1782}} Further refinements to Relationship View
 +
 +
[[Category:GEPS|R]]
 +
[[Category:Developers/Design]]

Latest revision as of 01:31, 9 August 2015

Gnome-important.png
GEPS Closed

This GEPS (Gramps Enhancement Proposal) is closed and available in the version of Gramps indicated below.
Do not edit this page. Submit bugs/features to https://gramps-project.org/bugs/.

Status: Accepted and Completed in Gramps 3.0

Proposed changes for enhancing RelationView by adding expand/collapse

Introduction

This page proposes and discusses possible changes to the RelationView of the GRAMPS GUI (Relationships).

The first proposed change is the addition of expand/collapse buttons on the Parents and Family lines. This would allow the user to hide the details of the Parents, or a particular Family. This functionality helps a researcher focus their attention on one aspect (family) of the person.

This differs from the "View" -> "Show Siblings" and "Show Details" in a couple of ways:

  1. the expand/collapse is specific to a particular family
  2. only lasts for the current session

The change does remember what families have been collapsed, so when you return to a person, you get the same view as previous view (for this session).

The second proposed change is that siblings or children that have children themselves are shown in the same markup style (bold and italic) that the PedigreeView uses to show the same thing.

Example/Screenshot

The first screenshot shows the RelationView as normal, but includes the "Collapse" triangle icons (the same icon used in the PeopleView). Also, the columns in the lower section have been shifted left to make more room. As you move your mouse over the triangles, they turn black, like in the PeopleView.

Expand-5.png

The collapsed view now fit into the window. Notice that Jessie McKinney is bold+italic to show that she has children (as does the PedigreeView).

Expand-4.png

Code

The code (version 03) necessary to implement these changes can be found here. This patch can be applied to version gramps30.

Options

The families/parents to expand/collapse are kept in a list which hangs off of a dictionary entry of the active person's handle. The list is only kept during the current session; it will revert to all expanded when restarted.

Impact

Requires four phrases for translation: "Expand this section", "Collapse this section", "(%d children)", and "(%d siblings)".

Has a minimal screen impact.

The handles of families that are collapsed are placed into a list referenced by a dictionary lookup. A substantial number of families per active-person would have to be collapsed for this to have an effect on performance. This is deemed to be unlikely.

The latest version with the summaries per collapsed line was a little more intrusive into existing code. The code that generates the RelationView is a combination of predetermined columns and dynamic rows counted as it generates entries. In a couple of places, the row was advanced in one place, but required a backup to put the summary on that line. I decided to implement it in such a manner as to keep similar logic together (ie, the code to count children is in the same method that prints the children, depending on collapse/expand).

I had to add person as an argument to a few methods. I gave it a None default in case these are called outside of this file (I didn't see any).

I also added a new GrampsWidget: an ExpandCollapseLabel. In addition, I added a parameter LinkLabel constructor, but made it backward compatible.

Future versions

One could expand/collapse the siblings (which would make it so that the Show Siblings option would not be needed). However, this could make the screen busier.

Other related changes one might consider to make to clean up this view:

  1. Add an edit button to top row, regardless of "Show edit" settings. How else do you edit the active person?
Not needed. The edit button is in the toolbar, as this is a view centered around that person bmcage 05:28, 5 September 2007 (EDT)
True, but it might be more consistent if there were one. Families and Parents have an Edit button regardless. dsblank 08:03, 5 September 2007 (EDT)
  1. Add active person to sibling list, but make it so that you can't click it. I get confused when the active person isn't in the list of the parent's children. The "(n siblings)" label would then change to just "(n+1 children)".
  2. Move the "Show edit buttons in relation view" from Preferences to View menu to be consistent with "Show siblings" and "Show details".
  3. Add "Last Change" date/time somewhere, maybe in top section above/below picture.

User Contributions

A discussion of these ideas can be found on the gramps-dev mailing list.

Also, Stian noticed a nitpick: the names of the children did not line up. How's this:

Indentation-1.png

Line 912, gramps30/src/DataViews/_RelationView.py:

l.set_padding(32, 0)

and around line 8688:

       label = GrampsWidgets.BasicLabel("%d." % index)
       label.set_width_chars(1)
       hbox.pack_start(label,

See also

  • 1782 Further refinements to Relationship View