ZIm/crates/title_bar
Finn Evers 09503333af
project_settings: Fix default settings values for DiagnosticsSettings (#30686)
Follow-up to #30565

This PR fixes the default settings values for the `DiagnosticsSettings`.
The issue here was that due to the `#[derive(Default)]`, `button` would
be false by default, which unintentionally hid the diagnostics button by
default. The `#[serde(default = `default_true`)]` would only apply iff
the diagnostics key was already present in the user's settings. Thus, if
you have

```json
{
    "diagnostics": {...}
}
```

in your settings, the button would show (given it was not disabled).
However, if the key was not present, the button was not shown: Due to
the derived default for the entire struct, the value would be false.

This PR fixes this by implementing the default instead and moving the
`#[serde(default)]` up to the level of the struct.
I also did the same for the inline diagnostics settings, which already
had a default impl and thus only needed the serde default on the struct
instead of on all the struct fields.

Lastly, I simplified the title bar settings, since the serde attributes
previously had no effect anyway (deserialization happened in the
`TitlebarSettingsContent`, so these attributes had no effect) and we can
remove the `TitlebarSettingsContent` as well as the attributes if we
implement a proper default implementation instead.

Release Notes:

- Fixed the diagnostics status bar button being hidden by default.
2025-05-14 07:13:51 -04:00
..
src project_settings: Fix default settings values for DiagnosticsSettings (#30686) 2025-05-14 07:13:51 -04:00
Cargo.toml agent: Remove feature flag checks (#30055) 2025-05-06 21:38:05 -04:00
LICENSE-GPL Extract title_bar crate (#13597) 2024-06-27 19:14:13 -04:00