Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
9b22d8f
feat: add MageForge Toolbar with basic audits
dermatz Apr 11, 2026
2ad540d
feat: add new audits for images without dimensions, lazy load, and in…
dermatz Apr 11, 2026
f4f53c7
style: update SVG icons for various audits in MageForge Toolbar
dermatz Apr 11, 2026
afa647c
feat: add toggle all functionality and enable inspector by default
dermatz Apr 11, 2026
cc13366
feat: enhance image audits to exclude hidden elements
dermatz Apr 12, 2026
0a1340c
feat: add inspector button to toolbar and remove unused inspector code
dermatz Apr 12, 2026
a1b75da
feat: add credit section to toolbar menu with link to MageForge
dermatz Apr 12, 2026
1d74367
feat: add toggle background colors and update font size in toolbar
dermatz Apr 12, 2026
fdee826
fix: improve note formatting for disabled inspector message
dermatz Apr 12, 2026
c0ff71e
fix: handle outside click event for toolbar menu closure
dermatz Apr 12, 2026
ef97edb
feat: enhance inspector functionality with event handlers and caching
dermatz Apr 12, 2026
4e19646
refactor: remove inspector button creation from toolbar UI
dermatz Apr 12, 2026
53d3761
feat: update audit run methods to accept active state parameter
dermatz Apr 12, 2026
c0fbd64
feat: implement collapsible menu groups in toolbar UI
dermatz Apr 12, 2026
55f4597
feat: update toolbar burger label to include 'MageForge'
dermatz Apr 12, 2026
757ce34
[CodeFactor] Apply fixes to commit 55f4597
code-factor Apr 12, 2026
aa3fe38
feat: add option to show/hide button labels in toolbar settings
dermatz Apr 12, 2026
0949924
style: update description for images without alt attributes
dermatz Apr 12, 2026
b5380ed
fix: update color parsing to use a sentinel value for transparency check
dermatz Apr 12, 2026
b8d8ab9
fix: improve aria-labelledby check for inputs without labels
dermatz Apr 12, 2026
f6f4131
fix: ensure overlay re-renders for live DOM changes on resize/scroll
dermatz Apr 12, 2026
676eaa5
fix: re-initialize skipped mageforgeToolbar elements on Alpine init
dermatz Apr 12, 2026
71d8fcf
refactor: remove toggle inspector event handler from MageForge Inspector
dermatz Apr 12, 2026
2bab38d
feat: persist collapsed groups state in localStorage
dermatz Apr 12, 2026
36fb32e
refactor: simplify inspector button attachment logic in toolbar
dermatz Apr 12, 2026
5c3adb6
fix: handle potential errors when retrieving collapsed groups from lo…
dermatz Apr 12, 2026
f4375cc
feat: add aria-pressed attribute for menu item accessibility
dermatz Apr 12, 2026
03ee45a
fix: correct opacity check for image visibility in audit
dermatz Apr 12, 2026
0a28d34
docs: add third-party library credits to README
dermatz Apr 12, 2026
6316a09
fix: handle potential null value for aria-labelledby text content
dermatz Apr 12, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -685,3 +685,12 @@ may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.


-------------------------------------------------------------------------------
Third-Party Notices
-------------------------------------------------------------------------------

