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 authored and copyberry committed 2026-08-10 23:32:42 +00:00
1 parent 92912d6d84
commit 1549756b78
54 files changed
+939 -47

No files matched your search

+7 -5
View File
@@ -102,16 +102,18 @@ INSERT INTO threads (
.expect("legacy thread insert should succeed");
}
let registered_sections =
sqlx::query_as::<_, (String, String)>("SELECT id, name FROM thread_sections ORDER BY id")
.fetch_all(&pool)
.await
.expect("independent thread sections should load");
let registered_sections = sqlx::query_as::<_, (String, String, Option<String>)>(
"SELECT id, name, appearance FROM thread_sections ORDER BY id",
)
.fetch_all(&pool)
.await
.expect("independent thread sections should load");
assert_eq!(
registered_sections,
vec![(
PINNED_THREAD_SECTION_ID.to_string(),
PINNED_THREAD_SECTION_NAME.to_string(),
None,
)]
);