Adding Search Bar to Select Person Dialog

Gramps Users,
I’m interested in your feedback on a proposed change to the select person dialog. This dialog is shown in multiple places but one example is when selecting a child to add to a family, as shown in the image below


Unlike other “select” dialogs, there is no search bar. I’d like your feedback on whether we should add the search bar. If the feedback is positive, this will be included in the next release of Gramps.
The image below shows what this could look like

4 Likes

I’m confused. Didn’t the select person dialog already have such a find/filter until a threshold is hit? (Like about 1,000 people?) My tree has long exceeded that threshold. But I recall grumbling about the search becoming disabled.

And also, the experimental recent-items addon by @kku for the select objects is a huge accelerator for data-entry. I would prefer its use of row space.

Also, after discussion the recent‐items implementation as an addon was deemed to be preferable to being rolled into core.

Could this be similarly made an addon? That could allow customization of the Selection Helper modality.

I would like to see a faster way to select a person for sure. However, which might that be?
If there is a search bar I have to type something in for the search (slow), but if I just had A to Z across the top to allow me to get to the correct surname section, might be faster.
The latter might be good for English style names but the search bar may be better for other forms/formats.
Whatever it is, it should be in the current windows that have the person selection feature.
I agree that something is needed as I still have problems with the scrollbar from time to time.

I don’t think so. My first screen shot was taken from a new database with just one or two people in it.

I see the changes as complimentary, solving slightly different problems. Both aiming to improve the selection dialogs.

This change is simply enabling existing functionality. It’s a one line change, which is why there is agreement that it could be included in gramps 6. If there is agreement.

2 Likes

I think the problem is that it doesn’t work when you select a Father or Mother in the family editor. Try finding “Name contains: Allen” in the example database.

The search bar may be hidden when selecting a Child for consistency.

@Nick-Hall good find.
I now understand why it does not work when selecting a Father or Mother. In these situations a default filter, FastMaleFilter or FastFemaleFilter is passed in to BaseSelector. These filters do as they say.

If a default filter is passed in to BaseSelector then any filter entered in the search bar is always ignored :slightly_frowning_face: See gramps/gramps/gui/selectors/baseselector.py at 4e18da0a5aab7084ef6bdcad5d50d7ae5c0b8aff · gramps-project/gramps · GitHub where self.filter[1] is the default filter.

It’s easy enough to amend this behaviour such that any search bar filter takes precedence over the default filter by changing the if to
if (not self.filter[1]) or (self.search_bar.get_value()[1]): The search bar then works.

There’s always a “but”. In this story, it’s that the search bar filter will search all people. For example, if you are selecting a Father, by default only males are shown. If you enter a search bar filter that matches a female name, that person will be shown. I think you can argue the correctness of this either way.

One solution might be to use the search bar to filter on gender, rather than using the FastMaleFilter or FastFemaleFilter. For the English language, this would required an additional filter “Gender is”; “Gender contains” with the value “Male” also matches “Female” :frowning:

… some head scratching later… :hourglass_flowing_sand: I believe there’s a bug in BaseSelector.setup_filter

pair[0] in self.exact_search() should be pair[1] in self.exact_search() The search bar then offers options “Gender is” and “Gender is not” rather than “Gender matches” and “Gender does not match”. I’ll file a separate PR for this. PR #1869

1 Like

This sounds like a very useful feature that will definitely make it easier to find the right individual, significantly improving the user experience!

Would it also be possible to include the search bar for the Tools > Utilities > Relationship Calculator?

1 Like

Yes, it is tedious to scroll through the long list of surnames to find the person I want to select. There are a few places where this person select dialog (or similar) comes up, and a consistent approach across all of them would be great. A search function for all of these would be a worthwhile improvement.

1 Like

The search bar will be shown everywhere that uses the standard person selector dialog. This includes:

  • selecting the father, mother and children in the edit family dialog
  • Geography view: when selecting a parson for “Have they been able to meet?”
  • relationship view

and several add-ons that use the same dialog for selecting a person, including

  • CombinedView
  • Forms
  • PhotoTagging

Unfortunately that does not included the relationship calculator.

I think it is going to be possible to adjust the relationship calculator so that it extends the standard person selector dialog. It then, automatically, gets the same functionality as the standard select person dialog, including the search bar.

Here’s a screenshot of a working prototype:

There are still some cosmetic things to adjust, which I’ll continue working on.

1 Like