This project includes icons from Tabler Icons (https://tabler.io/icons).
Copyright (c) 2020-2024 Paweł Kuna (codecalm)
Licensed under the MIT License (https://github.com/tabler/tabler-icons/blob/main/LICENSE)
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,14 @@ bin/magento mageforge:theme:inspector disable
- **License**: [LICENSE](LICENSE)
- **Changelog**: [CHANGELOG](CHANGELOG.md)

## Credits

MageForge uses the following third-party libraries:

| Library | Author | License |
| ------- | ------ | ------- |
| [Tabler Icons](https://tabler.io/icons) | codecalm | [MIT](https://github.com/tabler/tabler-icons/blob/main/LICENSE) |

---

Thank you for using MageForge!
33 changes: 33 additions & 0 deletions src/Block/Inspector.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
class Inspector extends Template
{
private const XML_PATH_INSPECTOR_ENABLED = 'dev/mageforge_inspector/enabled';
private const XML_PATH_SHOW_BUTTON_LABELS = 'mageforge/inspector/show_button_labels';

/**
* @param Context $context
Expand Down Expand Up @@ -72,6 +73,16 @@ public function getCssUrl(): string
return $this->getViewFileUrl('OpenForgeProject_MageForge::css/inspector.css');
}

/**
* Get Toolbar CSS file URL
*
* @return string
*/
public function getToolbarCssUrl(): string
{
return $this->getViewFileUrl('OpenForgeProject_MageForge::css/toolbar.css');
}

/**
* Get JS file URL
*
Expand All @@ -82,6 +93,28 @@ public function getJsUrl(): string
return $this->getViewFileUrl('OpenForgeProject_MageForge::js/inspector.js');
}

/**
* Get Toolbar JS file URL
*
* @return string
*/
public function getToolbarJsUrl(): string
{
return $this->getViewFileUrl('OpenForgeProject_MageForge::js/toolbar.js');
}

/**
* Whether button labels should be displayed in the toolbar
*
* @return bool
*/
public function getShowButtonLabels(): bool
{
$value = $this->scopeConfig->getValue(self::XML_PATH_SHOW_BUTTON_LABELS);
// Default to true when not explicitly set to '0'
return $value !== '0';
Comment on lines +113 to +115
Copy link

Copilot AI Apr 12, 2026

Choose a reason for hiding this comment

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

getShowButtonLabels() reads raw config via getValue() and compares strictly to the string '0'. Since getValue() returns mixed, non-string values (e.g. int 0/1) would make this behave incorrectly. Consider using isSetFlag() for this Yes/No config path (and rely on config.xml for the default).

Suggested change
$value = $this->scopeConfig->getValue(self::XML_PATH_SHOW_BUTTON_LABELS);
// Default to true when not explicitly set to '0'
return $value !== '0';
return $this->scopeConfig->isSetFlag(
self::XML_PATH_SHOW_BUTTON_LABELS
);

Copilot uses AI. Check for mistakes.
}

/**
* Get configured theme
*
Expand Down
4 changes: 3 additions & 1 deletion src/Console/Command/Dev/InspectorCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,9 @@ private function showStatus(): int
]);
} elseif (!$isEnabled) {
$this->io->newLine();
$this->io->note('Run "bin/magento mageforge:theme:inspector enable" to activate the inspector.');
$this->io->note(
'Inspector is disabled. Run "bin/magento mageforge:theme:inspector enable" to activate it.'
);
} else {
$this->io->newLine();
$this->io->writeln('<info>✓</info> Inspector is active and ready to use!');
Expand Down
13 changes: 10 additions & 3 deletions src/etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,29 @@
<label>MageForge</label>
</tab>
<section id="mageforge_inspector" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Inspector</label>
<label>Toolbar</label>
<tab>mageforge</tab>
<resource>OpenForgeProject_MageForge::config_inspector</resource>
<group id="general" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
<label>General Settings</label>
<label>General Toolbar Settings</label>
<field id="enabled" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Enabled</label>
<label>Show Toolbar</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<config_path>dev/mageforge_inspector/enabled</config_path>
<comment>Enable or disable the MageForge Toolbar. Default: Yes.</comment>
</field>
<field id="theme" translate="label" type="select" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Theme</label>
<source_model>OpenForgeProject\MageForge\Model\Config\Source\InspectorTheme</source_model>
<config_path>mageforge/inspector/theme</config_path>
<comment>Choose between Dark, Light, or Auto (System Preference) theme.</comment>
</field>
<field id="show_button_labels" translate="label" type="select" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Show Button Labels</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<config_path>mageforge/inspector/show_button_labels</config_path>
<comment>Show text labels on the Toolbar and Inspector buttons. Default: Yes.</comment>
</field>
</group>
</section>
</system>
Expand Down
3 changes: 2 additions & 1 deletion src/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
<default>
<dev>
<mageforge_inspector>
<enabled>0</enabled>
<enabled>1</enabled>
</mageforge_inspector>
</dev>
<mageforge>
<inspector>
<theme>dark</theme>
<show_button_labels>1</show_button_labels>
</inspector>
</mageforge>
</default>
Expand Down
8 changes: 8 additions & 0 deletions src/view/frontend/templates/inspector.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
*/
?>
<!-- MageForge Inspector Assets -->
<link rel="stylesheet" type="text/css" href="<?= $escaper->escapeUrl($block->getToolbarCssUrl()) ?>" />
<link rel="stylesheet" type="text/css" href="<?= $escaper->escapeUrl($block->getCssUrl()) ?>" />

<!-- Alpine.js Bootstrap (load only if not already present) -->
Expand Down Expand Up @@ -60,8 +61,15 @@ JS;
?>
<?= /* @noEscape */ $secureRenderer->renderTag('script', [], $alpineBootstrap, false) ?>

<script type="module" src="<?= $escaper->escapeUrl($block->getToolbarJsUrl()) ?>"></script>
<script type="module" src="<?= $escaper->escapeUrl($block->getJsUrl()) ?>"></script>

<!-- MageForge Toolbar Component -->
<div class="mageforge-toolbar-root"
x-data="mageforgeToolbar"
data-theme="<?= $escaper->escapeHtmlAttr($block->getTheme()) ?>"
data-show-labels="<?= $block->getShowButtonLabels() ? '1' : '0' ?>"></div>

<!-- MageForge Inspector Component Wrapper -->
<div class="mageforge-inspector"
x-data="mageforgeInspector"
Expand Down
60 changes: 60 additions & 0 deletions src/view/frontend/web/css/audits/tab-order.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/**
* MageForge Toolbar Audit – Tab Order
*
* Injected on-demand by the tab-order audit.
* Relies on CSS custom properties defined in toolbar.css :root.
*/

.mageforge-tab-order-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
z-index: 9999997;
overflow: visible;
}

.mageforge-tab-order-svg {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
overflow: visible;
}

.mageforge-tab-order-line {
stroke: var(--mageforge-color-blue);
stroke-width: 1.5;
stroke-opacity: 0.5;
stroke-dasharray: 4 3;
fill: none;
}

.mageforge-tab-order-line--negative {
stroke: var(--mageforge-color-red);
}

.mageforge-tab-order-badge {
position: absolute;
width: 20px;
height: 20px;
border-radius: 50%;
background: var(--mageforge-color-blue);
color: var(--mageforge-color-white);
font-family: var(--mageforge-font-family);
font-size: 10px;
font-weight: 700;
line-height: 1;
display: flex;
align-items: center;
justify-content: center;
transform: translate(-50%, -50%);
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.mageforge-tab-order-badge--negative {
background: var(--mageforge-color-red);
}
20 changes: 3 additions & 17 deletions src/view/frontend/web/css/inspector.css
Original file line number Diff line number Diff line change
Expand Up @@ -77,30 +77,25 @@
}

/* ============================================================================
Floating Button
Inspector Float Button
========================================================================== */

.mageforge-inspector-float-button {
position: fixed;
bottom: 20px;
left: 20px;
height: 36px;
padding: 0 14px;
background: linear-gradient(135deg, var(--mageforge-color-blue) 0%, var(--mageforge-color-blue-dark) 100%);
color: white;
border: none;
border-radius: 10px;
border-radius: 5px;
cursor: pointer;
z-index: 9999998;
display: flex;
align-items: center;
gap: 8px;
font-family: var(--mageforge-font-family);
font-size: 14px;
font-size: 0.75rem;
font-weight: 600;
box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4), 0 2px 4px rgba(0, 0, 0, 0.2);
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
pointer-events: auto;
backdrop-filter: blur(8px);
letter-spacing: 0.025em;
}
Expand All @@ -114,7 +109,6 @@
transform: translateY(0);
}

/* Active state (inspector open) */
.mageforge-inspector-float-button.mageforge-active {
background: linear-gradient(135deg, var(--mageforge-color-green) 0%, var(--mageforge-color-green-dark) 100%);
box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2), 0 8px 20px rgba(16, 185, 129, 0.5);
Expand Down Expand Up @@ -292,14 +286,6 @@
max-width: calc(100vw - 40px);
font-size: 10px;
}

.mageforge-inspector-float-button {
bottom: 10px;
left: 10px;
font-size: 11px;
height: 32px;
padding: 0 12px;
}
}

@media (max-width: 480px) {
Expand Down
Loading
Loading