Pinned chats and folders in the drawer: pin, move, new, rename, fold, delete
CI / check (push) Canceled after 0s

The web sidebar's order: Pinned chats (wherever filed), the folders as a tree (folderTree:
position order, a folder whose parent is missing goes to the top), then today / earlier /
agent chats unfiled. PATCH /chats/{id} `pinned` and `folder_id` (server 96240be, f7f2ff2);
POST/PATCH/DELETE /folders. A tap folds a folder through PATCH `collapsed`, so the web folds
the same. Long press: Pin chat / Move to folder / Archive; on a folder Rename / Delete (its
chats stay). Strings from the server's catalogue. ChatGroupsTest, ContractTest (folders.json,
folder.json); the drawer shot now has a pinned chat, nested and collapsed folders.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
HomerandClaude Opus 5.5 committed 2026-11-10 13:49:03 +00:00
1 parent cd88c3e712
commit 737105add2
19 files changed
+586 -24

No files matched your search

@@ -155,6 +155,22 @@ class ApiClient(val base: String, private val token: String, val http: OkHttpCli
suspend fun folders(): List<Folder> = get<FolderList>("/folders").folders
/** A new folder, at the top or inside [parentId] (`folder.manage`; nesting is capped). */
suspend fun createFolder(name: String, parentId: String? = null): Folder = send<FolderEnvelope>(
"POST",
"/folders",
buildJsonObject {
put("name", name)
if (parentId != null) put("parent_id", parentId)
},
).folder
/** Any of `name`, `parent_id`, `collapsed`. */
suspend fun updateFolder(id: String, changes: JsonObject): Folder = send<FolderEnvelope>("PATCH", "/folders/${segment(id)}", changes).folder
/** The folder and the folders inside it; their chats fall back to no folder. */
suspend fun deleteFolder(id: String) = empty(authed("$v2/folders/${segment(id)}").delete().build())
suspend fun devices(): List<LinkedDevice> = get<DeviceList>("/devices").devices
/** The token revokes itself (`lembas logout`'s route). */
@@ -176,7 +176,17 @@ data class AgentSubagents(val offered: Boolean = false, @SerialName("device_runs
data class SubagentsOffer(val offered: Boolean = false, @SerialName("named_only") val namedOnly: Boolean = false, val cap: Int? = null)
@Serializable
data class Folder(val id: String, val name: String = "", @SerialName("parent_id") val parentId: String? = null, val kind: String = "", val position: Int = 0)
data class Folder(
val id: String,
val name: String = "",
@SerialName("parent_id") val parentId: String? = null,
val kind: String = "",
val position: Int = 0,
val collapsed: Boolean = false,
)
@Serializable
data class FolderEnvelope(val folder: Folder)
@Serializable
data class FolderList(val folders: List<Folder> = emptyList())