Conversation
There was a problem hiding this comment.
Pull request overview
This PR ensures that any currently active toolbar audits are properly deactivated when the MageForge toolbar component is destroyed, preventing audits from continuing to run after the UI is removed.
Changes:
- Invoke
deactivateAllAudits()during the Alpine componentdestroy()lifecycle hook to clean up active audits on teardown.
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
| @@ -34,12 +33,10 @@ | |||
| --mageforge-shadow-lg: rgba(0, 0, 0, 0.4); | |||
| --mageforge-burger-bg: rgba(15, 23, 42, 0.85); | |||
| --mageforge-burger-bg-hover: rgba(30, 41, 59, 0.95); | |||
| --mageforge-toolbar-burger-active-bg: #10b981; | |||
| --mageforge-toolbar-burger-active-border: #10b981; | |||
| --mageforge-toggle-bg-off: rgba(255, 255, 255, 0.15); | |||
| --mageforge-toggle-bg-off-light: rgba(0, 0, 0, 0.15); | |||
| --gradient-brand: linear-gradient(43deg, #3b82f6 0%, #C850C0 50%, #edb04d 100%); | |||
| --gradient-brand-hover: linear-gradient(43deg, #3b82f6 0%, #C850C0 70%, #edb04d 100%); | |||
| --gradient-brand: linear-gradient(43deg, var(--mageforge-color-blue) 0%, var(--mageforge-color-pink) 50%, var(--mageforge-color-amber) 100%); | |||
| --gradient-brand-hover: linear-gradient(43deg, var(--mageforge-color-blue) 0%, var(--mageforge-color-pink) 70%, var(--mageforge-color-amber) 100%); | |||
There was a problem hiding this comment.
toolbar.css now defines --mageforge-color-amber/--mageforge-color-pink in :root and uses them in --gradient-brand. These custom properties overlap with the Inspector’s global variables; since inspector.phtml loads toolbar.css before inspector.css, the Inspector stylesheet will override shared :root vars (e.g. --mageforge-color-amber), making the toolbar gradient dependent on CSS load order and potentially not using the intended toolbar colors. Consider scoping toolbar-only variables under .mageforge-toolbar (or prefixing them like --mageforge-toolbar-*) to avoid cross-feature variable collisions.
This pull request makes a series of improvements to the MageForge toolbar's CSS and JavaScript, focusing on accessibility, code maintainability, and visual consistency. The main changes include enhanced ARIA attributes for accessibility, refactoring and cleanup of toolbar and audit logic, and updates to color and sizing variables for better maintainability and design consistency.
Accessibility improvements:
aria-labeland dynamicaria-expandedattributes to the toolbar burger button and menu group headers to improve screen reader support and accessibility. (src/view/frontend/web/js/toolbar/ui.js) [1] [2] [3]Code refactoring and cleanup:
destroyToolbar, ensuring all references are properly nulled and audits deactivated. (src/view/frontend/web/js/toolbar.js,src/view/frontend/web/js/toolbar/ui.js) [1] [2]src/view/frontend/web/js/toolbar/audits.js)Design and maintainability updates:
src/view/frontend/web/css/toolbar.css) [1] [2] [3]src/view/frontend/web/css/toolbar.css) [1] [2] [3] [4] [5]Minor fixes:
activeAuditsin the audit deactivation method. (src/view/frontend/web/js/toolbar/audits.js)