Skip to content

Conversation

@dongdong867
Copy link
Contributor

@dongdong867 dongdong867 commented Oct 20, 2025

Closes #40556

Release Notes:

  • settings-ui: Fixed editing fields from settings-ui causing IEEE 754 floating error in settings.json file

Note

Seems like there's another pull request fixing the centered layout in #40661 by normalizing the whole settings.json file when updating it. Not sure which is the better way to handle this issue.

Description

This pull request solves the IEEE 754 floating point error when serializing values from settings-ui into settings.json by creating a two serde_helper to convert the problematic f32 into a formatted two decimal placed f32.

Fields currently exists the IEEE 754 error:

  • Appearance → Unnecessary Code Fade
  • Editor → Drop Size Target
  • Window & Layout → Centered Layout Left/Right Padding
  • Window & Layout → Inactive Opacity

How to verify

Unnecessary Code Fade

As Is To Be
as_is_unnecessary_code.mov
to_be_unnecessary_code.mov

Drop Size Target

As Is To Be
as_is_drop_size_target.mov
to_be_drop_size_target.mov

Centered Layout Left/Right Padding

As Is To Be
as_is_centered_layout.mov
to_be_centered_layout.mov

Inactive Opacity

As Is To Be
as_is_inactive_opacity.mov
to_be_inactive_opacity.mov
@cla-bot
Copy link

cla-bot bot commented Oct 20, 2025

We require contributors to sign our Contributor License Agreement, and we don't have @dongdong867 on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

@dongdong867
Copy link
Contributor Author

@cla-bot check

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Oct 20, 2025
@cla-bot
Copy link

cla-bot bot commented Oct 20, 2025

The cla-bot has been summoned, and re-checked this pull request!

@maxdeviant maxdeviant changed the title settings-ui: IEEE 754 floating error when serializing value from settings-ui to json Oct 20, 2025
@delvin02
Copy link
Contributor

nice work @dongdong867 !

Copy link
Collaborator

@probably-neb probably-neb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work. Thanks! I've pushed a couple commits, The first one is to make sure all f32 settings get serialized with rounding for consistency and to ensure that regardless of what a user has in their settings, changing it in the settings UI doesn't result in floating error in the settings file. The second is to add some basic tests.

I'm going to merge this once CI passes. Thanks again!

@probably-neb probably-neb enabled auto-merge (squash) October 21, 2025 16:35
@dongdong867
Copy link
Contributor Author

Thanks for the follow-up commits and the review!

@probably-neb probably-neb merged commit 641ae90 into zed-industries:main Oct 21, 2025
21 checks passed
@dongdong867 dongdong867 deleted the fix/ieee-754-in-settings branch October 21, 2025 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

4 participants