Skip to content

fix(gui): remember auto-gradient choice per project - #827

Open
MoraesGil wants to merge 3 commits into
Snapmaker:mainfrom
MoraesGil:codex/configurable-auto-gradient-confirmation
Open

MoraesGil wants to merge 3 commits into
Snapmaker:mainfrom
MoraesGil:codex/configurable-auto-gradient-confirmation

Conversation

@MoraesGil

@MoraesGil MoraesGil commented Sep 4, 2026

Copy link
Copy Markdown

Description

Overview - #826

Closes #826.

The confirmation above four physical filaments is an intentional safeguard: pairwise gradients grow as n × (n - 1) / 2. This change keeps that safeguard and adds an explicit way to remember the answer for one project, instead of bypassing confirmation application-wide.

Changes Made

  • Add Remember this choice for this project to the existing Yes/No dialog.
  • Store both Yes and No in project configuration together with the matching physical-filament count.
  • Reuse the answer only when reopening that saved project with the same count; ask again after the count changes.
  • Mark the project dirty when a choice is remembered so the user can persist it in the .3mf.
  • Keep project-only metadata out of print-preset dirty checks.
  • Reset the legacy in-session answer cache when another project is loaded, preventing one file from affecting another file with the same count.

Preserved Safety Behavior

Auto-generate Physical filaments Matching project choice Result
Off Any Any Do not generate
On 0–4 Any Generate without prompting
On 5+ None or different count Ask
On 5+ Yes, same count Generate
On 5+ No, same count Do not generate

Screenshots/Recordings/Graphs

Project-scoped auto-gradient choice

The recording uses an isolated macOS arm64 build and a seven-filament fixture. It shows the 7 → 21 safeguard, remembers Yes in the project, reopens the saved .3mf without prompting, then changes the physical count so the safeguard asks again for 8 → 28 gradients.

Verification

  • Focused Catch2 suite: 8 test cases, 15 assertions — passed.
  • Standalone C++17 policy contract with -Wall -Wextra -Werror — passed, including unchanged default behavior for counts 0–32.
  • macOS arm64 Release target — built successfully from the final diff.
  • git diff --check — passed.
  • Project round-trip — the saved .3mf contains choice = 1 and physical_count = 7.
  • CUA — read the checkbox back as selected before Yes, observed no Auto gradients window after reopening the saved project, then observed the exact 8 → 28 prompt after adding an eighth physical filament.
  • Runtime isolation — used a temporary app bundle, isolated app data, and loopback-only networking; the installed Snapmaker Orca app was not modified.

The wider local [MixedFilament] run reaches an existing assertion in PrintRegion.cpp (wall_filament <= num_extruders) after 22 test cases / 142 assertions; that test and code path are unchanged by this PR. The repository's Ubuntu workflow also has a pre-existing Catch2 v2 include failure reproduced on the exact base commit.

@MoraesGil MoraesGil changed the title fix(gui): make auto-gradient confirmation persistent fix(gui): remember auto-gradient choice per project Sep 5, 2026
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.

Remember auto-gradient confirmation per project

1 participant