Merge code base of Setup Guide and Standalone versions of Printer / Filament Selection Dialogs#13579
Open
yw4z wants to merge 9 commits into
Open
Merge code base of Setup Guide and Standalone versions of Printer / Filament Selection Dialogs#13579yw4z wants to merge 9 commits into
yw4z wants to merge 9 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR consolidates the Setup Guide (guide pages) and standalone Printer/Filament selection dialog implementations by extracting shared UI logic and styling into common assets, reducing duplicated code across pages 21 and 24.
Changes:
- Added shared
resources/web/guide/21/common.jsandresources/web/guide/21/common.cssand wired them into both guide/21 and guide/24. - Removed large duplicated JS/CSS blocks from
21.js/24.jsand21.css/24.css, keeping only page-specific logic/styles. - Updated the HTML pages to initialize the shared globals/scroll/layout behavior via
initGlobals()andinitScrollEvents().
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| resources/web/guide/24/index.html | Loads the new shared common JS/CSS and switches inline initialization to the shared helpers. |
| resources/web/guide/24/24.js | Removes duplicated selection/rendering logic; keeps only page-specific actions (confirm/cancel/create). |
| resources/web/guide/24/24.css | Strips shared styles, leaving only page-unique CSS. |
| resources/web/guide/21/index.html | Loads the new shared common JS/CSS and switches inline initialization to the shared helpers. |
| resources/web/guide/21/common.js | New shared implementation for model/vendor rendering, filtering, snapping scroll, and layout switching. |
| resources/web/guide/21/common.css | New shared styling for vendor/model cards, layout modes, sidebar, search, and notice popup. |
| resources/web/guide/21/21.js | Removes duplicated selection/rendering logic; retains page-specific navigation to filament page. |
| resources/web/guide/21/21.css | Strips shared styles, leaving only page-unique CSS placeholder. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
removes duplicate code to make development process easier
about 2200 lines of duplicate code cleaned
PRINTER SELECTION
Cleaned parts
• HTML > removed old example code blocks and added recent code block
• CSS > removed unused styling pNozzel (not available on current code)
• JS > removed old functions for SelectPrinterAll and SelectPrinterAll since both handled by ChooseVendor on new UI
• JS > removed old functions for ShowPrinterThumb not used on new UI
New Parts
• JS > added CreateVendorBlock to remove duplicate code
• JS > added UpdateSidebarVendors to remove duplicate code
Minor fixes
• JS > ChooseModel() > ChooseItem object is never null used length to fix that issue
• JS > OnExitFilter() > For loops not uses let / const before using "vendor" / "model" iterator variables
Fixes
• ESC key was not working on standalone dialog. Also added first ESC key closes sidebar instead dialog to fix annoying behaviour
Notes
• SortFilament() and SortUI() is very similar but i didnt make any changes on this round to not break anything
FILAMENT SELECTION
New Parts
• JS > %95 of SortUI() is same on both only a section for installing network printer was different. so added a separate function as InstallNetworkPlugin()
Minor fixes
• JS > SortUI() > DefaultMaterialString initialized as array instead empty string
Notes
• HandleModelList() and FilterModelList() is very similar but i didnt make any changes on this round to not break anything