Skip to content

Release v2.6.0

Choose a tag to compare

@github-actions github-actions released this 13 Oct 14:45
· 74 commits to main since this release

Release 2.6.0

Changelog

Added

  • Nested menu collapse without Bootstrap JS (js/menu-collapse.js, opt-in; spec 003-menu-collapse-without-bootstrap): a dependency-free script (≈1.6 kB gzip) that makes the menu's data-bs-toggle="collapse" markup work on hosts that do not load Bootstrap's JavaScript. One delegated click listener per [data-dashboard-menu-collapse] root (CSP-safe: external script, no inline handlers); aria-expanded / aria-controls kept in sync, closed panels inert + aria-hidden, <li> is-expanded / is-collapsed; open / closed state remembered per menu code in localStorage; ancestors of the current item always open; connects on DOMContentLoaded / turbo:load / turbo:frame-load; event dashboard-menu:collapse-toggle; window.NowoDashboardMenuCollapse.init(). ES module (src/Resources/assets/src/menu-collapse.ts) for bundler hosts.
  • No double toggle next to Bootstrap JS: mode auto (default) never toggles while window.bootstrap.Collapse / jQuery.fn.collapse is loaded and only mirrors show|shown|hidden.bs.collapse into ARIA / inert / storage; mode always takes the toggles over (removes their data-bs-toggle).
  • Config menu_collapse: enabled (default false), mode (auto | always), storage_key (default nowo.dashboardMenu.navCollapse, "" = no persistence). Parameter %nowo_dashboard_menu.menu_collapse%, Twig global nowo_dashboard_menu_collapse.
  • menu.html.twig: when enabled, the menu root gets data-dashboard-menu-collapse="<code>", -mode, -storage-key, -branch-class (from class_branch_expanded); include variables menuCollapse, menuCollapseMode, menuCollapseStorageKey override the config.
  • Partial @NowoDashboardMenuBundle/_menu_collapse_script.html.twig (external defer script with the request csp_nonce).
  • Vite entry menu-collapse (pnpm run build / build:menu-collapse); Vitest suite at 100% coverage.

Changed

  • menu.html.twig no longer calls dashboard_menu_config() when menuConfig is passed (Twig |default() evaluated its argument eagerly). Output unchanged.
  • Dev: Rector LocallyCalledStaticMethodToNonStaticRector applied to TranslationKeyParityTest (behaviour-neutral).

Dependencies

  • Development lock: nowo-tech/form-kit-bundle 2.12.0, nowo-tech/ui-kit-bundle 1.14.0, doctrine/persistence 4.2.1, nowo-tech/phpstan-frankenphp 1.3.0. Demo config/reference.php regenerated (menu_collapse).

Default output is unchanged: without menu_collapse.enabled / menuCollapse no attribute is emitted and nothing has to be included.

Full Changelog: v2.5.1...v2.6.0