HTMX Table documentation (and refactor)#1406
Merged
phycodurus merged 23 commits intodevfrom Feb 17, 2026
Merged
Conversation
The initial implementation in tom_targets was largely Model-indepented and common code has been moved to three classes in tom_common/htmx_table.py. The Target table implementation has been refactored to extend those common classes for Targets.
This was
linked to
issues
Feb 10, 2026
Change summary:
- tom_targets/templates/tom_targets/partials/aladin_skymap.html -- Refactored target catalog management to use a single window.aladinTargetCatalog and added a global window.updateAladinTargets() function that replaces target markers without rebuilding the viewer.
- tom_targets/templates/tom_targets/partials/aladin_skymap_targets_oob.html (new) -- Lightweight Out-of-Band template that sends a <script> calling updateAladinTargets() with new target data as JSON.
- tom_targets/templatetags/targets_extras.py -- Added aladin_skymap_targets_oob template tag that serializes targets to JSON without computing Moon/Sun positions.
- tom_targets/templates/tom_targets/partials/target_table_partial.html -- Changed from including aladin_skymap_htmx.html (full rebuild) to using {% aladin_skymap_targets_oob %} (data-only update). Also fixed duplicate header lines.
- tom_targets/templates/tom_targets/target_list.html -- Simplified initial skymap include to call {% aladin_skymap %} directly. Added <div id="aladin-targets-data"> placeholder for OOB swaps.
- tom_targets/templates/tom_targets/partials/aladin_skymap_htmx.html (deleted) -- No longer needed.
Fingel
approved these changes
Feb 12, 2026
Contributor
Fingel
left a comment
There was a problem hiding this comment.
This looks good, thoughtful and precise. Nice work.
Just two thoughts, but they are mostly subjective.
- If you haven't checked out django-template-partials, you might want to give it a look. I vastly prefer using it as an alternative to creating small template partial files like "target_table_partial.html". It was recently merged into Django 6.0. Being able to define the partials inline in the template they will be swapped into makes the templates so much easier to read and follow, in my opinion.
- I still think the way the skymap works is silly. Whenever I see a graph above data like this, I expect it to show the data that matches my current filters not just the items on the current page. Think about a cone search, for example. I implemented this in #1190 but it was sucked into a black hole. I'm almost certain the only reason it works the way it does currently is because it was the easiest way to implement it at the time (taking the data straight from the ListView context, which is jank.)
Contributor
|
@Fingel the original motivation was to allow the page to load if people had too many targets. this was several sky charts ago though. Happy to do it by filter with some cap. |
Update target grouping table
jchate6
approved these changes
Feb 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This branch was previously merged to
devwith the initial implementation of the HTMX target table. Development continued in this branch after that merge:tom_common/htmx_table.pyHere's the Copilot generated summary:
This pull request introduces a reusable HTMX-enabled table framework for interactive filtering, sorting, and pagination, and refactors the Target List page to use these new abstractions. It also improves the integration between HTMX tables and companion widgets, such as the Aladin skymap, by implementing an out-of-band (OOB) data update pattern. The changes are grouped into two main themes: HTMX table framework introduction and Aladin skymap integration improvements.
HTMX Table Framework Introduction
tom_common/htmx_table.pymodule providingHTMXTable,HTMXTableFilterSet, andHTMXTableViewMixinclasses for reusable HTMX-driven tables, including built-in support for interactive sorting, filtering, pagination, and row selection, as well as customizable partial templates.TargetTableandTargetFilterSetintom_targets/tables.pyandtom_targets/filters.pyto inherit from the new HTMX table classes, simplifying their implementation and enabling easier customization. [1] [2]Aladin Skymap Integration Improvements
aladin_skymap_htmx.htmlpartial and updated all relevant templates to use the new OOB update approach.These changes establish a robust foundation for interactive tables and seamless widget updates, making future customizations and enhancements much easier.