Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Merge code base of Setup Guide and Standalone versions of Printer / Filament Selection Dialogs#13579

Open
yw4z wants to merge 9 commits into
OrcaSlicer:mainfrom
yw4z:merge-web-code
Open

Merge code base of Setup Guide and Standalone versions of Printer / Filament Selection Dialogs#13579
yw4z wants to merge 9 commits into
OrcaSlicer:mainfrom
yw4z:merge-web-code

Conversation

@yw4z
Copy link
Copy Markdown
Collaborator

@yw4z yw4z commented May 11, 2026

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

@yw4z yw4z changed the title Merge code base of setup guide and standalone versions of Printer / Filament Selection Dialogs Merge code base of Setup Guide and Standalone versions of Printer / Filament Selection Dialogs May 11, 2026
@yw4z yw4z requested a review from Copilot May 11, 2026 19:01
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 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.js and resources/web/guide/21/common.css and wired them into both guide/21 and guide/24.
  • Removed large duplicated JS/CSS blocks from 21.js/24.js and 21.css/24.css, keeping only page-specific logic/styles.
  • Updated the HTML pages to initialize the shared globals/scroll/layout behavior via initGlobals() and initScrollEvents().

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.

Comment thread resources/web/guide/21/common.js Outdated
Comment thread resources/web/guide/21/common.js Outdated
Comment thread resources/web/guide/21/common.js Outdated
Comment thread resources/web/guide/21/common.css Outdated
Comment thread resources/web/guide/21/common.js Outdated
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 16 out of 16 changed files in this pull request and generated 3 comments.

Comment thread resources/web/guide/21/common.js Outdated
Comment thread resources/web/guide/24/index.html
Comment thread resources/web/guide/22/common.js
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 16 out of 16 changed files in this pull request and generated 2 comments.

Comment thread resources/web/guide/22/common.js
Comment thread resources/web/guide/21/common.js
@yw4z yw4z marked this pull request as ready for review May 12, 2026 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants