You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(inspector): modernize toolbar and inspector UX and improve performance metrics - #304
Unifies and modernizes the MageForge Toolbar and Frontend Inspector into a single cohesive, Linear/Vercel-inspired in-browser DevTools Dock & Panel (including a live Main-Thread & Vitals Profiler) while keeping the existing Alpine.js + ES Module + Magento View architecture intact.
Previously, Toolbar and Inspector operated as two visually separate overlays with duplicated CSS variables, mixed emojis/SVGs, light-DOM style bleeding from shop themes, and a large hover tooltip that jumped across page content. Both now share a single design system and strict storefront CSS isolation so MageForge looks identical across Luma (62.5% root font-size), Blank, Hyvä (@tailwindcss/forms / preflight), and custom storefronts.
Key UX & Architecture Improvements
Unified DevTools Dock Capsule: Single obsidian-glass floating pill combining the MageForge panel trigger, Element Inspector picker, Page Block count shortcut, live Health Score chip, and a 1-click Clear Highlights action when audits or selections are active.
Floating Popover & Docked Right Drawer: Toggle seamlessly between an anchored popover and a full-height right-side DevTools sidebar (data-panel-mode="docked") so storefront content stays unobstructed during block inspection and audit review.
Non-Intrusive Hover-HUD + Unified Inspector Tab:
Picking elements on the storefront displays a compact, pointer-transparent Hover-HUD pill (<tag.class>, dimensions, render time, override/cache pills, template path, module/alias) with viewport-fixed highlights.
Clicking an element locks the selection and opens its full telemetry (Structure + Open in IDE + 1-Click Override, Accessibility, Cache, Web Vitals) inside the unified Inspector tab, with crisp SVG icons throughout.
Interactive Block/DOM Breadcrumbs & Keyboard Stepping: Walk parent/child Magento blocks and DOM nodes via clickable breadcrumb chips (including Magento layout parent alias resolution) or ArrowUp / ArrowDown keys.
Page Block & Template Explorer (Blocks Tab): Searchable, indented tree of all rendered [data-mageforge-id] blocks on the current page with instant filter pills (All, Overrides, No Cache, Slow >50ms), live hover preview highlighting, and 1-click selection.
Live Main-Thread & Core Web Vitals Profiler (Profiler Tab + Main-Thread Blockers Audit):
Native PerformanceObserver telemetry for Total Blocking Time (TBT), Long Tasks (> 50 ms), and Chromium Long Animation Frames (long-animation-frame / LoAF) with culprit script URL, function name, invoker, and forced style/layout reflow duration (automatically excluding MageForge internal assets and audit runs).
Real Render-Blocking Resources via ResourceTiming.renderBlockingStatus === "blocking" (CSS/JS/Fonts with size & duration).
Official INP / Slow User Interactions (interactionId > 0) with 3-phase breakdown (Input Delay · Processing · Presentation) and 1-click Inspect handoff to the target Magento template.
Audit-to-Inspector Handoff & Category Filtering: Every audit category now includes a live search filter + Issues only toggle, and every finding row features a 1-click Inspect button that jumps straight to the .phtml template and Magento block responsible for that DOM node.
Unified Settings Hub (Settings Tab): Centralizes browser-persisted preferences for panel layout (Floating / Right Drawer), dock corner, dock labels, default target override theme, IDE preset & Docker/DDEV host-path mappings, and keyboard shortcuts.
Strict Shop-CSS Isolation: Scoped resets with pixel-based sizing (px instead of rem) and semantic --mageforge-* custom properties across Dark, Light, and Auto themes.
Consolidate the separate Toolbar and Frontend Inspector UIs into a single CSS-isolated DevTools dock and panel that renders identically across Luma, Hyva, and custom Magento themes.
- Add unified floating dock capsule with quick triggers for DevTools, Element Inspector, Page Block Explorer, Health Score, and 1-click highlight reset
- Support switching between a floating popover and a docked right-side drawer in Dark, Light, and Auto colour schemes
- Replace jumping multi-tab hover badges with a compact non-intrusive Hover-HUD pill, viewport-fixed highlights, interactive layout/DOM breadcrumbs, and keyboard parent/child stepping
- Add searchable Page Block & Template Explorer and 1-click Inspect handoff from audit findings straight to the underlying template
- Centralize layout, dock, target theme, and IDE host-path settings while strictly isolating typography, buttons, and form controls from storefront stylesheets
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Active issues can select the wrong element, overwrite live settings or unsaved edits, and leave keyboard focus outside the floating panel when it opens.
Unifies MageForge’s toolbar and frontend inspector into a shared DevTools dock and panel while retaining the existing Alpine.js and ES module architecture.
Changes:
Adds floating and docked layouts, a searchable block explorer, and unified preferences.
Connects audit findings to element inspection, with compact hover details and parent/child navigation.
Add the official MageForge website link alongside GitHub and Feedback in the DevTools footer and remove the redundant Pick Element button from the Page Overview health card.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Unresolved regressions can select the wrong element, discard settings changes, and make floating panels inaccessible to keyboard users or off-screen on mobile.
On viewports at or below 680 px, a floating panel in either top corner retains top: calc(100% + 10px) from _positions.css: that selector includes :not([data-panel-mode="docked"]) and has higher specificity than this mobile override. Since the mobile rule makes the panel fixed, that percentage is now relative to the viewport, placing the panel below the screen. Match the floating selector's specificity so top: 56px actually wins.
Strip thousands separators before parsing render times
The server serialises render times with number_format(..., 2) in BlockCacheCollector::formatMetricsForJson(), so a 1,234.56 ms render arrives as "1,234.56". parseFloat() reads that as 1, displaying 1.0 ms and excluding this very slow block from the Slow filter. Remove thousands separators before parsing.
Add a live Browser Performance & Main-Thread Profiler tab under Workspace plus a Main-Thread Blockers audit check in the Performance category.
- Collect Long Tasks (>50 ms), Total Blocking Time (TBT), and Chromium Long Animation Frames (LoAF) script/function/invoker and forced-reflow attribution while filtering out MageForge internal scripts and batch audit scans
- Track official Web Vitals INP discrete interactions (interactionId > 0) with Input Delay / Processing / Presentation phase breakdown and 1-click Inspect handoff to the target Magento template
- List actual render-blocking CSS/JS/font requests via ResourceTiming.renderBlockingStatus alongside live LCP, CLS, TTFB, and FCP KPIs
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Unresolved bugs can discard unsaved settings, select the wrong inspected element, misreport performance metrics, and place mobile panels outside the viewport.
…lexity
- Move focus into the floating panel on open, filter hidden tab panels from focusable controls, and restore focus to the trigger on Escape
- Preserve unsaved Settings IDE inputs when switching target override theme and sync settings via event payloads without self-overwriting in-memory state
- Resolve fresh click targets during picker debounce unless stepped via keyboard and clear stale non-descendant childStepStack entries
- Decompose complex Inspector, Settings, Audit, and Profiler helpers to satisfy CodeFactor complexity and dead-store checks
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…specificity
- Match desktop floating panel CSS specificity in mobile responsive overrides so top-left and top-right panels anchor at top: 56px
- Track MageForge-only LoAF intervals and full frameDuration bounds when deduplicating overlapping longtask entries
- Compute CLS via Web Vitals max session windows (1s gap, 5s span) and p98 INP across worst retained interactions
- Strip thousands separators from formatted block renderTime strings before parsing in Block Explorer
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Unresolved calculation errors misreport performance metrics and hide slow blocks, while mobile positioning and Escape-key handling regressions impair panel visibility and keyboard dismissal.
…trols
- Handle Escape panel dismissal globally when picker is inactive so both floating and docked panels close consistently
- Limit findings container key propagation guard to Enter and Space so Escape and Tab bubble to panel-level focus management
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Unresolved keyboard and focus regressions break drawer closing and inspector interactions, while missing CLS attribution can falsely report that the page stayed stable.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Pinned selections incorrectly intercept storefront arrow keys outside the Inspector, while empty culprit lists are misreported as zero CLS even when attribution or API support is unavailable.
…appings
- Add HostPathDetector service to resolve host Magento root and extra bind-mount mappings from /mnt/ddev_config/.ddev-docker-compose-full.yaml (supporting both DDEV bind mounts and Mutagen com.ddev.approot labels, plus MAGEFORGE_HOST_ROOT override)
- Expose data-detected-host-root and data-detected-external-mappings on the Inspector block and use them as automatic defaults while keeping browser localStorage persistence unchanged
- Prioritize nested container bind-mount mappings before generic root prefix fallback so sub-mounts inside BP resolve to their host source paths
- Add unit tests for HostPathDetector and Inspector block memoization
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Active findings identify incorrect Open in IDE paths for nested mounts, Mutagen projects, and multi-service Compose configurations, plus a misleading CLS message when no source nodes are attributable.
…tion and keyboard UX
- Scope DDEV compose parsing to services.web and use named volume targets for Mutagen approot fallback so subdirectory setups preserve their Magento suffix
- Include the Magento root->hostRoot pair in longest-prefix path resolution so ancestor external mappings cannot override nested Magento mounts
- Restrict non-picker ArrowUp/ArrowDown stepping to DevTools focus and preserve keyboard-stepped hover until the raw pointer target changes
- Transfer focus when the currently focused menu control lies inside a hidden inactive tab panel and distinguish non-zero unattributed CLS from zero CLS
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Without an explicit ddevAppRoot, detection can select a nested shadow volume as the app-root fallback, creating an incorrect IDE mapping to the host repository root.
- Restrict volume-based DDEV approot fallback candidates to container targets that equal or contain Magento's root path so nested shadow volumes (such as mageforge-source/magento) are never recorded as project-root mappings
- Cover default zero-argument detect() calls in HostPathDetectorTest
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
dermatz
changed the title
feat(inspector): unify and modernize toolbar and inspector UX
feat(inspector): modernize toolbar and inspector UX and improve performance metrics
Dec 1, 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
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.
Summary
Unifies and modernizes the MageForge Toolbar and Frontend Inspector into a single cohesive, Linear/Vercel-inspired in-browser DevTools Dock & Panel (including a live Main-Thread & Vitals Profiler) while keeping the existing Alpine.js + ES Module + Magento View architecture intact.
Previously, Toolbar and Inspector operated as two visually separate overlays with duplicated CSS variables, mixed emojis/SVGs, light-DOM style bleeding from shop themes, and a large hover tooltip that jumped across page content. Both now share a single design system and strict storefront CSS isolation so MageForge looks identical across Luma (
62.5%root font-size), Blank, Hyvä (@tailwindcss/forms/ preflight), and custom storefronts.Key UX & Architecture Improvements
data-panel-mode="docked") so storefront content stays unobstructed during block inspection and audit review.<tag.class>, dimensions, render time, override/cache pills, template path, module/alias) with viewport-fixed highlights.parentalias resolution) orArrowUp/ArrowDownkeys.BlocksTab): Searchable, indented tree of all rendered[data-mageforge-id]blocks on the current page with instant filter pills (All,Overrides,No Cache,Slow >50ms), live hover preview highlighting, and 1-click selection.ProfilerTab +Main-Thread BlockersAudit):PerformanceObservertelemetry for Total Blocking Time (TBT), Long Tasks (> 50 ms), and Chromium Long Animation Frames (long-animation-frame/ LoAF) with culprit script URL, function name, invoker, and forced style/layout reflow duration (automatically excluding MageForge internal assets and audit runs).ResourceTiming.renderBlockingStatus === "blocking"(CSS/JS/Fonts with size & duration).interactionId > 0) with 3-phase breakdown (Input Delay · Processing · Presentation) and 1-click Inspect handoff to the target Magento template.Issues onlytoggle, and every finding row features a 1-click Inspect button that jumps straight to the.phtmltemplate and Magento block responsible for that DOM node.SettingsTab): Centralizes browser-persisted preferences for panel layout (Floating/Right Drawer), dock corner, dock labels, default target override theme, IDE preset & Docker/DDEV host-path mappings, and keyboard shortcuts.pxinstead ofrem) and semantic--mageforge-*custom properties across Dark, Light, and Auto themes.Verification
trunk fmt && trunk check(Prettier, markdownlint, svgo, git-diff-check)ddev phpcs(including CSS/JS sniffs across 211 files)ddev phpstan(Level 9)ddev mago lint && ddev mago fmt --check && ddev mago analyzeddev exec vendor/bin/phpunit(904 tests, 2636 assertions)Inspecthandoff)