Skip to content

Add pathway and species autocomplete with param panel#24

Open
marvinm2 wants to merge 3 commits intomasterfrom
pr/autocomplete-params
Open

Add pathway and species autocomplete with param panel#24
marvinm2 wants to merge 3 commits intomasterfrom
pr/autocomplete-params

Conversation

@marvinm2
Copy link
Collaborator

@marvinm2 marvinm2 commented Mar 9, 2026

Summary

  • Pathway ID autocomplete: Searchable dropdown fetches pathway IDs from the SPARQL endpoint for {{pathwayId}} parameters
  • Species autocomplete: Dynamic species autocomplete fetched from endpoint for {{species}} parameters
  • Generic autocomplete refactor: Extracted reusable initAutocomplete() function to support any SPARQL-backed parameter dropdown
  • jQuery 1.x compatibility: Fixed Mustache.js to use window.Mustache global instead of ES module export
  • Query info container: Added #query-info div for displaying query metadata above the param panel

Test plan

  • Open a query with {{pathwayId}} param — verify autocomplete dropdown appears and is searchable
  • Open a query with {{species}} param — verify species dropdown populates from endpoint
  • Verify autocomplete selections populate the query text correctly
  • Test in browsers with jQuery 1.x (no ES module support)
  • Confirm no console errors on page load

marvinm2 and others added 3 commits March 8, 2026 20:59
When a query has a pathwayId parameter, the input field now shows a
searchable autocomplete dropdown with pathway IDs, titles, and species.
Fetches pathway list via SPARQL on first use and caches it for the
session. Supports keyboard navigation (arrow keys, Enter, Escape) and
selects input text on focus for easy replacement.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Extract reusable initAutocomplete() from pathway-specific code
- Add fetchSpeciesList() with SPARQL query and caching
- Add species branch in buildParamPanel() for searchable dropdown
- Rename CSS classes from pathway-specific to generic autocomplete-*
- Use $.Deferred()/.done() pattern for jQuery 1.x compatibility
- Namespace document mousedown handlers to prevent accumulation
Replace ES module export with window.Mustache assignment for jQuery 1.x
compatibility. Add query-info div to index.html for displaying query
metadata above the param panel.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant