feat(app): sidebar favorites, drag-reorder, and delete-with-confirm

- FAVORITES section at the top collects pinned workspaces (removed from their
  group listing); a star toggle on each row pins/unpins via setWorkspaceMeta.
- Drag-to-reorder within a section using raw pointer events (HTML5 DnD is
  unreliable in the macOS WKWebView), with a drop-line indicator; on drop the
  section's `order` is reassigned sequentially and persisted. Cross-section
  drops are ignored (group membership unchanged).
- Trash icon on row hover opens a ConfirmDelete modal that shows the live
  terminal count and warns before terminating them, then calls close_workspace
  and re-points the active workspace.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-14 08:56:20 +07:00
parent 7b47052a6f
commit a55555983b
5 changed files with 204 additions and 22 deletions
+2 -1
View File
@@ -149,13 +149,14 @@ export async function closeWorkspaceCmd(workspaceId: string): Promise<void> {
await invoke("close_workspace", { workspaceId });
}
export async function setWorkspaceMeta(workspaceId: string, meta: { name?: string; groupId?: string | null; unread?: boolean; order?: number }): Promise<void> {
export async function setWorkspaceMeta(workspaceId: string, meta: { name?: string; groupId?: string | null; unread?: boolean; order?: number; pinned?: boolean }): Promise<void> {
await invoke("set_workspace_meta", {
workspaceId,
name: meta.name ?? null,
groupId: meta.groupId === undefined ? null : meta.groupId,
unread: meta.unread ?? null,
order: meta.order ?? null,
pinned: meta.pinned ?? null,
});
}