# Adding Search Bar to Select Person Dialog

**URL:** <https://gramps.discourse.group/t/adding-search-bar-to-select-person-dialog/6845>\
**Category:** Ideas\
**Created:** [January 23, 2025, 8:33am UTC](https://gramps.discourse.group/t/adding-search-bar-to-select-person-dialog/6845 "2025-01-23T08:33:21Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![SteveY](https://avatars.discourse-cdn.com/v4/letter/s/85e7bf/32.png) [@SteveY](https://gramps.discourse.group/u/SteveY)\
**Post date:** [January 23, 2025, 8:33am UTC](https://gramps.discourse.group/t/adding-search-bar-to-select-person-dialog/6845/1 "2025-01-23T08:33:22Z")

</div>

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

 ![image](https://global.discourse-cdn.com/free1/uploads/gramps/original/2X/7/7cabb8fc426ca35eb9af56ba68257889b26e2869.png)  
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

 ![image](https://global.discourse-cdn.com/free1/uploads/gramps/original/2X/9/9c111a28f574a5dd20dfd4d3796587ebbb1df8b9.png)

---

<div class="post-metadata">

**Author:** ![emyoulation](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/emyoulation/32/67_2.png) [@emyoulation](https://gramps.discourse.group/u/emyoulation)\
**Post date:** [January 23, 2025, 9:03am UTC](https://gramps.discourse.group/t/adding-search-bar-to-select-person-dialog/6845/2 "2025-01-23T09:03:26Z")

</div>

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](https://gramps.discourse.group/t/add-a-recent-sub-menu/5760/6) 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.

---

<div class="post-metadata">

**Author:** ![Davesellers](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/davesellers/32/1457_2.png) [@Davesellers](https://gramps.discourse.group/u/Davesellers)\
**Post date:** [January 23, 2025, 2:00pm UTC](https://gramps.discourse.group/t/adding-search-bar-to-select-person-dialog/6845/3 "2025-01-23T14:00:09Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![SteveY](https://avatars.discourse-cdn.com/v4/letter/s/85e7bf/32.png) [@SteveY](https://gramps.discourse.group/u/SteveY)\
**Post date:** [January 23, 2025, 8:58pm UTC](https://gramps.discourse.group/t/adding-search-bar-to-select-person-dialog/6845/4 "2025-01-23T20:58:42Z")

</div>

> [@emyoulation](#):
>
> 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.

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

> [@emyoulation](#):
>
> And also, the [recent-items addon](https://gramps.discourse.group/t/add-a-recent-sub-menu/5760/6) by @kku for the select objects is a huge accelerators 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.

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

> [@emyoulation](#):
>
> Could this be similarly made an addon? That could allow customization of the Selection Helper modality.

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.

---

<div class="post-metadata">

**Author:** ![Nick-Hall](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/nick-hall/32/95_2.png) [@Nick-Hall](https://gramps.discourse.group/u/Nick-Hall)\
**Post date:** [January 23, 2025, 11:15pm UTC](https://gramps.discourse.group/t/adding-search-bar-to-select-person-dialog/6845/5 "2025-01-23T23:15:58Z")

</div>

> [@SteveY](#):
>
> Unlike other “select” dialogs, there is no search bar.

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.

---

<div class="post-metadata">

**Author:** ![SteveY](https://avatars.discourse-cdn.com/v4/letter/s/85e7bf/32.png) [@SteveY](https://gramps.discourse.group/u/SteveY)\
**Post date:** [January 24, 2025, 11:19pm UTC](https://gramps.discourse.group/t/adding-search-bar-to-select-person-dialog/6845/6 "2025-01-24T23:19:35Z")

</div>

@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 🙁 See [gramps/gramps/gui/selectors/baseselector.py at 4e18da0a5aab7084ef6bdcad5d50d7ae5c0b8aff · gramps-project/gramps · GitHub](https://github.com/gramps-project/gramps/blob/4e18da0a5aab7084ef6bdcad5d50d7ae5c0b8aff/gramps/gui/selectors/baseselector.py#L318-L321) 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” ☹

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

> <https://github.com/gramps-project/gramps/blob/4e18da0a5aab7084ef6bdcad5d50d7ae5c0b8aff/gramps/gui/selectors/baseselector.py#L308>

`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](https://github.com/gramps-project/gramps/pull/1869)

---

<div class="post-metadata">

**Author:** ![haraldh](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/haraldh/32/4945_2.png) [@haraldh](https://gramps.discourse.group/u/haraldh)\
**Post date:** [January 26, 2025, 1:25am UTC](https://gramps.discourse.group/t/adding-search-bar-to-select-person-dialog/6845/7 "2025-01-26T01:25:04Z")

</div>

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](https://gramps-project.org/wiki/index.php/Gramps_5.2_Wiki_Manual_-_Tools#Relationship_Calculator)?

---

<div class="post-metadata">

**Author:** ![hewettp](https://avatars.discourse-cdn.com/v4/letter/h/f04885/32.png) [@hewettp](https://gramps.discourse.group/u/hewettp)\
**Post date:** [January 26, 2025, 4:41am UTC](https://gramps.discourse.group/t/adding-search-bar-to-select-person-dialog/6845/8 "2025-01-26T04:41:12Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![SteveY](https://avatars.discourse-cdn.com/v4/letter/s/85e7bf/32.png) [@SteveY](https://gramps.discourse.group/u/SteveY)\
**Post date:** [January 26, 2025, 11:25am UTC](https://gramps.discourse.group/t/adding-search-bar-to-select-person-dialog/6845/9 "2025-01-26T11:25:55Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![SteveY](https://avatars.discourse-cdn.com/v4/letter/s/85e7bf/32.png) [@SteveY](https://gramps.discourse.group/u/SteveY)\
**Post date:** [January 26, 2025, 2:19pm UTC](https://gramps.discourse.group/t/adding-search-bar-to-select-person-dialog/6845/10 "2025-01-26T14:19:54Z")

</div>

> [@haraldh](#):
>
> Would it also be possible to include the search bar for the Tools \> Utilities \> [Relationship Calculator](https://gramps-project.org/wiki/index.php/Gramps_5.2_Wiki_Manual_-_Tools#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:

 ![image](https://global.discourse-cdn.com/free1/uploads/gramps/original/2X/1/1661084c8a3fd124abea5c4e2fee9ec95faa7641.png)

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

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/gramps/original/1X/2ac1e712b7adf612e31ca08a55419f4cf37c0158.png) [@system](https://gramps.discourse.group/u/system)\
**Post date:** [February 25, 2025, 2:20pm UTC](https://gramps.discourse.group/t/adding-search-bar-to-select-person-dialog/6845/11 "2025-02-25T14:20:15Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
