fix(dock): serialize claudeProfiles in camelCase on DockQuota::Ready (#1594)

serde's rename_all on an internally tagged enum only renames the
variant tag, not the fields of a struct-like variant, so this field
shipped as claude_profiles. The frontend reads answer.claudeProfiles,
so the Claude profiles settings row and the per-config dock rings
from #1570 never showed.

Adds a field-level rename plus a test pinning the serialized key.
This commit is contained in:
Swizzy 2026-10-02 10:28:54 +02:00 • committed by GitHub
parent 986d72ce1e
commit d3929746ae
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -151,6 +151,8 @@ pub struct CliStatus {
pub enum DockQuota {
Ready {
providers: Value,
/// `rename_all` above only covers the variant tag, not this field.
#[serde(rename = "claudeProfiles")]
claude_profiles: Option<Value>,
},
CliOutdated,
@ -1174,6 +1176,17 @@ mod which {
mod tests {
use super::*;
#[test]
fn dock_quota_ready_serializes_claude_profiles_as_camel_case() {
let answer = DockQuota::Ready {
providers: serde_json::json!([]),
claude_profiles: Some(serde_json::json!([{"id": "x"}])),
};
let value = serde_json::to_value(&answer).unwrap();
assert!(value.get("claudeProfiles").is_some());
assert!(value.get("claude_profiles").is_none());
}
#[test]
fn only_a_named_read_only_subcommand_opens_a_terminal() {
assert!(is_allowed_subcommand(&["report"]));