feat(spaceshd): pinned workspace field

Add a `pinned` bool to the workspace model, threaded through proto
(Workspace + WorkspaceView + SetWorkspaceMeta), the registry, the
set_workspace_meta handler, persistence, the CLI mapping, and the Tauri
bridge. serde(default) keeps existing state.json compatible (pinned=false).
Backs the sidebar Favorites section.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-14 08:56:09 +07:00
parent 2c8ac8ebac
commit 7b47052a6f
7 changed files with 32 additions and 6 deletions
+2 -2
View File
@@ -269,14 +269,14 @@ pub async fn close_workspace(state: BridgeState<'_>, workspace_id: String) -> Re
}
#[tauri::command]
pub async fn set_workspace_meta(state: BridgeState<'_>, workspace_id: String, name: Option<String>, group_id: Option<String>, unread: Option<bool>, order: Option<u32>) -> Result<Value, String> {
pub async fn set_workspace_meta(state: BridgeState<'_>, workspace_id: String, name: Option<String>, group_id: Option<String>, unread: Option<bool>, order: Option<u32>, pinned: Option<bool>) -> Result<Value, String> {
// group_id: None from JS means "no change"; an explicit null is sent as Some("") to mean "ungroup".
let gid = match group_id {
None => None,
Some(s) if s.is_empty() => Some(None),
Some(s) => Some(Some(GroupId(s))),
};
data_of(state.request(Cmd::SetWorkspaceMeta { workspace_id: WorkspaceId(workspace_id), name, group_id: gid, unread, order }).await.map_err(|e| e.to_string())?)
data_of(state.request(Cmd::SetWorkspaceMeta { workspace_id: WorkspaceId(workspace_id), name, group_id: gid, unread, order, pinned }).await.map_err(|e| e.to_string())?)
}
#[tauri::command]