Skip to content

feat(ui): persist admin table filters across HTMX pagination and part…#3204

Closed
crivetimihai wants to merge 2 commits intomainfrom
feat/persist-admin-table-filters
Closed

feat(ui): persist admin table filters across HTMX pagination and part…#3204
crivetimihai wants to merge 2 commits intomainfrom
feat/persist-admin-table-filters

Conversation

@crivetimihai
Copy link
Copy Markdown
Member

Note: This PR was re-created from #3017 due to repository maintenance. Your code and branch are intact. @omorros please verify everything looks good.

🔗 Related Issue

Closes #2992

📝 Summary

Persist admin table filters (search text, tag filters, "show inactive" toggles) across
HTMX pagination clicks and partial refreshes for all 6 admin tables.

Root cause: pagination_controls.html loadPage() built HTMX request URLs using
template-baked query_params (static Jinja2 values). When pagination controls were
rendered before a search, clicking page 2 dropped the active filters.

Changes:

  • pagination_controls.htmlloadPage() now reads live namespaced q/tags
    from the browser URL (source of truth written by updatePanelSearchStateInUrl),
    overriding stale template-baked values.
  • admin.js — Added htmx:afterSettle listener that rehydrates search inputs from
    URL state after content swaps. Added updateFilterStatus() for visible filtered row
    count text.
  • admin.html — Added aria-live="polite" status spans next to all 6 table search
    bars (servers, tools, resources, prompts, gateways, a2a-agents).

🏷️ Type of Change

  • Bug fix
  • Feature / Enhancement
  • Documentation
  • Refactor
  • Chore (deps, CI, tooling)
  • Other (describe below)

🧪 Verification

| Check | Command | Status
|
|---------------------------|--------------------|--------------------------------------
-----------------|
| JS tests (vitest) | npx vitest run | 583/584 pass (1 pre-existing locale
mismatch) |
| Unit tests | make test | 12,349/12,355 pass (6 pre-existing
stdio failures) |
| Lint suite | make lint | N/A — no Python files changed
|
| Coverage ≥ 80% | make coverage | N/A — no Python files changed
|


✅ Checklist

  • Code formatted (make black isort pre-commit)
  • Tests added/updated for changes
  • Documentation updated (if applicable)
  • No secrets or credentials committed

📓 Notes (optional)

Files changed (3):

File Lines What
mcpgateway/templates/pagination_controls.html +13/−1 Read live
{table}_q/{table}_tags from URL in loadPage()
mcpgateway/static/admin.js +65 updateFilterStatus() + htmx:afterSettle
rehydration listener
mcpgateway/templates/admin.html +6 aria-live status spans on all 6 table
panels

@crivetimihai crivetimihai added this to the Release 1.0.0-GA milestone Feb 24, 2026
@crivetimihai crivetimihai added enhancement New feature or request ui User Interface SHOULD P2: Important but not vital; high-value items that are not crucial for the immediate release labels Feb 24, 2026
@omorros
Copy link
Copy Markdown
Contributor

omorros commented Feb 24, 2026

Hi @crivetimihai thanks for reopening this! I've verified the code, everything looks good, intact and matching my original changes. Ready for review whenever you get the chance. Thanks!

…ial refresh Closes #2992

Signed-off-by: Oriol Morros Vilaseca <OM368@student.aru.ac.uk>
@marekdano marekdano force-pushed the feat/persist-admin-table-filters branch from 5963f21 to cfe1c11 Compare February 25, 2026 14:17
marekdano
marekdano previously approved these changes Feb 25, 2026
Copy link
Copy Markdown
Collaborator

@marekdano marekdano left a comment

Choose a reason for hiding this comment

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

Rebased and approving now, as it was already approved by me on #3100. The changes in this PR are the same.

LGTM 🚀

@crivetimihai crivetimihai added the merge-queue Rebased and ready to merge label Mar 3, 2026
@crivetimihai crivetimihai self-assigned this Mar 7, 2026
@crivetimihai crivetimihai added the release-fix Critical bugfix required for the release label Mar 7, 2026
@marekdano
Copy link
Copy Markdown
Collaborator

@omorros - can you please resolve conflicts?

@omorros
Copy link
Copy Markdown
Contributor

omorros commented Mar 12, 2026

Conflicts should be solved on the new pr now! @marekdano

@marekdano
Copy link
Copy Markdown
Collaborator

Closing this PR. A new PR has been created to cover this fix #3647

@marekdano marekdano closed this Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request merge-queue Rebased and ready to merge release-fix Critical bugfix required for the release SHOULD P2: Important but not vital; high-value items that are not crucial for the immediate release ui User Interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[EPIC][UI]: Persist admin table filters across HTMX pagination and partial refresh

3 participants