Add appearance metadata to thread sections (#37898)

## What changed

- Add optional `icon` and `color` appearance fields to custom thread sections and expose them through the app-server protocol.
- Persist appearance metadata in SQLite and include it when listing sections or returning threads.
- Let `threadSection/update` preserve an omitted appearance, clear it with `null`, or replace it with a new value.
- Reject appearance fields larger than 64 bytes.

## Testing

- Cover protocol compatibility, persistence across restart, update and clear behavior, and field-length validation.

GitOrigin-RevId: 8f55ce4f42f8bd17aa5416848a85845f681953df
This commit is contained in:
joeytrasatti-openai
2026-08-10 23:32:42 +00:00
committed by copyberry
parent 92912d6d84
commit 1549756b78
54 changed files with 939 additions and 47 deletions
@@ -176,6 +176,18 @@ pub struct ThreadSection {
pub id: String,
/// The current user-visible section name.
pub name: String,
/// Optional appearance synchronized across clients.
#[serde(default)]
pub appearance: Option<ThreadSectionAppearance>,
}
/// Extensible visual presentation for a custom thread section.
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)]
#[serde(rename_all = "camelCase")]
#[ts(export_to = "v2/")]
pub struct ThreadSectionAppearance {
pub icon: Option<String>,
pub color: Option<String>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS, ExperimentalApi)]