Repository navigation
cards: re-sync bundled cards.js to the canonical shared controller - #413
TheWitness wants to merge 1 commit into
Conversation
plugin_mactrack #412 merged with an earlier cards.js, leaving it byte-divergent from the canonical CactiCards controller. Re-sync it to the converged baseline (md5 84876af1) that Cacti core (#8684 for 1.2.x, #8683 for develop) and every Card API plugin now carry: the refresh/resize supersede guard, async remove-commit, the duplicate-add guard and expand/collapse keyboard focus. mactrack uses only the card chrome (no chart primitives), so no card-widgets.css is bundled; css/cards.css is already byte-identical to canonical. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
b0085c4 to
30eaf88
Compare
|
There was a problem hiding this comment.
🟡 Changes recommended
The added controller hardening conflicts with the stated canonical-restoration scope, so the implementation or the documented baseline and target checksum must be aligned.
1 open issue
What changed in this PR
Updates MacTrack’s bundled CactiCards controller as part of aligning dashboard card behavior across Cacti and its plugins.
Changes:
- Adds shared request tokens to discard stale refresh and resize responses.
- Defers card removal and layout persistence until the adapter’s removal promise resolves.
- Moves keyboard focus to the counterpart control after expanding or collapsing a card.
| File | Description |
|---|---|
js/cards.js |
Hardens asynchronous card updates, removal handling, and toggle focus. |
Review effort: Balanced
| /* A per-card-id request generation shared by refresh and resize so a slow | ||
| * response cannot overwrite the markup of a newer request for the same card | ||
| * (for example a refresh that lands after a later grow). The most recently | ||
| * started request for an id wins; earlier in-flight responses are discarded. */ |
|
Superseded by #416 (merge commit This branch's |




Harmonizes the already-merged Card API conversion (#412) against the current canonical shared controller.
What
\js/cards.js\ is re-synced to the canonical \CactiCards\ controller (md5 \76df6bdb…) that Cacti core (1.2.x) and the other Card API plugins ship. #412 merged with an earlier copy that carried a local duplicate-add guard, leaving mactrack's bundle byte-divergent.
mactrack uses only the card chrome (no chart primitives), so no \card-widgets.css\ is bundled; \css/cards.css\ is already byte-identical to canonical.
Convergence note
The controller is converging from several directions:
This PR restores the current 1.2.x canonical (\76df6bdb). When the converged controller is finalized, every bundle - core, plugins, and this one - re-syncs to it together. Draft until then.