New UA Web Connect Pack addon – How to integrate into Gramps?

I’ve implemented a new Gramps “UAWebPack” addon. It shows Ukrainian sources in the context menu. The default lang is English, and a Ukrainian locale is added:


What is the next step to integrate it to Gramps?

I also have some observations about the libwebconnect library:

  1. Some improvements could significantly expand the capabilities of my addon and others. In some existing addons, I saw commented-out attempts to use the “place” variable in the context menu on the Place tab. I also intended to do this, but libwebconnect does not have an implementation for Place, only Person. Is there any plan to improve this library? I even tried adding a Place implementation by analogy, but the context menu does not appear on the Place tab. Is it blocked at the core Gramps level?
  2. The library explicitly overwrites the setting:

config.register("behavior.middle-name", "remove")

However, for Ukrainian names, “separate” mode would be more relevant:

config.register("behavior.middle-name", "separate")

Can the library be adapted so that WebPack addons can configure this setting while using libwebconnect?

2 Likes

Here it is: https://github.com/jurchello/UAWebPack

2 Likes

@Nick-Hall I’ve added pull request to add the addon into Gramps project 5.2 and 6.0.

1 Like

@Urchello You should submit the source code to the addons-source repository. We will then build it for you and publish the tgz with updated listings in the addons repository.

1 Like

Yes. See pull request #2008 which enables the Web Connection menu in all list views. It is a small change, but we would not normally allow this in a maintenance branch.

Changes to the libwebconnect library would also be required, but these could be done outside of the core development cycle.

This setting is specific to the libwebconnect library. It is possible to change the setting, but it would affect all web connection addons.

The setting is never changed, so there is certainly room for improvement here.

1 Like

Done, I made two PRs for 5.2 and for 6.0.

no, I mean, we can use the default setting as is, but give ability to configure it from addons if they need:

Before:

config = configman.register_manager("libwebconnect")
# "leave alone", "separate", or "remove":
config.register("behavior.middle-name", "remove")
config.load()
config.save()

After:

class WebConnectConfig:
    def __init__(self, middle_name_behavior=None):
        self.config = configman.register_manager("libwebconnect")

        if middle_name_behavior:
            self.config.register("behavior.middle-name", middle_name_behavior)
        else:
            self.config.register("behavior.middle-name", "remove")

        self.config.load()
1 Like

@Urchello , I found the WebConnect to be very useful when fresh. But it is highly susceptible to linkrot and the UI being a scrollable submenu of a Context Menu is awkward.

Perhaps you might consider converting it to a Gramplet? Or a Tool that adapts to the current Category, like SuperTool does.

And it could use the same lists system that @kmikkels uses for the Historical Context gramplet with selectable external CSV files ? That would allow reducing compacting to a single Addon instead of a core module plus language packs. And make maintenance less painful too.

Yes, I think, now I have enough skills to make it. I also thought about something similar but in a bit another way:
We could use a single WebPack addon with an identical structure, but the
WEBSITES = [...]
list would be configured in a JSON file inside the package and would contain locale-based keys.

If the user’s locale matches a key in the JSON file, the corresponding website list will be used. If there is no match, a default list will be loaded—for example, including well-known resources like FamilySearch and MyHeritage, which are useful for everyone. We even can move this json configuration to a separate file. In this case we will work via context menu as is.
But what is better, context menu vs gramplet in sidebar :thinking:? As for me context menu is better here. But long lists are not good… Is it possible make nested context menu from the addon?

1 Like

although a gramplet in sidebar would be ok also

1 Like

When using US Web Connect lookups (while logging cross-references), I tended to do 3 or 4 look ups in a row: FindAGrave, FamilySearch, WikiTree, MyHeritage, and so on.

So that was a LOT of fussy Context Menu navigating for each Person. I’d much rather a Tool or Gramplet where I can work down the list efficiently.

1 Like

I suggest that you keep the default value the same and just change the setting:

self.config.register("behavior.middle-name", "remove")
self.config.set("behavior.middle-name", middle_name_behavior)

If the new setting matches the default then it will remain commented out in the .ini file.

So, I already have a working gramplet, at leat the basic feature - it loads data from csv and replaces several variables for people and places.

person supports such variables:

        return {
            "first": first or "",
            "middle": middle or "",
            "surname": surname or "",
            "birth_year": self.get_birth_year(person) or "",
            "death_year": self.get_death_year(person) or "",
            "birth_place": self.get_birth_place(person) or "",
            "death_place": self.get_death_place(person) or "",
        }

place supports:

        return {
            "place": name or "",
        }
1 Like

Plans for Improving the Gramplet:

  1. Add an “Is Enabled” Column in the CSV file with binary values (0 or 1).
  • This will allow users to temporarily disable specific links without physically deleting them.
  1. Consider Grouping Links by Categories with Expand/Collapse Option
  • This could make the interface more structured and compact.
  • However, it would require an extra click from the user, so, Im not sure :thinking:.
  • Further evaluation is needed to determine if this feature is worth implementing.
  1. Add Labels Indicating Used Variables
  • Some links can be constructed using different variable combinations.
  • For example, one search might use only the first name, while another might include both the first name and birth year.
  • Labels could help users understand which variables are utilized in each link. But it can use some space in a row :thinking:
  1. Bug: Links Are Not Updated When Switching Between Tabs (e.g., Persons and Places)
  • Currently, links from the previous entity remain visible after switching tabs.
  • The list updates only after clicking on an item.
  • The issue is likely due to an unidentified signal that should trigger the update upon tab switch.
  1. Rename the Gramplet to a Shorter Name (e.g., “WebSearch”)
  • Open to suggestions for renaming both the Gramplet and its variables to make them more concise and intuitive.
  1. Restrict Lists by Locale
  • Still undecided on the best way to implement this.
  • One option could be to introduce locale-based settings.

Additional Notes:

  • The libconnect library is not used because there is no context menu in this implementation.
  • Open to any suggestions for further improvements.

Since these gramplets can be detached/undocked and can key off different (Person, Place) objects, there should be a disambiguation header line indicating the object being used for the lookup: Person or Place

but links list on the People page isnt the same as list on the Places page. Script filters them by nav_type. So, each page will have own set of links.

Historical Context gramplet gives a checkbox selection for choosing which External Lists will be listed:

yes, I think I will implement something similar setting to use multy-select for different locales

1 Like

Agreed. That is obvious to the creator of the gramplet, but not necessarily obvious to users. You have a Category column. Perhaps a Person or Place icon could be prefixed to the Category?

Yes, let’s add icons. I can also add it as text if it gives us some benefits.

1 Like