Skip to content

Conversation

mark-pitblado
Copy link
Collaborator

Fixes #6171

The reason why the geomap feature is mentioning GBIF and iDigBio for query results is that it is using the same component as the specify network functionality. This PR adds a conditional check to see if a gbif or iDigBio description is present, and if not, does not show the details component.

The existing condition (items.length === 0) shouldn't trigger as long as the localization string is set, so I don't think there are any edge cases to consider with swapping it out. Without a GBIF description or iDigBio description, the specifyNetworkText isn't really appropriate.

Alternative solutions I considered:

  • Add a different localized description on what the geomap for the query results is showing (the location of the records) however I think that this is exactly what the user expects and doesn't need any further explanation.
  • Change the language in the existing localization string to cover both the specify network and query context (seems like it would be hard without an incredibly verbose description).

Checklist

  • Self-review the PR after opening it to make sure the changes look good and
    self-explanatory (or properly documented)
  • Add relevant issue to release milestone
  • Add pr to documentation list
  • Add automated tests

Testing instructions

  • Create a query that contains a locality field. Run the query and click "GeoMap". Observe that the details dropdown is no longer present. (I have tested this and working for me)
  • Find some records which the Specify Network Locality tool could be used on. Open the Specify Network Locality tool and see that the details dropdown is present, and that there is no longer two space errors. (I have not tested this, as I don't have any records that seem to match what the network tool is expecting)

Both queries and the specify network feature utilize the same component
and the same descriptions for showing records on a map. This fix checks
to see if there is a gbif or idigbio description available (as there
would be in the specify network context) and only shows the details
dropdown in that case. If the user is viewing the map from query
results, no description is shown, as it is not accurate in that context.

Additionally, adds a space between the descriptions if more than one.
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR ensures the geomap popover only shows the details section if there is a GBIF or iDigBio description and cleans up how multiple description items are rendered by inserting single spaces between them.

  • Replace items.length check with explicit description presence check
  • Map over items to insert spaces instead of rendering the array directly
Comments suppressed due to low confidence (1)

specifyweb/frontend/js_src/lib/components/SpecifyNetwork/Map.tsx:224

  • There’s new conditional logic around showing the details component. Consider adding unit or integration tests to verify that details are hidden when both descriptions are absent and shown otherwise.
  ]);

Eslint is complaining that || should be ??, however I think that a blank
string shouldn't count as a description in this context.
@melton-jason melton-jason self-requested a review July 17, 2025 04:17
@grantfitzsimmons grantfitzsimmons modified the milestone: 7.11.2 Jul 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 📋Back Log
Development

Successfully merging this pull request may close these issues.

Inaccurate description within details of GeoMap popover
4 participants