Skip to content

Add functionality to import an official configuration - #101

Merged
thinkyhead merged 2 commits into
MarlinFirmware:masterfrom
StevilKnevil:master
Jul 16, 2026
Merged

thinkyhead merged 2 commits into
MarlinFirmware:masterfrom
StevilKnevil:master

Conversation

@StevilKnevil

Copy link
Copy Markdown
Contributor

Summary

This PR adds an Official Configs workflow to Auto Build Marlin so users can import a preset from MarlinFirmware/Configurations that exactly matches the local Marlin version, with a clear overwrite warning.

Why

Users need a guided way to load official example configurations without manually cloning/copying files, while understanding that local files can be overwritten.

Changes

  • Added a dedicated Official Configs sub-tab in Configure UI.
  • Made Official Configs the default selected configure sub-tab.
  • Added import flow that:
    • Detects local Marlin version.
    • Requires exact branch match in Configurations: release-X.Y.Z...
    • Loads selectable example presets from config/examples.
    • Shows modal confirmation before import.
    • Imports all files from the selected example folder.
    • Preserves relative paths under local Marlin.
    • Overwrites matching files and adds missing files.
  • Refactored import logic out of the main ABM controller into a dedicated module.

Files Touched

UX Notes

  • Import entrypoint is Configure -> Official Configs.
  • Modal warning explicitly states overwrite/add behaviour.
  • Success toast reports number of imported files and source preset.

Validation

  1. No diagnostics errors in modified files.
  2. Configure tab order/default selection works as expected.
  3. Import mirrors selected example subtree into local Marlin directory.
  4. Import blocks when exact release branch is not available.

Risk

  • If Configurations does not have a release branch exactly matching detected Marlin version, import is blocked by design.

@thinkyhead

Copy link
Copy Markdown
Member

Thanks! I've been meaning to add an interface for this. A hierarchical config selector — basically a file navigator for the Configurations repo — seemed the right way to go. I'll have a look at your implementation and do some UI refinements. I will soon have an "import" function that converts older configs to current version configs, so I'll do a little adjustment of terminology to avoid the lexical collision.

@StevilKnevil

StevilKnevil commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

Sounds good - the selection of the correct config just leverages quick picks in VS code, seemed entirely easy!

the next step after this would be to allow users create a pull request in MarlinFirmware/Configurations for their customisations... An idea for a different day :)

@thinkyhead

Copy link
Copy Markdown
Member

First impression is that the UI for selection is really good, integrated into VSCode makes a lot of sense. I was going to build out this whole selector but there's nothing ambiguous about the simple filter field. I'll try it with older Marlin versions next. One change I'll make first is to give the panel its own tab so that it can be more easily discovered. Or I could just move the button to the ABM Config Panel. I'll explore moving the button to the Panel first and see what that does for the UX.

@thinkyhead
thinkyhead force-pushed the master branch 3 times, most recently from 69d5d74 to 08e4a27 Compare July 16, 2026 00:19
@thinkyhead

Copy link
Copy Markdown
Member

Ok, I moved the button to the top next to [Monitor] and [Refresh] and added an SVG for the button. Then I modified the code to back up configs right before downloading the new ones, and if the download fails the configurations are restored from the backup folder and the folder is removed.

@thinkyhead thinkyhead added the enhancement New feature or request label Jul 16, 2026
@thinkyhead
thinkyhead force-pushed the master branch 4 times, most recently from f9f96b6 to 751c3a3 Compare July 16, 2026 04:53
@thinkyhead

Copy link
Copy Markdown
Member

It seemed like a good idea to open and display the README file, if present, so the downloader now does that too, and it's a pretty good user experience. The only refinement I might add is an option to revert to one of the configuration backups. A small "⏪" button next to "Downloads" might work….

@thinkyhead

thinkyhead commented Jul 16, 2026

Copy link
Copy Markdown
Member

For simplicity I've just put "Restore: Backup Name (timestamp)" at the top when you click the "Download" button. I think this is now complete enough to merge, so I will tag and release 2.1.88 this evening.

StevilKnevil and others added 2 commits July 16, 2026 18:46
- Download button with tooltip
- Back up current configs before download
- Handle rare missing `Configuration_adv.h`
- Items added to restore backups
- Display README if present
@thinkyhead
thinkyhead merged commit a2af3ba into MarlinFirmware:master Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants