Skip to content

Conversation

@Ulthran
Copy link
Contributor

@Ulthran Ulthran commented Jan 31, 2026

Motivation

  • Replace the existing phylotree-based species view with Archaeopteryx.js to provide a richer, full-featured phylogenetic viewer that can parse Newick/PhyloXML and support Archaeopteryx UI features.
  • Ensure the viewer loads all necessary browser-side dependencies from CDNs with SRI and pinned versions so the template does not vendor library code.

Description

  • Updated app/templates/show_species.html to remove phylotree and instead load archaeopteryx@1.8.1 plus its runtime dependencies via UNPKG (jquery 3.7.1, jquery-ui 1.13.3, d3 3.5.17, underscore 1.13.7, phyloxml 0.9.16) and included computed sha384 SRIs for each script and the jquery-ui stylesheet.
  • Replaced the client-side rendering code to parse the New Hampshire (Newick) string with archaeopteryx.parseNewHampshire and launch Archaeopteryx with archaeopteryx.launch, passing options/settings that enable dynamic sizing and zoom-to-fit behavior.
  • Added hidden radio controls and small jQuery UI initialization to satisfy Archaeopteryx's UI expectations (display type toggle inputs) so the library can initialize without errors.
  • Minor formatting change in app/nl_query.py (lambda wrapped) as part of black reformatting.

Testing

  • Ran formatting with black . which reformatted a few files and completed successfully.
  • Ran the test suite with pytest tests/ and all tests passed: 9 passed.
  • Launched a development server pointing MARC_TREE_FP at a demo treefile and captured a Playwright screenshot of /species/Demo%20Species, confirming an SVG tree rendered (screenshot artifact produced and verified to contain tree elements).

Codex Task

Copilot AI review requested due to automatic review settings January 31, 2026 19:25
Copy link
Contributor

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 migrates the species tree visualization from phylotree.js to Archaeopteryx.js, a more feature-rich phylogenetic viewer. The change replaces the existing tree rendering implementation with one that uses Archaeopteryx.js and its required dependencies, all loaded from CDNs with Subresource Integrity (SRI) hashes for security.

Changes:

  • Replaced phylotree.js with Archaeopteryx.js 1.8.1 and its dependencies (jQuery, jQuery UI, D3 v3.5.17, underscore, phyloxml)
  • Updated tree initialization code to use Archaeopteryx's parsing and launch APIs
  • Applied black formatting to nl_query.py (lambda expression wrapped in parentheses)

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 10 comments.

File Description
app/templates/show_species.html Replaced phylotree-based tree viewer with Archaeopteryx.js implementation, including dependency loading and initialization code
app/nl_query.py Code formatting change (black) - wrapped lambda expression in parentheses

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Ulthran Ulthran merged commit e24e7d4 into main Jan 31, 2026
4 of 5 checks passed
@Ulthran Ulthran deleted the codex/switch-show_species-template-to-archaeopteryx.js branch January 31, 2026 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant