Skip to content

Bring the bundled Card API controller up to the converged baseline - #416

Merged
TheWitness merged 2 commits into
developfrom
fix/mactrack-cards-sync-baseline
Nov 11, 2026
Merged

TheWitness merged 2 commits into
developfrom
fix/mactrack-cards-sync-baseline

Conversation

@TheWitness

Copy link
Copy Markdown
Member

Bring the bundled Card API controller up to the converged baseline

mactrack adopted the shared card chrome early (#412), before the Card API controller finished converging. Its bundled js/cards.js is therefore an older lineage that is missing the hardening the other plugins and core now carry:

  • a per-card request-generation guard so a slow refresh/resize response cannot overwrite a newer one for the same card;
  • a confirmed, id-resolved card removal (await the host, then drop + persist) instead of an optimistic remove;
  • keyboard refocus onto the revealed expand/collapse button after a toggle;
  • and the new fix that preserves the live expand/collapse state at swap time, so a refresh landing mid-toggle is not reverted.

This replaces js/cards.js with the canonical controller (md5 20694b4c), byte-identical with core (#8683 / #8700) and the other plugin PRs. css/cards.css already matched the baseline; the controller API is a backward-compatible superset, so mactrack's adapter is unaffected. JS only — no PHP changed.

Replace js/cards.js with the canonical controller (md5 20694b4c), byte-identical
with core and the other plugins. mactrack adopted the chrome early (#412), so its
bundled controller was an older lineage missing the request-generation guard,
confirmed card removal, keyboard refocus and the new swap-time expand/collapse
preservation. css/cards.css already matched; the controller API is a backward-
compatible superset so the mactrack adapter is unaffected.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 11, 2026 02:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are reported for the Card API controller changes.

No open issues 🎉

What changed in this PR

Updates MacTrack’s bundled Card API controller to the converged shared baseline, improving asynchronous card operations and keyboard navigation without changing PHP or the dashboard adapter.

Changes:

  • Discards superseded refresh/resize responses and preserves the live expand/collapse state when replacing cards.
  • Waits for host confirmation before removing a card and saving the updated layout.
  • Moves keyboard focus to the visible counterpart after expanding or collapsing a card.
File Description
js/​cards.js Adds request guards, confirmed removal, live expansion-state preservation, and keyboard refocusing.

Review effort: Balanced

Corrected shared controller (review on core #8700): replaceCard() carries the
live expand/collapse state onto refreshed markup only when the user toggled
during the request and the fresh card is still expandable; host markup stays
authoritative otherwise. Byte-identical with core and the other plugins.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@sonarqubecloud

Copy link
Copy Markdown

@TheWitness
TheWitness merged commit 98ed786 into develop Nov 11, 2026
4 of 9 checks passed
@TheWitness
TheWitness deleted the fix/mactrack-cards-sync-baseline branch November 11, 2026 16:54
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.

3 participants