feat(lists): expose emoji + color in get_lists + create_list (v0.5.1)

get_lists now includes emoji and color fields per list entry.
create_list response also returns emoji and color from the API.

Field name verification (FW_DEBUG=1, 2026-04-16):
- emoji: API returns "" when unset -> normalised to null
- color: API omits key when unset -> normalised to null
- Both fields present in taskgettasklists and taskcreatelist responses

SPEC.md: taskgettasklists documented with full response structure
         and emoji/color normalisation notes.
         taskcreatelist response updated with emoji + color fields.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-16 13:50:36 +02:00
parent 311f37d72b
commit 4a3fe6be87
6 changed files with 45 additions and 8 deletions
+8
View File
@@ -284,6 +284,9 @@ def get_lists(scope: str | None = None):
result = []
for item in raw_lists:
# TODO: apply scope filtering once the circle field is identified.
# emoji: API returns "" when unset — normalise to None for a clean JSON null.
# color: API omits the key entirely when unset — .get() returns None directly.
raw_emoji: str = item.get("emoji", "")
result.append(
{
"id": item.get("metaId"),
@@ -291,6 +294,8 @@ def get_lists(scope: str | None = None):
"type": item.get("taskListType"),
"open": item.get("remainingTaskNumber"),
"total": item.get("totalTaskNumber"),
"emoji": raw_emoji if raw_emoji else None,
"color": item.get("color") or None,
}
)
@@ -927,6 +932,7 @@ def create_list(
indent=2,
)
raw_emoji: str = list_obj.get("emoji", "")
return json.dumps(
{
"created": True,
@@ -934,6 +940,8 @@ def create_list(
"name": list_obj.get("name", name),
"type": list_obj.get("taskListType"),
"shared_to_all": list_obj.get("sharedToAll") == "true",
"emoji": raw_emoji if raw_emoji else None,
"color": list_obj.get("color") or None,
},
ensure_ascii=False,
indent=2,