Skip to content

Module Manager: remember the tab filter + table state across the activate reload - #326

Closed
WebTigers wants to merge 1 commit into
mainfrom
fix/modules-remember-filter
Closed

WebTigers wants to merge 1 commit into
mainfrom
fix/modules-remember-filter

Conversation

@WebTigers

Copy link
Copy Markdown
Owner

What

The Module Manager's type-filter tab is now remembered across a page refresh (per-browser,
localStorage), and the modules DataTable gets stateSave so sort / page / length / search also
survive a reload.

Why

Two linked issues Beau hit:

  1. The tab filter was a transient JS var (activeType) reset to '' on every load — never persisted.
  2. Activate/deactivate does window.location.reload(), which wiped that client-only filter state (and
    the sort/page/search), always dumping you back on All.

The reload (the "why is it refreshing anyway?")

Kept, deliberately: activating a module changes several server-rendered regions — the row's badge +
its activate↔deactivate button, the type-filter counts, the admin sidebar nav / Settings tree a
newly-active module contributes, and the theme-default marker. The reload is the simple way to reflect
all of them. This change makes the reload non-destructive (you land exactly where you were) rather
than removing it. A full no-reload, in-place row+nav reconciliation is a larger follow-up (and the
TigerAgent app-shell is the real vehicle for that); flagged, not done here.

Notes

  • localStorage is the sanctioned spot for a per-viewer UI convenience like a remembered filter; every
    access is try/catch-guarded, and a stored type whose pill no longer exists falls back to All.
  • Edits are confined to the existing inline script in modules/system/views/scripts/modules/index.phtml.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ASauLLscjqdsNqBNsx2Typ

…vate reload

The type-filter tab was a transient JS var reset to '' on every load, and activate/deactivate does a
full window.location.reload() — so a reload (especially the one after a toggle) always dropped you back
on "All" and lost your sort/page/search. Now the chosen tab is persisted per-browser (localStorage,
try/catch-guarded) and restored on load (a stale type falls back to All), and the DataTable gets
stateSave so sort/page/length/search survive the reload too. The reload still runs (it reflects the
server-rendered row state, filter counts, sidebar nav and theme-default marker that activation changes)
— it's just no longer destructive to where you were.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ASauLLscjqdsNqBNsx2Typ
@WebTigers

Copy link
Copy Markdown
Owner Author

Superseded by the ajax DataTable refactor (#327): the grid now fetches already-filtered rows, so the tab FOUC is gone and tigerDataTable's stateSave covers sort/page/search natively.

@WebTigers WebTigers closed this Oct 2, 2026
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