From 9b0b4e5ef52c5e4383d6c4a2041ca1a73ea4bc44 Mon Sep 17 00:00:00 2001 From: Adam Malczewski Date: Fri, 26 Jun 2026 22:21:55 +0900 Subject: style: switch from tabs to 2-space indentation (incl. svelte) --- src/features/workspaces/store.svelte.ts | 132 ++++++++++++++++---------------- 1 file changed, 66 insertions(+), 66 deletions(-) (limited to 'src/features/workspaces/store.svelte.ts') diff --git a/src/features/workspaces/store.svelte.ts b/src/features/workspaces/store.svelte.ts index 0cf4ce2..046c235 100644 --- a/src/features/workspaces/store.svelte.ts +++ b/src/features/workspaces/store.svelte.ts @@ -9,80 +9,80 @@ import type { WorkspaceHttp, WorkspaceResult } from "./adapter/http"; * owned by the composition root. */ export interface WorkspaceStore { - /** All workspaces (sorted by lastActivityAt desc by the backend). */ - readonly list: readonly WorkspaceEntry[]; - readonly loading: boolean; - readonly error: string | null; - /** Refresh the list from the backend. */ - refresh(): Promise; - /** `PUT /workspaces/:id` (create-on-miss). Returns the workspace or an error. */ - ensure(id: string, body?: EnsureWorkspaceRequest): Promise>; - /** Rename a workspace (display only; id unchanged). */ - rename(id: string, title: string): Promise>; - /** Set/clear a workspace's default cwd. */ - setDefaultCwd(id: string, defaultCwd: string | null): Promise>; - /** Set/clear a workspace's default computer (SSH `Host` alias; null = local). */ - setDefaultComputer(id: string, computerId: string | null): Promise>; - /** Delete a workspace (closes its conversations, reassigns to "default"). */ - remove(id: string): Promise>; + /** All workspaces (sorted by lastActivityAt desc by the backend). */ + readonly list: readonly WorkspaceEntry[]; + readonly loading: boolean; + readonly error: string | null; + /** Refresh the list from the backend. */ + refresh(): Promise; + /** `PUT /workspaces/:id` (create-on-miss). Returns the workspace or an error. */ + ensure(id: string, body?: EnsureWorkspaceRequest): Promise>; + /** Rename a workspace (display only; id unchanged). */ + rename(id: string, title: string): Promise>; + /** Set/clear a workspace's default cwd. */ + setDefaultCwd(id: string, defaultCwd: string | null): Promise>; + /** Set/clear a workspace's default computer (SSH `Host` alias; null = local). */ + setDefaultComputer(id: string, computerId: string | null): Promise>; + /** Delete a workspace (closes its conversations, reassigns to "default"). */ + remove(id: string): Promise>; } export function createWorkspaceStore(http: WorkspaceHttp): WorkspaceStore { - let list = $state([]); - let loading = $state(false); - let error = $state(null); + let list = $state([]); + let loading = $state(false); + let error = $state(null); - return { - get list(): readonly WorkspaceEntry[] { - return list; - }, - get loading(): boolean { - return loading; - }, - get error(): string | null { - return error; - }, + return { + get list(): readonly WorkspaceEntry[] { + return list; + }, + get loading(): boolean { + return loading; + }, + get error(): string | null { + return error; + }, - async refresh(): Promise { - loading = true; - error = null; - try { - list = await http.list(); - } catch (err) { - error = err instanceof Error ? err.message : "Failed to load workspaces"; - } finally { - loading = false; - } - }, + async refresh(): Promise { + loading = true; + error = null; + try { + list = await http.list(); + } catch (err) { + error = err instanceof Error ? err.message : "Failed to load workspaces"; + } finally { + loading = false; + } + }, - async ensure(id, body): Promise> { - const result = await http.ensure(id, body); - if (result.ok) void this.refresh(); - return result; - }, + async ensure(id, body): Promise> { + const result = await http.ensure(id, body); + if (result.ok) void this.refresh(); + return result; + }, - async rename(id, title): Promise> { - const result = await http.setTitle(id, title); - if (result.ok) void this.refresh(); - return result; - }, + async rename(id, title): Promise> { + const result = await http.setTitle(id, title); + if (result.ok) void this.refresh(); + return result; + }, - async setDefaultCwd(id, defaultCwd): Promise> { - const result = await http.setDefaultCwd(id, defaultCwd); - if (result.ok) void this.refresh(); - return result; - }, + async setDefaultCwd(id, defaultCwd): Promise> { + const result = await http.setDefaultCwd(id, defaultCwd); + if (result.ok) void this.refresh(); + return result; + }, - async setDefaultComputer(id, computerId): Promise> { - const result = await http.setDefaultComputer(id, computerId); - if (result.ok) void this.refresh(); - return result; - }, + async setDefaultComputer(id, computerId): Promise> { + const result = await http.setDefaultComputer(id, computerId); + if (result.ok) void this.refresh(); + return result; + }, - async remove(id): Promise> { - const result = await http.delete(id); - if (result.ok) void this.refresh(); - return result; - }, - }; + async remove(id): Promise> { + const result = await http.delete(id); + if (result.ok) void this.refresh(); + return result; + }, + }; } -- cgit v1.2.3