Skip to content

fix: toolbar fixes#177

Merged
dermatz merged 9 commits intomainfrom
fix/toolbar
Apr 24, 2026
Merged

fix: toolbar fixes#177
dermatz merged 9 commits intomainfrom
fix/toolbar

Conversation

@dermatz
Copy link
Copy Markdown
Member

@dermatz dermatz commented Apr 24, 2026

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:

  • Added aria-label and dynamic aria-expanded attributes 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:

  • Refactored the toolbar destroy logic to centralize cleanup in 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]
  • Improved audit group collapse/expand logic to update ARIA attributes and clarified state handling. (src/view/frontend/web/js/toolbar/audits.js)

Design and maintainability updates:

  • Replaced hardcoded color values with CSS variables for gradients and overlays, and removed unused or redundant color variables. (src/view/frontend/web/css/toolbar.css) [1] [2] [3]
  • Standardized spacing, sizing, and font values using pixel units for improved consistency across the toolbar UI. (src/view/frontend/web/css/toolbar.css) [1] [2] [3] [4] [5]

Minor fixes:

  • Removed unnecessary clearing of activeAudits in the audit deactivation method. (src/view/frontend/web/js/toolbar/audits.js)

Copilot AI review requested due to automatic review settings April 24, 2026 11:58
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 component destroy() lifecycle hook to clean up active audits on teardown.

Copilot AI review requested due to automatic review settings April 24, 2026 16:27
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Comment thread src/view/frontend/web/js/toolbar/ui.js
@dermatz dermatz changed the title fix: ensure audits are deactivated on toolbar destruction fix: toolbar fixes Apr 24, 2026
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 24, 2026 16:31
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

dermatz and others added 2 commits April 24, 2026 18:33
Co-authored-by: Copilot <copilot@github.com>
Copilot AI review requested due to automatic review settings April 24, 2026 16:38
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

Comment thread src/view/frontend/web/js/toolbar/ui.js
Comment thread src/view/frontend/web/js/toolbar/ui.js
Comment thread src/view/frontend/web/css/toolbar.css Outdated
dermatz and others added 2 commits April 24, 2026 18:49
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 24, 2026 16:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Comment on lines 24 to +39
@@ -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%);
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
@dermatz dermatz merged commit f4382b5 into main Apr 24, 2026
17 checks passed
@dermatz dermatz deleted the fix/toolbar branch April 24, 2026 16:56
@github-actions github-actions Bot mentioned this pull request Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants