fix(tui): persist global details mode sections

Pin all detail sections when /details sets a global mode so config sync does not restore built-in section defaults.
This commit is contained in:
Brooklyn Nicholson
2026-04-29 16:46:42 -05:00
parent b52b63396c
commit c2cb6d1071
4 changed files with 48 additions and 2 deletions

View File

@@ -3130,7 +3130,15 @@ def _(rid, params: dict) -> dict:
allowed_dm = frozenset({"hidden", "collapsed", "expanded"})
if nv not in allowed_dm:
return _err(rid, 4002, f"unknown details_mode: {value}")
_write_config_key("display.details_mode", nv)
cfg = _load_cfg()
display = cfg.get("display") if isinstance(cfg.get("display"), dict) else {}
sections = display.get("sections") if isinstance(display.get("sections"), dict) else {}
display["details_mode"] = nv
for section in ("thinking", "tools", "subagents", "activity"):
sections[section] = nv
display["sections"] = sections
cfg["display"] = display
_save_cfg(cfg)
return _ok(rid, {"key": key, "value": nv})
if key.startswith("details_mode."):