You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(spa): skeleton only the table on a list filter change (#508) (#509)
Changing a list_filter (or page / search / ordering) replaced the whole
changelist with a full-page skeleton until the new rows arrived — the
title, search box, filter chips and Customize button all vanished,
making each filter interaction feel like a hard reload. Django's
changelist only re-renders the results table.
useList is backed by useSwrCache, whose cache key encodes the filters.
A filter change → new key → the hook reset data to the new key's cache
(null for an unseen combo), and ListPage shows its full-page skeleton
whenever `loading && !data`, so the page blanked.
That key-reset is right for a detail view (object→object must not flash
the previous record, #416) but wrong for a list, where the chrome and
columns are filter-independent. Add a `keepPreviousData` option to
useSwrCache: on a key change it keeps the previous value on screen and
shows a foreground load instead of blanking (adopting the new key's
cache immediately when it exists). useList opts in; useDetail keeps the
reset. ListPage is remounted per model so the retained-data behaviour
is scoped to same-model filter/page changes and a model switch still
resets cleanly.
Result: the header stays put and only the Table shows skeleton rows
(its built-in loading state) on a filter change.
Co-authored-by: Martin Castro Laminrs <mcastro@laminr.ai>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments