Repository navigation
Description
Background
While implementing live row updates for the Jobs Manage grid (#3833 — Plugin Queue Management: Pause, Resume, and Uninstall), the play/pause row actions were changed to fade out a processed/paused row, remove it from the table client-side, and fetch exactly one replacement row from what would have been the next page — no full table reload, no page jump, no loss of scroll position.
The shared do_action() helper in public/js/manage_tables.js (used by the Delete button on every Manage grid in the app) does the fade-out animation correctly, but afterward unconditionally calls refresh(), which re-queries the server and re-renders the entire table:
// public/js/manage_tables.js, do_action()
$(this).find("td").animate({backgroundColor: "green"}, 1200, "linear")
.end().animate({opacity: 0}, 1200, "linear", function () {
table().remove({
field: options.uniqueId,
values: selected_ids()
});
if (index == $(selector).length - 1) {
refresh(); // <-- full reload instead of backfilling just the removed rows
enable_actions();
}
});Jobs' Manage grid now has its own local removeRowsAndBackfill() (in app/Views/jobs/manage_grid.php) that does this correctly for its own actions, but Delete on that same grid still goes through the shared do_action() path and therefore still does a full-table refresh — inconsistent with Play/Pause on the same page.
What needs to change
In public/js/manage_tables.js, do_action()'s delete success handler should, after the fade/remove animation completes, fetch only as many replacement rows as were removed (using the same offset/limit/sort/order the table last queried with) and table().append() just those rows — instead of calling refresh().
Suggested reusable design
Generalize the pattern already proven in app/Views/jobs/manage_grid.php:
- Track the table's last-sent query params (the exact object passed to the
queryParamshook) in a module-level variable inside thetable_supportIIFE, so any caller can replay the samesearch/sort/order/limit/offset/custom filters without having to re-derive them frombsTable.options(which proved unreliable — reading those fields directly during polling produced intermittent unbounded/missinglimitparams and full-table-sized responses). - Add a
table_supportmethod, e.g.removeRowsAndBackfill(ids):- Snapshot currently-visible unique IDs (
table().getData({useCurrentPage: true})). - Remove the given
idsviatable().remove({field: options.uniqueId, values: ids}). - Issue one
$.get(options.resource + '/search', {...lastQueryParams, offset: lastOffset + lastLimit - ids.length, limit: ids.length})to fetch replacement rows. - Filter out any returned rows already visible (avoids duplicates if a backfill candidate was already on-page from a concurrent change) and
table().append()the rest. - Fall back to
refresh()if there's no table instance or no captured query params yet (first load, or a resource whosesearchendpoint doesn't support this).
- Snapshot currently-visible unique IDs (
- Update
do_action()'s delete handler to calltable_support.removeRowsAndBackfill(selected_ids())instead oftable().remove(...)+refresh(). - Keep
refresh()as the fallback for any action whose result can't be expressed as "these rows are gone, backfill N more" (e.g. restore, bulk edits that change sort order).
This would let every Manage grid in the app (not just Jobs) get the same "fade out, shift up" delete behavior for free, and gives other features (like Jobs' own poll-driven row removal) a shared, tested implementation to call into instead of re-implementing it per view.
Files likely involved
public/js/manage_tables.js(do_action(),table_supportIIFE)app/Views/jobs/manage_grid.php(can switch its localremoveRowsAndBackfill/removeRowAndBackfillover to the shared implementation once it exists, removing the duplication)
Activity
objecttothis commentedon Oct 23, 2026
Claude Issue Checker Agent (cc @objecttothis)
Investigated against current
master.Status: Still present (refactor not done).
In
public/js/manage_tables.js,do_action()'s success handler still does:— there is no
removeRowsAndBackfill()-style method, no tracked "last query params" module-level variable, and notable().append()backfill call anywhere in this file. A search forremoveRowsAndBackfillacross the repo only matchesapp/Views/jobs/manage_grid.php's local implementation, confirming it hasn't been generalized into the sharedtable_supportIIFE yet, anddo_action()'s delete handler still calls the sharedrefresh()(full table reload) exactly as described in the issue.