Repository navigation
intropage: adopt shared bundled card chrome for dashboard panels - #423
Merged
Merged
Conversation
…ad it First piece of the shared card-chrome port: bundle self-contained cards.css + cards.js (neutral cc* classes, theme-variable-driven, keyboard-accessible drag controller with an adapter seam) under includes/cards/, loaded on the dashboard page. No cross-plugin or core dependency. Panel markup/JS rewiring follows.
…eader replacement Hosts like intropage replace a card's header (where .ccDrag lives) on AJAX reload; delegating mousedown/touchstart/keydown from the persistent card element keeps drag/keyboard reorder working without rebinding. bindCard is now idempotent per card.
…Sortable Panels now use the bundled cc* card chrome: intropage_panel_header() emits the left drag handle + unified tools (shrink/grow, maximize, reload, remove), severity stays on the color_<alarm> class (reuses the per-theme palettes), and includes/intropage.js drives reorder + tools through CactiCards.init with an adapter mapping to the existing order/droppanel/details/height/reload endpoints. Sortable is replaced by the shared keyboard-accessible drag. Grow/shrink now resize the card instantly client-side before the persist+reload round-trip. Header markup is unit-tested via intropage_panel_header(); POT regenerated.
TheWitness
requested review from
bmfmancini and
xmacan
and
a balanced review from Copilot
October 10, 2026 13:31
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The shared container styling is not activated, and several interaction failure paths can leave incorrect state or trigger concurrent updates.
5 open findings
Add shared card chrome selectors to dashboard panel markup · New Restore click throttling to prevent concurrent panel updates · New Rollback optimistic resize state when persistence fails · New Use the request URL in the details failure handler · New Document dashboard chrome and interactions in the changelog · New
What changed in this PR
Introduces bundled shared card chrome for intropage dashboard panels while retaining existing backend endpoints and persistence.
Changes:
- Adds reusable card CSS/JavaScript with keyboard reordering and panel tools.
- Refactors panel headers and frontend adapters for resize, refresh, details, and removal.
- Updates unit tests and translation templates.
| File | Description |
|---|---|
display.php |
Loads the card controller. |
includes/cards/cards.css |
Defines shared card presentation. |
includes/cards/cards.js |
Implements card interactions. |
includes/functions.php |
Generates the new panel header. |
includes/intropage.js |
Connects card actions to existing endpoints. |
locales/po/cacti.pot |
Updates translatable strings. |
setup.php |
Loads card styles. |
tests/Unit/IntropagePanelHeaderTest.php |
Tests header markup and tools. |
tests/Unit/IntropagePanelReloadButtonTest.php |
Updates reload-tool assertions. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
bmfmancini
approved these changes
Oct 10, 2026
bmfmancini
previously approved these changes
Oct 10, 2026
…details error, test, changelog) Restore the 1s reload throttle on the card; roll back an optimistic grow/shrink on a failed persist (overlap-safe); fix a ReferenceError in the details error path (href -> url); correct the header test's single-quoted refresh assertion; add a CHANGELOG entry.
…ore block patch-coverage flagged the changed panel_data/ccCardBody print in the exit-bound intropage_reload_panel(); it is the same view glue as the header call, so it belongs inside the existing @codeCoverageIgnore.
bmfmancini
approved these changes
Oct 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Ports intropage's dashboard panels onto a shared, bundled card chrome so
the panel look/interaction matches the syslog Status cards, while keeping
intropage's own backend (panel registration,
update_funcdata, DB cache,poller refresh, dashboards) completely unchanged.
Hard requirement
Self-contained and dependency-free: the chrome is bundled inside this
plugin (
includes/cards/cards.css,includes/cards/cards.js). No cross-pluginreference and no new Cacti-version dependency — it works with intropage
installed alone, and preserves the 1.2.x floor. The same two files will be
copied (byte-identical) into plugin_syslog in a separate PR.
What changed
includes/cards/cards.{css,js}— neutralcc*classes,theme-variable driven, an idempotent
window.CactiCardscontroller withkeyboard-accessible drag and an adapter seam. Drag events are delegated
from the card so they survive intropage's header-replacing AJAX reloads.
intropage_panel_header()helper: aleft-hand drag handle, the title, and unified tools (shrink/grow height,
maximize, reload, remove). Severity stays on the existing
color_<alarm>class, so it keeps the per-theme palettes from Theme-appropriate panel titlebar severity palettes across all themes #421.includes/intropage.jsdrives reorder + tools throughCactiCards.init()with an adapter that maps to the existing endpoints(
order/droppanel/details/heightmore/heightless/reload).jQuery UI Sortable is removed in favour of the shared keyboard-accessible
drag.
client-side, then persists + reloads the body — removing the old
"nothing happens until a reload" two-step.
intropage_panel_reload_button()re-expressed as accTool; unit testsupdated and a new
IntropagePanelHeaderTestadded. POT regenerated.Please test (I can't verify UI headless)
persists across reload.
#switch_copytext) locks/unlocks dragging.Reviewers: @bmfmancini @xmacan