Skip to content
TypeScript

update: rename the main workspace to Kargul

Vipul Kumar73001d867baa
diff --git a/README.md b/README.md
index 954104e..bd0edc8 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# Workspace — Time off & calendar
+# Kargul — Time off & calendar
A people-ops workspace built from the "Dashboard – calendar" Figma design. The
**Time off** page (`/time-off`, the default route) reproduces the design
diff --git a/src/app/layout.tsx b/src/app/layout.tsx
index 01a15a6..ba00f22 100644
--- a/src/app/layout.tsx
+++ b/src/app/layout.tsx
@@ -9,7 +9,7 @@ const geistMono = Geist_Mono({ variable: "--font-geist-mono", subsets: ["latin"]
const inter = Inter({ variable: "--font-inter", subsets: ["latin"], weight: ["600"] });
export const metadata: Metadata = {
- title: { default: "Time off · Workspace", template: "%s · Workspace" },
+ title: { default: "Time off · Kargul", template: "%s · Kargul" },
description: "Plan time off, track leave requests and manage your work calendar.",
};
diff --git a/src/lib/seed.ts b/src/lib/seed.ts
index fedddc2..90f563d 100644
--- a/src/lib/seed.ts
+++ b/src/lib/seed.ts
@@ -6,7 +6,7 @@ export const DESIGN_DATE = "2026-11-10";
/** Used only for server rendering; the browser swaps in the real date on hydration. */
export const SERVER_TODAY = "2026-10-26";
-export const STATE_VERSION = 1;
+export const STATE_VERSION = 2;
const h = (hours: number, minutes = 0) => hours * 60 + minutes;
@@ -15,7 +15,7 @@ export function createSeed(): AppState {
version: STATE_VERSION,
workspaceId: "ws-main",
workspaces: [
- { id: "ws-main", name: "Workspace" },
+ { id: "ws-main", name: "Kargul" },
{ id: "ws-acme", name: "Acme Studio" },
{ id: "ws-personal", name: "Personal" },
],
diff --git a/src/stores/app-store.ts b/src/stores/app-store.ts
index c89e8d0..fab8421 100644
--- a/src/stores/app-store.ts
+++ b/src/stores/app-store.ts
@@ -402,6 +402,14 @@ export const useAppStore = create<AppStore>()(
storage: createJSONStorage(() => safeLocalStorage),
// Hydrate after mount so the server-rendered markup (the seed) matches.
skipHydration: true,
+ migrate: (persisted, version) => {
+ const s = persisted as AppState;
+ // v2: the main workspace was renamed from "Workspace" to "Kargul".
+ if (version < 2) {
+ s.workspaces = s.workspaces.map((w) => (w.id === "ws-main" && w.name === "Workspace" ? { ...w, name: "Kargul" } : w));
+ }
+ return { ...s, version: STATE_VERSION };
+ },
partialize: (s) => {
const data: Partial<AppStore> = {};
for (const [k, v] of Object.entries(s)) if (typeof v !== "function") (data as Record<string, unknown>)[k] = v;
@@ -413,4 +421,4 @@ export const useAppStore = create<AppStore>()(
/** Read-only selector for the active workspace name. */
export const selectWorkspaceName = (s: AppStore) =>
- s.workspaces.find((w) => w.id === s.workspaceId)?.name ?? "Workspace";
+ s.workspaces.find((w) => w.id === s.workspaceId)?.name ?? "Kargul";