Skip to content

Make Rust serialize and ignore unrecognized settings, serialize false for boolean settings#10947

Draft
franknoirot wants to merge 6 commits intomainfrom
franknoirot/10397/split-settings
Draft

Make Rust serialize and ignore unrecognized settings, serialize false for boolean settings#10947
franknoirot wants to merge 6 commits intomainfrom
franknoirot/10397/split-settings

Conversation

@franknoirot
Copy link
Copy Markdown
Contributor

Authored primarily by @adamchalmers as he was on a huddle with me. This PR enables the serialization of boolean settings that are set to false, and allows settings that are not defined in the Rust settings schema to be serialized but ignored. The first point solves buggy behavior with our app around toggling boolean settings, and the latter allows ZDS to define settings that are not available to the CLI. This is huge because we can have far more settings without the friction of needing CLI to care about them!. Closes #10397.

ZDS intention is that if the user doesn't set a setting, then it's not
included in the file. The settings file should be for tracking what the
user has explicitly chosen. It should not track defaults the user didn't
choose.

But right now, if the user explicitly chooses a setting which happens to
be the default value (e.g. explicitly setting the length unit to mm),
serde will skip serializing that field.

The solution is to make most fields Option<T>, where if the user didn't
set it, it's None. If the user did set it, then great, it'll be Some.
And we only skip serializing if it's None. If it's Some, we serialize.
Now if the user sets another field that our schema doesn't know about,
it will be read into Rust and serialized back to the output config file.
@franknoirot franknoirot requested a review from a team as a code owner April 9, 2026 21:08
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
modeling-app Ready Ready Preview, Comment Apr 9, 2026 9:38pm

Request Review

@franknoirot franknoirot marked this pull request as draft April 9, 2026 21:09
@franknoirot franknoirot force-pushed the franknoirot/10397/split-settings branch from dd4eddc to 1ee3577 Compare April 9, 2026 21:22
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.

Allow for settings that are not duplicated in Rust for the CLI

2 participants