Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a configurable “Toolbar Position” option for the MageForge Inspector toolbar (admin configuration → frontend rendering), and refactors Inspector-related config paths/defaults into a centralized config class.
Changes:
- Introduces an admin “Toolbar Position” select field (bottom-left/right, top-left/right) with defaults in
config.xml. - Propagates the configured position to the frontend via
data-positionand adds CSS rules to position the toolbar/menu accordingly. - Centralizes Inspector config paths/default values in a new
Model\Config\Inspectorclass and updates usages across PHP components.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/view/frontend/web/js/toolbar/ui.js | Copies data-position from the root element onto the constructed toolbar container. |
| src/view/frontend/web/css/toolbar.css | Adds position variants and menu anchoring rules for top/right placements (+ responsive tweaks). |
| src/view/frontend/templates/inspector.phtml | Emits data-position on the toolbar root using the block’s configured value. |
| src/Model/TemplateEngine/Plugin/InspectorHints.php | Uses centralized config path constants for inspector enablement checks. |
| src/Model/Config/Source/ToolbarPosition.php | New source model providing position options for system config. |
| src/Model/Config/Inspector.php | New centralized constants for Inspector config paths and defaults. |
| src/i18n/en_US.csv | Adds translation strings for new config label/options (and related text). |
| src/i18n/de_DE.csv | Adds German translations for new config label/options (and related text). |
| src/etc/config.xml | Adds default mageforge/inspector/position value. |
| src/etc/adminhtml/system.xml | Adds the new “Toolbar Position” select field to admin configuration. |
| src/Console/Command/Dev/InspectorCommand.php | Switches to centralized config constant for enabling/disabling inspector. |
| src/Block/Inspector.php | Reads theme/labels/position using centralized config constants and exposes getPosition(). |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…n field in system.xml Agent-Logs-Url: https://github.com/OpenForgeProject/mageforge/sessions/5f83d607-c501-46ef-81b6-eb950da6237b Co-authored-by: dermatz <6103201+dermatz@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…d system.xml Agent-Logs-Url: https://github.com/OpenForgeProject/mageforge/sessions/ad13f4cf-bed2-4f23-8ccd-d12bc2921c86 Co-authored-by: dermatz <6103201+dermatz@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…fields; fix en_US Show Button Labels default Agent-Logs-Url: https://github.com/OpenForgeProject/mageforge/sessions/662a5940-af5f-45fe-ab1e-0ac89f1bb0f7 Co-authored-by: dermatz <6103201+dermatz@users.noreply.github.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This pull request introduces a configurable "Toolbar Position" feature for the MageForge Inspector, allowing users to select where the toolbar appears on the page. The implementation includes backend configuration, frontend rendering, and styling updates. Additionally, configuration constants have been centralized for maintainability, and translation files have been updated for the new feature.
Toolbar Position Feature:
system.xmland its default inconfig.xml, allowing users to choose between bottom-left, bottom-right, top-left, and top-right positions. (F898b67cR1, src/etc/config.xmlR14)ToolbarPositionsource model to provide selectable options for the toolbar position in the admin configuration.Inspector.php) and template (inspector.phtml) to read and output the configured position, defaulting to 'bottom-left' if unset. [1] [2]Frontend Rendering & Styling:
data-positionattribute, ensuring the toolbar and its menu appear correctly in all configured positions, including responsive adjustments. [1] [2] [3]Configuration Refactoring:
Inspectorconfig class, replacing scattered string literals and constants throughout the codebase for easier maintenance and consistency. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13]Translations:
Other Improvements:
These changes collectively make the MageForge Inspector toolbar more flexible and easier to configure, while also improving code maintainability and user experience.