Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go

MUL-8521: feat(whats-new): in-app release highlights card and rail panel (#9851)

Jiayuan Zhangbcc811b4cf2f
diff --git a/packages/core/api/client.ts b/packages/core/api/client.ts
index d50098e8c2..9866a8f145 100644
--- a/packages/core/api/client.ts
+++ b/packages/core/api/client.ts
@@ -1094,6 +1094,16 @@ export class ApiClient {
});
}
+ async markWhatsNewSeen(version: string): Promise<User> {
+ const raw = await this.fetch<unknown>("/api/me/whats-new/seen", {
+ method: "POST",
+ body: JSON.stringify({ version }),
+ });
+ return parseWithFallback(raw, UserSchema, EMPTY_USER, {
+ endpoint: "POST /api/me/whats-new/seen",
+ });
+ }
+
async updateMe(data: UpdateMeRequest): Promise<User> {
const raw = await this.fetch<unknown>("/api/me", {
method: "PATCH",
diff --git a/packages/core/api/schemas.test.ts b/packages/core/api/schemas.test.ts
index 7f35f31e33..8cba67fdfd 100644
--- a/packages/core/api/schemas.test.ts
+++ b/packages/core/api/schemas.test.ts
@@ -1085,6 +1085,35 @@ describe("UserSchema timezone drift", () => {
});
});
+describe("UserSchema whats_new_seen_version drift", () => {
+ const base = {
+ id: "11111111-1111-1111-1111-111111111111",
+ name: "Ada",
+ email: "[email protected]",
+ };
+
+ it("leaves the field undefined when an older server omits it", () => {
+ const parsed = UserSchema.parse(base);
+ expect(parsed.whats_new_seen_version).toBeUndefined();
+ });
+
+ it("keeps null and string values distinct from absence", () => {
+ expect(UserSchema.parse({ ...base, whats_new_seen_version: null }).whats_new_seen_version).toBe(null);
+ expect(UserSchema.parse({ ...base, whats_new_seen_version: "0.7.2" }).whats_new_seen_version).toBe("0.7.2");
+ });
+
+ it("degrades a wrong-type value to undefined without discarding the user", () => {
+ const parsed = parseWithFallback(
+ { ...base, whats_new_seen_version: 7 },
+ UserSchema,
+ EMPTY_USER,
+ { endpoint: "GET /api/me" },
+ );
+ expect(parsed.email).toBe("[email protected]");
+ expect(parsed.whats_new_seen_version).toBeUndefined();
+ });
+});
+
describe("SquadListSchema member preview drift", () => {
const baseSquad = {
id: "squad-1",
diff --git a/packages/core/api/schemas.ts b/packages/core/api/schemas.ts
index e66b084a2c..a2eb3b73e0 100644
--- a/packages/core/api/schemas.ts
+++ b/packages/core/api/schemas.ts
@@ -2729,6 +2729,9 @@ export const UserSchema = z.object({
language: z.string().nullable().default(null),
profile_description: z.string().default(""),
timezone: z.string().nullable().default(null),
+ // No default: absence is the "server cannot track" signal. A malformed
+ // value degrades to that state instead of discarding the whole user.
+ whats_new_seen_version: z.string().nullable().optional().catch(undefined),
created_at: z.string().default(""),
updated_at: z.string().default(""),
}).loose();
diff --git a/packages/core/package.json b/packages/core/package.json
index 19331012ad..e3da252a57 100644
--- a/packages/core/package.json
+++ b/packages/core/package.json
@@ -153,6 +153,7 @@
"./navigation": "./navigation/index.ts",
"./modals": "./modals/index.ts",
"./onboarding": "./onboarding/index.ts",
+ "./whats-new": "./whats-new/index.ts",
"./paths": "./paths/index.ts",
"./hooks": "./hooks.tsx",
"./hooks/*": "./hooks/*.ts",
diff --git a/packages/core/types/workspace.ts b/packages/core/types/workspace.ts
index 46821e6e81..0ee5f836c8 100644
--- a/packages/core/types/workspace.ts
+++ b/packages/core/types/workspace.ts
@@ -77,6 +77,12 @@ export interface User {
profile_description: string;
/** Pinned IANA tz; null means "use browser-detected tz at render time". */
timezone: string | null;
+ /**
+ * Newest release whose What's new highlights the user has dismissed.
+ * null = never dismissed; undefined = the server predates read tracking,
+ * so the client must not auto-open the card (it would reappear forever).
+ */
+ whats_new_seen_version?: string | null;
created_at: string;
updated_at: string;
}
diff --git a/packages/core/whats-new/index.test.ts b/packages/core/whats-new/index.test.ts
new file mode 100644
index 0000000000..55ef987222
--- /dev/null
+++ b/packages/core/whats-new/index.test.ts
@@ -0,0 +1,141 @@
+import { afterEach, describe, expect, it, vi } from "vitest";
+import type { User } from "../types";
+import { markWhatsNewSeen, parseVersion, unreadReleases, visibleReleases } from "./index";
+
+const api = vi.hoisted(() => ({ markWhatsNewSeen: vi.fn() }));
+const authStore = vi.hoisted(() => {
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
+ const { create } = require("zustand") as typeof import("zustand");
+ return create<{ user: User | null; setUser: (user: User) => void }>((set) => ({
+ user: null,
+ setUser: (user) => set({ user }),
+ }));
+});
+
+vi.mock("../api", () => ({ api }));
+vi.mock("../auth", () => ({ useAuthStore: authStore }));
+
+const releases = [
+ { version: "0.7.0", date: "2026-10-20" },
+ { version: "0.7.10", date: "2026-11-02" },
+ { version: "0.7.2", date: "2026-10-30" },
+ { version: "0.7.9", date: "2026-11-01" },
+];
+
+const versions = (rs: { version: string }[]) => rs.map((r) => r.version);
+
+describe("parseVersion", () => {
+ it("accepts a leading v and build suffixes", () => {
+ expect(parseVersion("v0.7.2-12-gabc")).toEqual([0, 7, 2]);
+ expect(parseVersion("1.2.3")).toEqual([1, 2, 3]);
+ });
+
+ it("rejects empty and partial versions", () => {
+ expect(parseVersion("")).toBeNull();
+ expect(parseVersion("0.7")).toBeNull();
+ expect(parseVersion(null)).toBeNull();
+ });
+});
+
+describe("visibleReleases", () => {
+ it("sorts newest first numerically", () => {
+ expect(versions(visibleReleases(releases, ""))).toEqual(["0.7.10", "0.7.9", "0.7.2", "0.7.0"]);
+ });
+
+ it("caps at the connected server version", () => {
+ expect(versions(visibleReleases(releases, "v0.7.2"))).toEqual(["0.7.2", "0.7.0"]);
+ });
+
+ it("applies no cap when the server version is unparseable", () => {
+ expect(visibleReleases(releases, "dev")).toHaveLength(4);
+ });
+});
+
+describe("unreadReleases", () => {
+ const visible = visibleReleases(releases, "");
+
+ it("returns nothing when the server cannot track the marker", () => {
+ expect(unreadReleases(visible, { created_at: "2026-01-01T00:00:00Z" })).toEqual([]);
+ expect(unreadReleases(visible, null)).toEqual([]);
+ });
+
+ it("returns releases newer than the seen marker", () => {
+ const user = { whats_new_seen_version: "0.7.2", created_at: "2026-01-01T00:00:00Z" };
+ expect(versions(unreadReleases(visible, user))).toEqual(["0.7.10", "0.7.9"]);
+ });
+
+ it("returns nothing once the newest release is seen", () => {
+ const user = { whats_new_seen_version: "0.7.10", created_at: "2026-01-01T00:00:00Z" };
+ expect(unreadReleases(visible, user)).toEqual([]);
+ });
+
+ it("counts only releases after signup before the first dismissal", () => {
+ const user = { whats_new_seen_version: null, created_at: "2026-10-30T09:00:00Z" };
+ expect(versions(unreadReleases(visible, user))).toEqual(["0.7.10", "0.7.9"]);
+ });
+});
+
+describe("markWhatsNewSeen", () => {
+ const ada = { id: "u-ada", whats_new_seen_version: "0.7.0" } as User;
+
+ function deferred<T>() {
+ let resolve!: (value: T) => void;
+ let reject!: (err: unknown) => void;
+ const promise = new Promise<T>((res, rej) => {
+ resolve = res;
+ reject = rej;
+ });
+ return { promise, resolve, reject };
+ }
+
+ afterEach(() => {
+ api.markWhatsNewSeen.mockReset();
+ authStore.setState({ user: null });
+ });
+
+ it("applies the marker before the server answers and keeps the server's value", async () => {
+ authStore.setState({ user: ada });
+ const pending = deferred<User>();
+ api.markWhatsNewSeen.mockReturnValue(pending.promise);
+
+ const done = markWhatsNewSeen("0.7.2");
+ expect(authStore.getState().user?.whats_new_seen_version).toBe("0.7.2");
+
+ pending.resolve({ ...ada, whats_new_seen_version: "0.7.3" });
+ await done;
+ expect(authStore.getState().user?.whats_new_seen_version).toBe("0.7.3");
+ });
+
+ it("rolls the marker back when the write fails so the next open retries", async () => {
+ authStore.setState({ user: ada });
+ api.markWhatsNewSeen.mockRejectedValue(new Error("offline"));
+
+ await expect(markWhatsNewSeen("0.7.2")).rejects.toThrow("offline");
+ expect(authStore.getState().user?.whats_new_seen_version).toBe("0.7.0");
+ });
+
+ it("does not sign a logged-out session back in when the response is late", async () => {
+ authStore.setState({ user: ada });
+ const pending = deferred<User>();
+ api.markWhatsNewSeen.mockReturnValue(pending.promise);
+
+ const done = markWhatsNewSeen("0.7.2");
+ authStore.setState({ user: null });
+ pending.resolve({ ...ada, whats_new_seen_version: "0.7.2" });
+ await done;
+ expect(authStore.getState().user).toBeNull();
+ });
+
+ it("leaves another account untouched after a switch", async () => {
+ authStore.setState({ user: ada });
+ const pending = deferred<User>();
+ api.markWhatsNewSeen.mockReturnValue(pending.promise);
+
+ const done = markWhatsNewSeen("0.7.2");
+ const bob = { id: "u-bob", whats_new_seen_version: null } as User;
+ authStore.setState({ user: bob });
+ pending.reject(new Error("aborted"));
+ await expect(done).rejects.toThrow("aborted");
+ expect(authStore.getState().user).toBe(bob);
+ });
+});
diff --git a/packages/core/whats-new/index.ts b/packages/core/whats-new/index.ts
new file mode 100644
index 0000000000..14e52345d0
--- /dev/null
+++ b/packages/core/whats-new/index.ts
@@ -0,0 +1,97 @@
+import { api } from "../api";
+import { useAuthStore } from "../auth";
+import type { User } from "../types";
+
+export interface ReleaseStamp {
+ /** MAJOR.MINOR.PATCH, matching the changelog and the server's semver check. */
+ version: string;
+ /** Release day, YYYY-MM-DD. */
+ date: string;
+}
+
+type Triple = [number, number, number];
+
+/**
+ * Parses MAJOR.MINOR.PATCH, tolerating a leading "v" and any prerelease or
+ * build suffix (server builds report e.g. "v0.7.2-12-gabc"). Returns null for
+ * anything else, including the empty string dev builds report.
+ */
+export function parseVersion(raw: string | null | undefined): Triple | null {
+ const match = /^v?(\d+)\.(\d+)\.(\d+)/.exec(raw?.trim() ?? "");
+ if (!match) return null;
+ return [Number(match[1]), Number(match[2]), Number(match[3])];
+}
+
+export function compareVersions(a: Triple, b: Triple): number {
+ return a[0] - b[0] || a[1] - b[1] || a[2] - b[2];
+}
+
+/**
+ * Releases the client can announce: those not newer than the connected
+ * server, since a self-hosted server can lag the client bundle and must not
+ * advertise features it doesn't run. An unknown server version (managed
+ * cloud, dev builds) applies no cap. Result is newest first.
+ */
+export function visibleReleases<R extends ReleaseStamp>(
+ releases: readonly R[],
+ serverVersion: string,
+): R[] {
+ const cap = parseVersion(serverVersion);
+ return releases
+ .filter((r) => {
+ const v = parseVersion(r.version);
+ return v !== null && (cap === null || compareVersions(v, cap) <= 0);
+ })
+ .sort((a, b) => compareVersions(parseVersion(b.version)!, parseVersion(a.version)!));
+}
+
+/**
+ * Releases the user hasn't seen. Before the first dismissal, only releases
+ * after the account's creation day count, so a new user isn't greeted with
+ * the whole backlog. Returns [] when the server can't persist the marker
+ * (`whats_new_seen_version` undefined): an auto-opening card that can never
+ * be dismissed would reappear on every launch.
+ */
+export function unreadReleases<R extends ReleaseStamp>(
+ visible: readonly R[],
+ user: Pick<User, "whats_new_seen_version" | "created_at"> | null,
+): R[] {
+ if (!user || user.whats_new_seen_version === undefined) return [];
+ const seen = parseVersion(user.whats_new_seen_version);
+ if (seen) {
+ return visible.filter((r) => compareVersions(parseVersion(r.version)!, seen) > 0);
+ }
+ const joined = user.created_at.slice(0, 10);
+ if (!joined) return [];
+ return visible.filter((r) => r.date > joined);
+}
+
+/**
+ * Persists the dismissal. Applied optimistically so the rail dot clears at
+ * once, and rolled back on failure so the dot returns and the next open
+ * retries. The server only advances the marker, so the response may carry a
+ * newer version than `version`.
+ */
+export async function markWhatsNewSeen(version: string): Promise<void> {
+ const requester = useAuthStore.getState().user;
+ if (!requester) return;
+ const previous = requester.whats_new_seen_version;
+
+ // Writes only the marker, and only onto the account that made the request
+ // while it is still signed in: the response can land after a logout or an
+ // account switch, and must not resurrect or overwrite that session.
+ const applyMarker = (value: string | null | undefined) => {
+ const current = useAuthStore.getState().user;
+ if (current?.id !== requester.id) return;
+ useAuthStore.getState().setUser({ ...current, whats_new_seen_version: value });
+ };
+
+ applyMarker(version);
+ try {
+ const user = await api.markWhatsNewSeen(version);
+ if (user.id === requester.id) applyMarker(user.whats_new_seen_version);
+ } catch (err) {
+ if (useAuthStore.getState().user?.whats_new_seen_version === version) applyMarker(previous);
+ throw err;
+ }
+}
diff --git a/packages/ui/icons/drawings/drawings.mjs b/packages/ui/icons/drawings/drawings.mjs
index 35d52625db..a602e3fa0a 100644
--- a/packages/ui/icons/drawings/drawings.mjs
+++ b/packages/ui/icons/drawings/drawings.mjs
@@ -372,6 +372,7 @@ Object.assign(DRAWINGS, {
Bug: `<path class="b" d="${rect(6.5, 7.5, 11, 13.5, 5.5)}"/><path d="M8.75 7.5a3.25 3.25 0 0 1 6.5 0M6.5 12H3.5M20.5 12h-3M6.5 17H3.5M20.5 17h-3"/>`,
Box: `<path class="b" d="${box}"/><path class="k" d="M3.75 7.5 12 12l8.25-4.5M12 12v9.25"/>`,
Package: `<path class="b" d="${box}"/><path class="k" d="M3.75 7.5 12 12l8.25-4.5M12 12v9.25M7.75 5.1l8.5 4.75"/>`,
+ Gift: `<path class="b" d="${rect(3.25, 7.75, 17.5, 4.75, 1.75)}"/><path d="${shape([[4.75, 12.5, 0], [19.25, 12.5, 0], [19.25, 20.75, 3.5], [4.75, 20.75, 3.5]])}"/><path class="k" d="M12 7.75v13"/><path d="M12 7.75C10.75 4.5 7.25 3.5 7.25 5.75c0 1.5 2 2 4.75 2ZM12 7.75c1.25-3.25 4.75-4.25 4.75-2 0 1.5-2 2-4.75 2Z"/>`,
Briefcase: `<path class="b" d="${rect(2.75, 7, 18.5, 13.5, 5.5)}"/><path d="M8.5 7V5.25c0-.83.67-1.5 1.5-1.5h4c.83 0 1.5.67 1.5 1.5V7"/>`,
Compass: `<circle class="b" cx="12" cy="12" r="9.25"/><path class="k" d="${shape([[15.75, 8.25, 1], [13.6, 13.6, 1], [8.25, 15.75, 1], [10.4, 10.4, 1]])}"/>`,
Database: `<ellipse class="b" cx="12" cy="5.5" rx="8" ry="2.75"/><path d="M4 5.5v13c0 1.5 3.6 2.75 8 2.75s8-1.25 8-2.75v-13M4 12c0 1.5 3.6 2.75 8 2.75s8-1.25 8-2.75"/>`,
diff --git a/packages/ui/icons/glyphs.ts b/packages/ui/icons/glyphs.ts
index 0b10333130..654fc57f05 100644
--- a/packages/ui/icons/glyphs.ts
+++ b/packages/ui/icons/glyphs.ts
@@ -118,6 +118,7 @@ export const FolderOpen: IconNode = [["path",{"d":"M2.75 19.5 L2.75 7 C2.75 5.38
export const FolderPlus: IconNode = [["path",{"d":"M2.75 7 C2.75 5.38 2.75 4.7 3.22 4.22 C3.7 3.75 4.38 3.75 6 3.75 L7.75 3.75 C8.5 3.75 8.81 3.75 9.18 3.91 C9.54 4.08 9.75 4.31 10.25 4.86 L10.5 5.14 C11 5.69 11.21 5.92 11.57 6.09 C11.94 6.25 12.25 6.25 13 6.25 L16.75 6.25 C19 6.25 19.93 6.25 20.59 6.91 C21.25 7.57 21.25 8.5 21.25 10.75 L21.25 14.25 C21.25 17.25 21.25 18.49 20.37 19.37 C19.49 20.25 18.25 20.25 15.25 20.25 L8.75 20.25 C5.75 20.25 4.51 20.25 3.63 19.37 C2.75 18.49 2.75 17.25 2.75 14.25 Z","className":"icon-body"}],["path",{"d":"M12 10.25v6M9 13.25h6","className":"icon-cut"}]];
export const Frame: IconNode = [["path",{"d":"M2.75 7h18.5M2.75 17h18.5M7 2.75v18.5M17 2.75v18.5"}]];
export const Gauge: IconNode = [["path",{"d":"M4.25 18.5a9.25 9.25 0 1 1 15.5 0"}],["path",{"d":"m12 14 3.75-3.75"}]];
+export const Gift: IconNode = [["path",{"d":"M3.25 9.5 C3.25 8.63 3.25 8.26 3.51 8.01 C3.76 7.75 4.13 7.75 5 7.75 L19 7.75 C19.88 7.75 20.24 7.75 20.49 8.01 C20.75 8.26 20.75 8.63 20.75 9.5 L20.75 10.75 C20.75 11.63 20.75 11.99 20.49 12.24 C20.24 12.5 19.88 12.5 19 12.5 L5 12.5 C4.13 12.5 3.76 12.5 3.51 12.24 C3.25 11.99 3.25 11.63 3.25 10.75 Z","className":"icon-body"}],["path",{"d":"M4.75 12.5 C4.75 12.5 4.75 12.5 4.75 12.5 C4.75 12.5 4.75 12.5 4.75 12.5 L19.25 12.5 C19.25 12.5 19.25 12.5 19.25 12.5 C19.25 12.5 19.25 12.5 19.25 12.5 L19.25 17.25 C19.25 19 19.25 19.72 18.74 20.24 C18.22 20.75 17.5 20.75 15.75 20.75 L8.25 20.75 C6.5 20.75 5.78 20.75 5.26 20.24 C4.75 19.72 4.75 19 4.75 17.25 Z"}],["path",{"d":"M12 7.75v13","className":"icon-cut"}],["path",{"d":"M12 7.75C10.75 4.5 7.25 3.5 7.25 5.75c0 1.5 2 2 4.75 2ZM12 7.75c1.25-3.25 4.75-4.25 4.75-2 0 1.5-2 2-4.75 2Z"}]];
export const GitBranch: IconNode = [["circle",{"cx":"6.5","cy":"18","r":"2.75"}],["circle",{"cx":"17.5","cy":"6.5","r":"2.75"}],["path",{"d":"M6.5 3v12.25M17.5 9.25c0 4.8-3.45 8.75-8.25 8.75"}]];
export const GitMerge: IconNode = [["circle",{"cx":"6.5","cy":"5.75","r":"2.75"}],["circle",{"cx":"17.5","cy":"17.25","r":"2.75"}],["path",{"d":"M6.5 8.5v12.75M6.5 8.5c0 4.8 3.45 8.75 8.25 8.75"}]];
export const GitPullRequest: IconNode = [["circle",{"cx":"6.25","cy":"6","r":"2.75"}],["circle",{"cx":"17.75","cy":"18","r":"2.75"}],["path",{"d":"M6.25 8.75v12.5M12.75 6h2.5a2.5 2.5 0 0 1 2.5 2.5v6.75M15 3.5L12.75 6 15 8.5"}]];
diff --git a/packages/ui/icons/index.ts b/packages/ui/icons/index.ts
index eed2d3b062..5eeade56f8 100644
--- a/packages/ui/icons/index.ts
+++ b/packages/ui/icons/index.ts
@@ -133,6 +133,7 @@ export const FolderOpen = /* @__PURE__ */ createIcon("FolderOpen", glyph.FolderO
export const FolderPlus = /* @__PURE__ */ createIcon("FolderPlus", glyph.FolderPlus);
export const Frame = /* @__PURE__ */ createIcon("Frame", glyph.Frame);
export const Gauge = /* @__PURE__ */ createIcon("Gauge", glyph.Gauge);
+export const Gift = /* @__PURE__ */ createIcon("Gift", glyph.Gift);
export const GitBranch = /* @__PURE__ */ createIcon("GitBranch", glyph.GitBranch);
export const GitMerge = /* @__PURE__ */ createIcon("GitMerge", glyph.GitMerge);
export const GitPullRequest = /* @__PURE__ */ createIcon("GitPullRequest", glyph.GitPullRequest);
diff --git a/packages/views/layout/app-rail.test.tsx b/packages/views/layout/app-rail.test.tsx
index d9b44f2927..40d6f64369 100644
--- a/packages/views/layout/app-rail.test.tsx
+++ b/packages/views/layout/app-rail.test.tsx
@@ -62,6 +62,7 @@ vi.mock("./panels/team-status", () => ({
}));
vi.mock("./rail-workspaces", () => ({ RailWorkspaces: () => null }));
vi.mock("./help-launcher", () => ({ HelpLauncher: () => null }));
+vi.mock("../whats-new/whats-new-launcher", () => ({ WhatsNewLauncher: () => null }));
vi.mock("./account-menu", () => ({ AccountMenu: () => null }));
vi.mock("@multica/ui/components/common/tooltip-hint", () => ({
TooltipHint: ({ children }: { children: ReactNode }) => <>{children}</>,
diff --git a/packages/views/layout/app-rail.tsx b/packages/views/layout/app-rail.tsx
index cb361c9703..968f296863 100644
--- a/packages/views/layout/app-rail.tsx
+++ b/packages/views/layout/app-rail.tsx
@@ -20,6 +20,7 @@ import { cn } from "@multica/ui/lib/utils";
import { useAppForeground } from "../common/use-app-foreground";
import { useT } from "../i18n";
import { AppLink, useNavigation } from "../navigation";
+import { WhatsNewLauncher } from "../whats-new/whats-new-launcher";
import { AccountMenu } from "./account-menu";
import { useAppShell } from "./app-shell-context";
import { NewIssueButton, SearchButton } from "./global-actions";
@@ -243,6 +244,7 @@ export function AppRail({
))}
</ul>
<div className="mt-auto flex flex-col items-center gap-1 pt-2">
+ <WhatsNewLauncher />
<HelpLauncher />
<TooltipHint label={t(($) => $.nav.settings)} side="right">
<AppLink
diff --git a/packages/views/locales/en/layout.json b/packages/views/locales/en/layout.json
index b1a6aeced2..d349d889a3 100644
--- a/packages/views/locales/en/layout.json
+++ b/packages/views/locales/en/layout.json
@@ -38,6 +38,29 @@
"feedback": "Feedback",
"server_version": "Server version {{version}}"
},
+ "whats_new": {
+ "trigger": "What's new",
+ "card": {
+ "eyebrow": "Multica updated · {{range}}",
+ "title_one": "{{count}} new feature since your last visit",
+ "title_other": "{{count}} new features since your last visit",
+ "dismiss": "Dismiss",
+ "view_details": "View details",
+ "got_it": "Got it"
+ },
+ "panel": {
+ "title": "What's new",
+ "close": "Close",
+ "new": "New",
+ "release_notes": "v{{version}} release notes",
+ "full_changelog": "Full changelog"
+ },
+ "action": {
+ "try": "Try it",
+ "open": "Open",
+ "learn_more": "Learn more"
+ }
+ },
"workspace_loader": {
"loading_workspace": "Loading workspace…",
"loading_named_prefix": "Loading"
diff --git a/packages/views/locales/fr/layout.json b/packages/views/locales/fr/layout.json
index 931d9a7024..ee62af08f4 100644
--- a/packages/views/locales/fr/layout.json
+++ b/packages/views/locales/fr/layout.json
@@ -38,6 +38,29 @@
"feedback": "Faire un retour",
"server_version": "Version du serveur {{version}}"
},
+ "whats_new": {
+ "trigger": "Nouveautés",
+ "card": {
+ "eyebrow": "Multica mis à jour · {{range}}",
+ "title_one": "{{count}} nouveauté depuis votre dernière visite",
+ "title_other": "{{count}} nouveautés depuis votre dernière visite",
+ "dismiss": "Fermer",
+ "view_details": "Voir le détail",
+ "got_it": "Compris"
+ },
+ "panel": {
+ "title": "Nouveautés",
+ "close": "Fermer",
+ "new": "Nouveau",
+ "release_notes": "Journal des modifications v{{version}}",
+ "full_changelog": "Journal des modifications complet"
+ },
+ "action": {
+ "try": "Essayer",
+ "open": "Ouvrir",
+ "learn_more": "En savoir plus"
+ }
+ },
"workspace_loader": {
"loading_workspace": "Chargement de l'espace de travail…",
"loading_named_prefix": "Chargement"
diff --git a/packages/views/locales/ja/layout.json b/packages/views/locales/ja/layout.json
index 2d8c7e2f55..2a3ebedec2 100644
--- a/packages/views/locales/ja/layout.json
+++ b/packages/views/locales/ja/layout.json
@@ -38,6 +38,28 @@
"feedback": "フィードバック",
"server_version": "サーバーバージョン {{version}}"
},
+ "whats_new": {
+ "trigger": "新機能",
+ "card": {
+ "eyebrow": "Multica が更新されました · {{range}}",
+ "title_other": "前回の訪問以降、{{count}} 件の新機能が追加されました",
+ "dismiss": "閉じる",
+ "view_details": "詳細を見る",
+ "got_it": "了解"
+ },
+ "panel": {
+ "title": "新機能",
+ "close": "閉じる",
+ "new": "未読",
+ "release_notes": "v{{version}} の変更ログ",
+ "full_changelog": "すべての変更ログ"
+ },
+ "action": {
+ "try": "試してみる",
+ "open": "開く",
+ "learn_more": "詳しく見る"
+ }
+ },
"workspace_loader": {
"loading_workspace": "ワークスペースを読み込み中…",
"loading_named_prefix": "読み込み中"
diff --git a/packages/views/locales/ko/layout.json b/packages/views/locales/ko/layout.json
index 5396c9fc15..dc4b460092 100644
--- a/packages/views/locales/ko/layout.json
+++ b/packages/views/locales/ko/layout.json
@@ -38,6 +38,28 @@
"feedback": "피드백",
"server_version": "서버 버전 {{version}}"
},
+ "whats_new": {
+ "trigger": "새 기능",
+ "card": {
+ "eyebrow": "Multica 업데이트 · {{range}}",
+ "title_other": "마지막 방문 이후 새 기능 {{count}}개가 추가되었습니다",
+ "dismiss": "닫기",
+ "view_details": "자세히 보기",
+ "got_it": "확인"
+ },
+ "panel": {
+ "title": "새 기능",
+ "close": "닫기",
+ "new": "읽지 않음",
+ "release_notes": "v{{version}} 변경 로그",
+ "full_changelog": "전체 변경 로그"
+ },
+ "action": {
+ "try": "사용해 보기",
+ "open": "열기",
+ "learn_more": "자세히 알아보기"
+ }
+ },
"workspace_loader": {
"loading_workspace": "워크스페이스 로딩 중...",
"loading_named_prefix": "로딩 중"
diff --git a/packages/views/locales/zh-Hans/layout.json b/packages/views/locales/zh-Hans/layout.json
index 03b6d75299..461f397536 100644
--- a/packages/views/locales/zh-Hans/layout.json
+++ b/packages/views/locales/zh-Hans/layout.json
@@ -38,6 +38,28 @@
"feedback": "反馈",
"server_version": "服务器版本 {{version}}"
},
+ "whats_new": {
+ "trigger": "新功能",
+ "card": {
+ "eyebrow": "Multica 已更新 · {{range}}",
+ "title_other": "自你上次访问以来,新增了 {{count}} 项功能",
+ "dismiss": "关闭",
+ "view_details": "查看详情",
+ "got_it": "知道了"
+ },
+ "panel": {
+ "title": "新功能",
+ "close": "关闭",
+ "new": "未读",
+ "release_notes": "v{{version}} 更新日志",
+ "full_changelog": "完整更新日志"
+ },
+ "action": {
+ "try": "试一下",
+ "open": "前往",
+ "learn_more": "了解更多"
+ }
+ },
"workspace_loader": {
"loading_workspace": "正在加载工作区...",
"loading_named_prefix": "正在加载"
diff --git a/packages/views/locales/zh-Hant/layout.json b/packages/views/locales/zh-Hant/layout.json
index 58e9b186cc..12aca09026 100644
--- a/packages/views/locales/zh-Hant/layout.json
+++ b/packages/views/locales/zh-Hant/layout.json
@@ -38,6 +38,28 @@
"feedback": "反饋",
"server_version": "伺服器版本 {{version}}"
},
+ "whats_new": {
+ "trigger": "新功能",
+ "card": {
+ "eyebrow": "Multica 已更新 · {{range}}",
+ "title_other": "自你上次造訪以來,新增了 {{count}} 項功能",
+ "dismiss": "關閉",
+ "view_details": "查看詳情",
+ "got_it": "知道了"
+ },
+ "panel": {
+ "title": "新功能",
+ "close": "關閉",
+ "new": "未讀",
+ "release_notes": "v{{version}} 更新日誌",
+ "full_changelog": "完整更新日誌"
+ },
+ "action": {
+ "try": "試一下",
+ "open": "前往",
+ "learn_more": "了解更多"
+ }
+ },
"workspace_loader": {
"loading_workspace": "正在載入工作區...",
"loading_named_prefix": "正在載入"
diff --git a/packages/views/whats-new/highlight-action.tsx b/packages/views/whats-new/highlight-action.tsx
new file mode 100644
index 0000000000..c8c16c523d
--- /dev/null
+++ b/packages/views/whats-new/highlight-action.tsx
@@ -0,0 +1,87 @@
+"use client";
+
+import { ArrowRight, ArrowUpRight } from "@multica/ui/icons";
+import { Button } from "@multica/ui/components/ui/button";
+import { useShortcut } from "@multica/core/shortcuts";
+import { useWorkspacePaths } from "@multica/core/paths";
+import { ShortcutKeycaps } from "../common/shortcut-keycaps";
+import { useT } from "../i18n";
+import { useNavigation } from "../navigation";
+import { useSearchStore } from "../search/search-store";
+import type { HighlightAction } from "./releases";
+
+/**
+ * The call to action of one highlight. `onDone` runs after the action fires
+ * so the surrounding surface can close and record the dismissal.
+ */
+export function HighlightActionButton({
+ action,
+ variant,
+ onDone,
+}: {
+ action: HighlightAction;
+ /** "button" in the update card, "link" in the history panel. */
+ variant: "button" | "link";
+ onDone: () => void;
+}) {
+ const { t } = useT("layout");
+ const navigation = useNavigation();
+ const paths = useWorkspacePaths();
+ const searchShortcut = useShortcut("openSearch");
+
+ if (action.kind === "external") {
+ const label = t(($) => $.whats_new.action.learn_more);
+ return variant === "button" ? (
+ <Button
+ variant="outline"
+ size="sm"
+ render={<a href={action.href} target="_blank" rel="noopener noreferrer" onClick={onDone} />}
+ >
+ {label}
+ <ArrowUpRight className="text-faint-foreground" />
+ </Button>
+ ) : (
+ <a
+ href={action.href}
+ target="_blank"
+ rel="noopener noreferrer"
+ onClick={onDone}
+ className="inline-flex items-center gap-0.5 text-label font-medium text-brand hover:underline"
+ >
+ {label}
+ <ArrowUpRight className="size-3.5" />
+ </a>
+ );
+ }
+
+ const run = () => {
+ onDone();
+ if (action.kind === "command-palette") useSearchStore.getState().setOpen(true);
+ else navigation.push(action.to(paths));
+ };
+ const label =
+ action.kind === "command-palette"
+ ? t(($) => $.whats_new.action.try)
+ : t(($) => $.whats_new.action.open);
+
+ if (variant === "button") {
+ return (
+ <Button variant="outline" size="sm" onClick={run}>
+ {label}
+ {action.kind === "command-palette" && searchShortcut && (
+ <ShortcutKeycaps shortcut={searchShortcut} decorative />
+ )}
+ </Button>
+ );
+ }
+ return (
+ <button
+ type="button"
+ onClick={run}
+ className="inline-flex cursor-pointer items-center gap-0.5 text-label font-medium text-brand hover:underline"
+ >
+ {label}
+ <ArrowRight className="size-3.5" />
+ </button>
+ );
+}
diff --git a/packages/views/whats-new/releases.ts b/packages/views/whats-new/releases.ts
new file mode 100644
index 0000000000..49ff172ede
--- /dev/null
+++ b/packages/views/whats-new/releases.ts
@@ -0,0 +1,247 @@
+import { Command, Globe, ListPlus, Terminal, Users, Workflow, type IconComponent } from "@multica/ui/icons";
+import type { SupportedLocale } from "@multica/core/i18n";
+import type { WorkspacePaths } from "@multica/core/paths";
+import type { ReleaseStamp } from "@multica/core/whats-new";
+
+export interface HighlightCopy {
+ title: string;
+ /** How to use it, in one or two sentences — not what changed internally. */
+ body: string;
+}
+
+export type HighlightAction =
+ | { kind: "command-palette" }
+ | { kind: "route"; to: (paths: WorkspacePaths) => string }
+ | { kind: "external"; href: string };
+
+export interface WhatsNewHighlight {
+ /** Stable within its release; used as the React key and in tests. */
+ id: string;
+ icon: IconComponent;
+ /** English is required; a missing locale falls back to it. */
+ copy: { en: HighlightCopy } & Partial<Record<SupportedLocale, HighlightCopy>>;
+ action?: HighlightAction;
+ /** Image shown above the expanded highlight in the update card. */
+ media?: { src: string };
+}
+
+export interface WhatsNewRelease extends ReleaseStamp {
+ highlights: WhatsNewHighlight[];
+}
+
+/**
+ * In-app highlights per release, newest first. Not the changelog: only
+ * user-visible changes worth discovering, 0–3 per release, with copy that
+ * says how to use the feature. Fix-only releases get no entry, so they
+ * neither open the card nor light the rail dot. Versions and dates must
+ * match the changelog entry the highlights come from.
+ */
+export const WHATS_NEW_RELEASES: WhatsNewRelease[] = [
+ {
+ version: "0.7.2",
+ date: "2026-10-30",
+ highlights: [
+ {
+ id: "command-bar",
+ icon: Command,
+ action: { kind: "command-palette" },
+ copy: {
+ en: {
+ title: "A new command bar",
+ body: "Select a few issues and open the command bar to change them all at once. It also searches the workspace and turns a sentence into a new issue for an agent.",
+ },
+ "zh-Hans": {
+ title: "全新命令栏",
+ body: "选中几个任务后打开命令栏,就能一起修改。它还能搜索整个工作区,或把一句话变成交给智能体的新任务。",
+ },
+ "zh-Hant": {
+ title: "全新命令列",
+ body: "選取幾個任務後打開命令列,就能一起修改。它還能搜尋整個工作區,或把一句話變成交給 AI 代理的新任務。",
+ },
+ ja: {
+ title: "新しいコマンドバー",
+ body: "タスクをいくつか選んでコマンドバーを開くと、まとめて変更できます。ワークスペース全体の検索や、一文からエージェント向けの新しいタスクを作ることもできます。",
+ },
+ ko: {
+ title: "새 명령 바",
+ body: "태스크 몇 개를 선택하고 명령 바를 열면 한 번에 변경할 수 있습니다. 워크스페이스 전체를 검색하거나 한 문장으로 에이전트에게 맡길 새 태스크를 만들 수도 있습니다.",
+ },
+ fr: {
+ title: "Une nouvelle barre de commandes",
+ body: "Sélectionnez quelques tâches et ouvrez la barre de commandes pour les modifier en une fois. Elle cherche aussi dans tout l'espace de travail et transforme une phrase en nouvelle tâche pour un agent.",
+ },
+ },
+ },
+ {
+ id: "property-options",
+ icon: ListPlus,
+ copy: {
+ en: {
+ title: "Up to 200 property options",
+ body: "Single- and multi-select properties can hold up to 200 options, searchable by text or pinyin.",
+ },
+ "zh-Hans": {
+ title: "属性选项增至 200 个",
+ body: "单选和多选属性最多可设 200 个选项,支持按文字或拼音搜索。",
+ },
+ "zh-Hant": {
+ title: "屬性選項增至 200 個",
+ body: "單選和多選屬性最多可設 200 個選項,支援按文字或拼音搜尋。",
+ },
+ ja: {
+ title: "プロパティの選択肢が 200 個まで",
+ body: "単一選択・複数選択のプロパティに最大 200 個の選択肢を設定でき、文字やピンインで検索できます。",
+ },
+ ko: {
+ title: "속성 옵션 최대 200개",
+ body: "단일 선택과 다중 선택 속성에 옵션을 최대 200개까지 둘 수 있고, 텍스트나 병음으로 검색할 수 있습니다.",
+ },
+ fr: {
+ title: "Jusqu'à 200 options par propriété",
+ body: "Les propriétés à choix unique ou multiple acceptent jusqu'à 200 options, que l'on retrouve par texte ou en pinyin.",
+ },
+ },
+ },
+ ],
+ },
+ {
+ version: "0.7.1",
+ date: "2026-10-27",
+ highlights: [
+ {
+ id: "devin-cli",
+ icon: Terminal,
+ action: { kind: "route", to: (p) => p.runtimes() },
+ copy: {
+ en: {
+ title: "Run tasks on Devin CLI",
+ body: "Agents can run on your local Devin CLI, with session resume, project skills, and MCP.",
+ },
+ "zh-Hans": {
+ title: "用本机的 Devin CLI 运行任务",
+ body: "智能体可以在你本机的 Devin CLI 上运行,支持恢复会话、项目 skill 和 MCP。",
+ },
+ "zh-Hant": {
+ title: "用本機的 Devin CLI 執行任務",
+ body: "AI 代理可以在你本機的 Devin CLI 上執行,支援恢復工作階段、專案 skill 和 MCP。",
+ },
+ ja: {
+ title: "Devin CLI でタスクを実行",
+ body: "エージェントがローカルの Devin CLI で動くようになりました。セッションの再開、プロジェクトの skill、MCP に対応しています。",
+ },
+ ko: {
+ title: "Devin CLI로 태스크 실행",
+ body: "에이전트가 로컬 Devin CLI에서 실행됩니다. 세션 재개, 프로젝트 skill, MCP를 지원합니다.",
+ },
+ fr: {
+ title: "Exécutez des tâches sur Devin CLI",
+ body: "Les agents peuvent tourner sur votre Devin CLI local, avec reprise de session, skills de projet et MCP.",
+ },
+ },
+ },
+ {
+ id: "traditional-chinese",
+ icon: Globe,
+ action: { kind: "route", to: (p) => `${p.settings()}?tab=preferences` },
+ copy: {
+ en: {
+ title: "Multica in Traditional Chinese",
+ body: "Switch the app language in Settings → Preferences.",
+ },
+ "zh-Hans": {
+ title: "支持繁体中文",
+ body: "在 设置 → 偏好设置 中切换界面语言。",
+ },
+ "zh-Hant": {
+ title: "支援繁體中文",
+ body: "在 設定 → 偏好設定 中切換介面語言。",
+ },
+ ja: {
+ title: "繁体字中国語に対応",
+ body: "設定 → 環境設定 で表示言語を切り替えられます。",
+ },
+ ko: {
+ title: "번체 중국어 지원",
+ body: "설정 → 환경설정에서 앱 언어를 바꿀 수 있습니다.",
+ },
+ fr: {
+ title: "Multica en chinois traditionnel",
+ body: "Changez la langue de l'application dans Paramètres → Préférences.",
+ },
+ },
+ },
+ ],
+ },
+ {
+ version: "0.7.0",
+ date: "2026-10-23",
+ highlights: [
+ {
+ id: "workflows-for-everyone",
+ icon: Workflow,
+ action: { kind: "route", to: (p) => `${p.settings()}?tab=workflows` },
+ copy: {
+ en: {
+ title: "Every member can create workflows",
+ body: "Any member can create and duplicate workflows. Creators and admins can edit them and set up handoffs.",
+ },
+ "zh-Hans": {
+ title: "所有成员都能创建工作流",
+ body: "任何成员都可以创建和复制工作流,创建者和管理员可以编辑并设置交接。",
+ },
+ "zh-Hant": {
+ title: "所有成員都能建立工作流",
+ body: "任何成員都可以建立和複製工作流,建立者和管理員可以編輯並設定交接。",
+ },
+ ja: {
+ title: "全メンバーがワークフローを作成可能に",
+ body: "どのメンバーもワークフローを作成・複製できます。作成者と管理者は編集や引き継ぎの設定ができます。",
+ },
+ ko: {
+ title: "모든 멤버가 워크플로 생성 가능",
+ body: "모든 멤버가 워크플로를 만들고 복제할 수 있습니다. 생성자와 관리자는 편집하고 인계를 설정할 수 있습니다.",
+ },
+ fr: {
+ title: "Tous les membres créent des workflows",
+ body: "Chaque membre peut créer et dupliquer des workflows. Les créateurs et les admins peuvent les modifier et configurer les transferts.",
+ },
+ },
+ },
+ {
+ id: "runtime-sharing",
+ icon: Users,
+ action: { kind: "route", to: (p) => p.runtimes() },
+ copy: {
+ en: {
+ title: "Share a runtime with chosen members",
+ body: "Pick exactly who can use a runtime, not just everyone or only you. Tightening access shows the affected agents first.",
+ },
+ "zh-Hans": {
+ title: "把运行时共享给指定成员",
+ body: "可以精确选择谁能使用某个运行时,而不只是所有人或仅自己。收紧权限前会先列出受影响的智能体。",
+ },
+ "zh-Hant": {
+ title: "把執行時共享給指定成員",
+ body: "可以精確選擇誰能使用某個執行時,而不只是所有人或僅自己。收緊權限前會先列出受影響的 AI 代理。",
+ },
+ ja: {
+ title: "ランタイムを特定のメンバーと共有",
+ body: "全員か自分だけかではなく、ランタイムを使える人を個別に選べます。権限を絞る前に影響を受けるエージェントが表示されます。",
+ },
+ ko: {
+ title: "선택한 멤버와 런타임 공유",
+ body: "모두 또는 나만이 아니라 런타임을 쓸 사람을 직접 고를 수 있습니다. 권한을 줄이기 전에 영향을 받는 에이전트를 먼저 보여 줍니다.",
+ },
+ fr: {
+ title: "Partagez un runtime avec des membres choisis",
+ body: "Choisissez précisément qui peut utiliser un runtime, pas seulement tout le monde ou vous seul. Restreindre l'accès affiche d'abord les agents concernés.",
+ },
+ },
+ },
+ ],
+ },
+];
+
+export function highlightCopy(highlight: WhatsNewHighlight, language: string): HighlightCopy {
+ return highlight.copy[language as SupportedLocale] ?? highlight.copy.en;
+}
diff --git a/packages/views/whats-new/session-store.ts b/packages/views/whats-new/session-store.ts
new file mode 100644
index 0000000000..e9872c3a9b
--- /dev/null
+++ b/packages/views/whats-new/session-store.ts
@@ -0,0 +1,19 @@
+"use client";
+
+import { create } from "zustand";
+
+/**
+ * Page-session state shared by every mounted launcher. Narrow layouts mount
+ * a hidden rail and the compact nav sheet's rail side by side, and the sheet
+ * remounts on every open, so a per-component flag would re-show a card the
+ * user already clicked away from.
+ */
+interface WhatsNewSessionStore {
+ autoShown: boolean;
+ markAutoShown: () => void;
+}
+
+export const useWhatsNewSessionStore = create<WhatsNewSessionStore>((set) => ({
+ autoShown: false,
+ markAutoShown: () => set({ autoShown: true }),
+}));
diff --git a/packages/views/whats-new/use-whats-new.ts b/packages/views/whats-new/use-whats-new.ts
new file mode 100644
index 0000000000..8b4b385b32
--- /dev/null
+++ b/packages/views/whats-new/use-whats-new.ts
@@ -0,0 +1,32 @@
+"use client";
+
+import { useCallback, useMemo } from "react";
+import { useAuthStore } from "@multica/core/auth";
+import { useConfigStore } from "@multica/core/config";
+import { createLogger } from "@multica/core/logger";
+import { markWhatsNewSeen, unreadReleases, visibleReleases } from "@multica/core/whats-new";
+import { WHATS_NEW_RELEASES, type WhatsNewRelease } from "./releases";
+
+const logger = createLogger("whats-new");
+
+export function useWhatsNew(releases: readonly WhatsNewRelease[] = WHATS_NEW_RELEASES) {
+ const user = useAuthStore((s) => s.user);
+ const serverVersion = useConfigStore((s) => s.serverVersion);
+
+ const visible = useMemo(
+ () => visibleReleases(releases.filter((r) => r.highlights.length > 0), serverVersion),
+ [releases, serverVersion],
+ );
+ const unread = useMemo(() => unreadReleases(visible, user), [visible, user]);
+
+ const newest = visible[0]?.version;
+ const hasUnread = unread.length > 0;
+ const markSeen = useCallback(() => {
+ if (!newest || !hasUnread) return;
+ markWhatsNewSeen(newest).catch((err) => {
+ logger.warn("failed to persist seen version", err);
+ });
+ }, [newest, hasUnread]);
+
+ return { visible, unread, markSeen };
+}
diff --git a/packages/views/whats-new/whats-new-card.tsx b/packages/views/whats-new/whats-new-card.tsx
new file mode 100644
index 0000000000..676e9acc7d
--- /dev/null
+++ b/packages/views/whats-new/whats-new-card.tsx
@@ -0,0 +1,100 @@
+"use client";
+
+import { useState } from "react";
+import { ChevronRight, X } from "@multica/ui/icons";
+import { Button } from "@multica/ui/components/ui/button";
+import { IconButton } from "@multica/ui/components/common/icon-button";
+import { useT } from "../i18n";
+import { HighlightActionButton } from "./highlight-action";
+import { highlightCopy, type WhatsNewRelease } from "./releases";
+
+/**
+ * The card that opens by itself after an update: every highlight released
+ * since the user's last dismissal, one expanded and the rest as rows.
+ */
+export function WhatsNewCard({
+ releases,
+ onDismiss,
+ onViewDetails,
+}: {
+ /** Unread releases, newest first. */
+ releases: WhatsNewRelease[];
+ onDismiss: () => void;
+ onViewDetails: () => void;
+}) {
+ const { t, i18n } = useT("layout");
+ const items = releases.flatMap((r) =>
+ r.highlights.map((highlight) => ({ key: `${r.version}:${highlight.id}`, highlight })),
+ );
+ const [selectedKey, setSelectedKey] = useState(items[0]?.key);
+ const selected = items.find((item) => item.key === selectedKey) ?? items[0];
+ if (!selected) return null;
+
+ const newest = releases[0]!.version;
+ const oldest = releases[releases.length - 1]!.version;
+ const range = newest === oldest ? `v${newest}` : `v${oldest} → v${newest}`;
+ const selectedCopy = highlightCopy(selected.highlight, i18n.language);
+
+ return (
+ <div className="flex flex-col" data-slot="whats-new-card">
+ <div className="flex items-start gap-2 pt-3.5 pr-2 pb-2.5 pl-4">
+ <div className="min-w-0 flex-1">
+ <p className="text-caption font-medium text-brand">
+ {t(($) => $.whats_new.card.eyebrow, { range })}
+ </p>
+ <h2 className="mt-0.5 text-title-sm font-semibold">
+ {t(($) => $.whats_new.card.title, { count: items.length })}
+ </h2>
+ </div>
+ <IconButton label={t(($) => $.whats_new.card.dismiss)} onClick={onDismiss}>
+ <X />
+ </IconButton>
+ </div>
+
+ <div className="max-h-[min(60vh,440px)] overflow-y-auto px-1.5 pb-1">
+ {selected.highlight.media && (
+ <div className="mx-1.5 mb-1.5 overflow-hidden rounded-lg bg-muted ring-1 ring-surface-border">
+ <img src={selected.highlight.media.src} alt="" className="h-40 w-full object-cover" />
+ </div>
+ )}
+ <div className="rounded-md bg-accent px-3 pt-2.5 pb-3">
+ <h3 className="text-body font-semibold">{selectedCopy.title}</h3>
+ <p className="mt-0.5 text-label text-muted-foreground">{selectedCopy.body}</p>
+ {selected.highlight.action && (
+ <div className="mt-2.5">
+ <HighlightActionButton action={selected.highlight.action} variant="button" onDone={onDismiss} />
+ </div>
+ )}
+ </div>
+ <ul className="mt-1">
+ {items
+ .filter((item) => item.key !== selected.key)
+ .map((item) => (
+ <li key={item.key}>
+ <button
+ type="button"
+ onClick={() => setSelectedKey(item.key)}
+ className="flex h-[34px] w-full cursor-pointer items-center gap-2.5 rounded-md px-3 text-left outline-none hover:bg-accent focus-visible:bg-accent"
+ >
+ <span aria-hidden className="size-1.5 shrink-0 rounded-full bg-brand" />
+ <span className="min-w-0 flex-1 truncate text-body font-medium">
+ {highlightCopy(item.highlight, i18n.language).title}
+ </span>
+ <ChevronRight className="size-3.5 shrink-0 text-faint-foreground" />
+ </button>
+ </li>
+ ))}
+ </ul>
+ </div>
+
+ <div className="flex items-center justify-end gap-1 border-t border-border py-2.5 pr-3 pl-4">
+ <Button variant="ghost" size="sm" onClick={onViewDetails}>
+ {t(($) => $.whats_new.card.view_details)}
+ </Button>
+ <Button size="sm" onClick={onDismiss}>
+ {t(($) => $.whats_new.card.got_it)}
+ </Button>
+ </div>
+ </div>
+ );
+}
diff --git a/packages/views/whats-new/whats-new-launcher.test.tsx b/packages/views/whats-new/whats-new-launcher.test.tsx
new file mode 100644
index 0000000000..181a9da697
--- /dev/null
+++ b/packages/views/whats-new/whats-new-launcher.test.tsx
@@ -0,0 +1,286 @@
+import type { ReactNode } from "react";
+import { act, fireEvent, render, screen } from "@testing-library/react";
+import { afterEach, beforeEach, describe, expect, it, onTestFinished, vi } from "vitest";
+import { configStore } from "@multica/core/config";
+import { Command, Globe, Terminal } from "@multica/ui/icons";
+import type { User } from "@multica/core/types";
+import enLayout from "../locales/en/layout.json";
+import { useSearchStore } from "../search/search-store";
+import type { WhatsNewRelease } from "./releases";
+import { useWhatsNewSessionStore } from "./session-store";
+import { AUTO_OPEN_DELAY_MS, WhatsNewLauncher } from "./whats-new-launcher";
+
+const mocks = vi.hoisted(() => ({
+ push: vi.fn(),
+ markWhatsNewSeen: vi.fn(),
+}));
+
+const authStore = vi.hoisted(() => {
+ // A real zustand store so optimistic updates re-render the launcher.
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
+ const { create } = require("zustand") as typeof import("zustand");
+ return create<{ user: Partial<User> | null }>(() => ({ user: null }));
+});
+
+vi.mock("@multica/core/auth", () => ({ useAuthStore: authStore }));
+
+vi.mock("@multica/core/whats-new", async () => {
+ const actual = await vi.importActual<typeof import("@multica/core/whats-new")>("@multica/core/whats-new");
+ return { ...actual, markWhatsNewSeen: mocks.markWhatsNewSeen };
+});
+
+vi.mock("@multica/core/paths", () => ({
+ useWorkspacePaths: () => ({ runtimes: () => "/acme/runtimes", settings: () => "/acme/settings" }),
+}));
+
+vi.mock("../navigation", () => ({ useNavigation: () => ({ push: mocks.push }) }));
+
+vi.mock("@multica/ui/components/common/tooltip-hint", () => ({
+ TooltipHint: ({ children }: { children: ReactNode }) => <>{children}</>,
+}));
+
+const RELEASES: WhatsNewRelease[] = [
+ {
+ version: "0.3.0",
+ date: "2026-03-01",
+ highlights: [
+ {
+ id: "palette",
+ icon: Command,
+ action: { kind: "command-palette" },
+ copy: { en: { title: "Palette title", body: "Palette body" } },
+ },
+ {
+ id: "runtimes",
+ icon: Terminal,
+ action: { kind: "route", to: (p) => p.runtimes() },
+ copy: { en: { title: "Runtimes title", body: "Runtimes body" } },
+ },
+ ],
+ },
+ {
+ version: "0.2.0",
+ date: "2026-02-01",
+ highlights: [
+ {
+ id: "language",
+ icon: Globe,
+ copy: { en: { title: "Language title", body: "Language body" }, fr: { title: "Titre langue", body: "Corps" } },
+ },
+ ],
+ },
+ {
+ version: "0.1.0",
+ date: "2026-01-01",
+ highlights: [{ id: "old", icon: Globe, copy: { en: { title: "Old title", body: "Old body" } } }],
+ },
+];
+
+vi.mock("./releases", async () => {
+ const actual = await vi.importActual<typeof import("./releases")>("./releases");
+ return {
+ ...actual,
+ get WHATS_NEW_RELEASES() {
+ return RELEASES;
+ },
+ };
+});
+
+const i18nState = vi.hoisted(() => ({ language: "en" }));
+
+// Resolves selectors against the real en/layout.json, including i18next's
+// `_one`/`_other` plural keys that the typed selector names without suffix.
+vi.mock("../i18n", () => ({
+ useT: () => ({
+ i18n: i18nState,
+ t: (sel: (r: unknown) => unknown, vars?: Record<string, string | number>) => {
+ const path: string[] = [];
+ const recorder: unknown = new Proxy({}, {
+ get: (_, key) => {
+ path.push(String(key));
+ return recorder;
+ },
+ });
+ sel(recorder);
+ const leaf = path.pop()!;
+ let node = enLayout as unknown as Record<string, unknown>;
+ for (const key of path) node = node[key] as Record<string, unknown>;
+ const plural = vars?.count === undefined ? leaf : `${leaf}_${vars.count === 1 ? "one" : "other"}`;
+ const template = String(node[leaf] ?? node[plural]);
+ return template.replace(/\{\{(\w+)\}\}/g, (_, key) => String(vars?.[key] ?? ""));
+ },
+ }),
+}));
+
+function signIn(user: Partial<User>) {
+ authStore.setState({ user: { id: "u-1", created_at: "2026-01-15T08:00:00Z", ...user } });
+}
+
+function renderLauncher() {
+ const view = render(<WhatsNewLauncher />);
+ act(() => {
+ vi.advanceTimersByTime(AUTO_OPEN_DELAY_MS);
+ });
+ return view;
+}
+
+const trigger = () => screen.getByRole("button", { name: "What's new" });
+const dot = () => document.querySelector('[data-slot="whats-new-dot"]');
+
+beforeEach(() => {
+ vi.useFakeTimers();
+ i18nState.language = "en";
+ mocks.markWhatsNewSeen.mockImplementation(async (version: string) => {
+ const user = authStore.getState().user;
+ authStore.setState({ user: { ...user, whats_new_seen_version: version } });
+ });
+});
+
+afterEach(() => {
+ vi.useRealTimers();
+ vi.clearAllMocks();
+ authStore.setState({ user: null });
+ configStore.getState().setServerVersion("");
+ useSearchStore.getState().setOpen(false);
+ useWhatsNewSessionStore.setState({ autoShown: false });
+});
+
+describe("WhatsNewLauncher", () => {
+ it("opens the update card with every highlight released since the last dismissal", () => {
+ signIn({ whats_new_seen_version: "0.1.0" });
+ renderLauncher();
+
+ expect(dot()).toBeInTheDocument();
+ expect(screen.getByText("Multica updated · v0.2.0 → v0.3.0")).toBeInTheDocument();
+ expect(screen.getByText("3 new features since your last visit")).toBeInTheDocument();
+ expect(screen.getByRole("heading", { name: "Palette title" })).toBeInTheDocument();
+ expect(screen.getByRole("button", { name: /Language title/ })).toBeInTheDocument();
+ expect(screen.queryByText("Old title")).not.toBeInTheDocument();
+ });
+
+ it("expands a row when it is clicked", () => {
+ signIn({ whats_new_seen_version: "0.1.0" });
+ renderLauncher();
+
+ fireEvent.click(screen.getByRole("button", { name: /Runtimes title/ }));
+ expect(screen.getByRole("heading", { name: "Runtimes title" })).toBeInTheDocument();
+ expect(screen.getByText("Runtimes body")).toBeInTheDocument();
+ expect(screen.getByRole("button", { name: /Palette title/ })).toBeInTheDocument();
+ });
+
+ it("records the newest release as seen when the card is acknowledged", () => {
+ signIn({ whats_new_seen_version: "0.1.0" });
+ renderLauncher();
+
+ fireEvent.click(screen.getByRole("button", { name: "Got it" }));
+ expect(mocks.markWhatsNewSeen).toHaveBeenCalledWith("0.3.0");
+ expect(dot()).not.toBeInTheDocument();
+ });
+
+ it("runs the highlight's action and dismisses the card", () => {
+ signIn({ whats_new_seen_version: "0.1.0" });
+ renderLauncher();
+
+ fireEvent.click(screen.getByRole("button", { name: /Try it/ }));
+ expect(useSearchStore.getState().open).toBe(true);
+ expect(mocks.markWhatsNewSeen).toHaveBeenCalledWith("0.3.0");
+ });
+
+ it("counts only releases after signup before the first dismissal", () => {
+ signIn({ whats_new_seen_version: null, created_at: "2026-02-10T08:00:00Z" });
+ renderLauncher();
+
+ expect(screen.getByText("Multica updated · v0.3.0")).toBeInTheDocument();
+ expect(screen.getByText("2 new features since your last visit")).toBeInTheDocument();
+ });
+
+ it("does not announce releases newer than the connected server", () => {
+ configStore.getState().setServerVersion("v0.2.0");
+ signIn({ whats_new_seen_version: "0.1.0" });
+ renderLauncher();
+
+ expect(screen.getByText("1 new feature since your last visit")).toBeInTheDocument();
+ expect(screen.queryByText("Palette title")).not.toBeInTheDocument();
+ });
+
+ it("stays quiet against a server that cannot record dismissals", () => {
+ signIn({});
+ renderLauncher();
+
+ expect(dot()).not.toBeInTheDocument();
+ expect(screen.queryByText(/since your last visit/)).not.toBeInTheDocument();
+
+ fireEvent.click(trigger());
+ expect(screen.getByRole("heading", { name: "What's new" })).toBeInTheDocument();
+ expect(mocks.markWhatsNewSeen).not.toHaveBeenCalled();
+ });
+
+ it("opens the full history from the rail and marks only unread releases as new", () => {
+ signIn({ whats_new_seen_version: "0.2.0" });
+ render(<WhatsNewLauncher />);
+
+ fireEvent.click(trigger());
+ expect(screen.getByRole("heading", { name: "What's new" })).toBeInTheDocument();
+ expect(mocks.markWhatsNewSeen).toHaveBeenCalledWith("0.3.0");
+
+ const newest = screen.getByRole("region", { name: "v0.3.0" });
+ const older = screen.getByRole("region", { name: "v0.2.0" });
+ expect(newest).toHaveTextContent("New");
+ expect(older).not.toHaveTextContent("New");
+ expect(screen.getByRole("link", { name: /v0.2.0 release notes/ })).toHaveAttribute(
+ "href",
+ "https://multica.ai/changelog#release-0-2-0",
+ );
+
+ fireEvent.click(screen.getByRole("button", { name: /Open/ }));
+ expect(mocks.push).toHaveBeenCalledWith("/acme/runtimes");
+ });
+
+ it("falls back to English copy for a locale without a translation", () => {
+ i18nState.language = "fr";
+ signIn({ whats_new_seen_version: "0.1.0" });
+ renderLauncher();
+
+ expect(screen.getByRole("heading", { name: "Palette title" })).toBeInTheDocument();
+ expect(screen.getByRole("button", { name: /Titre langue/ })).toBeInTheDocument();
+ });
+
+ it("auto-opens from the visible rail only, once per session", () => {
+ signIn({ whats_new_seen_version: "0.1.0" });
+ // Narrow layouts keep a display:none rail mounted next to the nav sheet's.
+ // jsdom has no checkVisibility, so stand one in for this test.
+ const visibility = vi.fn(() => false);
+ Object.defineProperty(HTMLElement.prototype, "checkVisibility", { value: visibility, configurable: true });
+ onTestFinished(() => {
+ delete (HTMLElement.prototype as Partial<HTMLElement>).checkVisibility;
+ });
+ const hidden = renderLauncher();
+ expect(screen.queryByText(/since your last visit/)).not.toBeInTheDocument();
+
+ visibility.mockReturnValue(true);
+ const sheet = renderLauncher();
+ expect(screen.getByText("3 new features since your last visit")).toBeInTheDocument();
+
+ // Clicking away and reopening the sheet remounts the launcher.
+ sheet.unmount();
+ hidden.unmount();
+ renderLauncher();
+ expect(screen.queryByText(/since your last visit/)).not.toBeInTheDocument();
+ expect(dot()).toBeInTheDocument();
+ });
+
+ it("keeps the dot and retries when recording the dismissal fails", async () => {
+ signIn({ whats_new_seen_version: "0.1.0" });
+ mocks.markWhatsNewSeen.mockRejectedValueOnce(new Error("offline"));
+ renderLauncher();
+
+ await act(async () => {
+ fireEvent.click(screen.getByRole("button", { name: "Got it" }));
+ });
+ expect(dot()).toBeInTheDocument();
+
+ fireEvent.click(trigger());
+ expect(mocks.markWhatsNewSeen).toHaveBeenCalledTimes(2);
+ expect(dot()).not.toBeInTheDocument();
+ });
+});
diff --git a/packages/views/whats-new/whats-new-launcher.tsx b/packages/views/whats-new/whats-new-launcher.tsx
new file mode 100644
index 0000000000..6a0fad0f1c
--- /dev/null
+++ b/packages/views/whats-new/whats-new-launcher.tsx
@@ -0,0 +1,114 @@
+"use client";
+
+import { useEffect, useRef, useState } from "react";
+import { Gift } from "@multica/ui/icons";
+import { Popover, PopoverContent, PopoverTrigger } from "@multica/ui/components/ui/popover";
+import { TooltipHint } from "@multica/ui/components/common/tooltip-hint";
+import { cn } from "@multica/ui/lib/utils";
+import { useT } from "../i18n";
+import { RAIL_ICON_BUTTON_CLASS } from "../layout/rail-styles";
+import type { WhatsNewRelease } from "./releases";
+import { useWhatsNewSessionStore } from "./session-store";
+import { useWhatsNew } from "./use-whats-new";
+import { WhatsNewCard } from "./whats-new-card";
+import { WhatsNewPanel } from "./whats-new-panel";
+
+/** Lets the workspace settle before the card slides in. */
+export const AUTO_OPEN_DELAY_MS = 1200;
+
+type View =
+ | { kind: "card"; releases: WhatsNewRelease[] }
+ | { kind: "panel"; unreadVersions: ReadonlySet<string> };
+
+/** A rail can be mounted but hidden (the md:flex rail on narrow screens). */
+function isRendered(el: HTMLElement | null): boolean {
+ if (!el) return false;
+ return typeof el.checkVisibility === "function" ? el.checkVisibility() : true;
+}
+
+/**
+ * Rail entry for release highlights. After an update the card opens by
+ * itself once per page session, from whichever launcher is on screen;
+ * dismissing it (or opening the panel) records the
+ * newest release as seen. Clicking away only hides the card, so the dot
+ * stays until the user acknowledges it.
+ */
+export function WhatsNewLauncher() {
+ const { t } = useT("layout");
+ const { visible, unread, markSeen } = useWhatsNew();
+ const [open, setOpen] = useState(false);
+ // Snapshotted on open: marking seen empties `unread` while the popup is
+ // still visible and animating out.
+ const [view, setView] = useState<View>({ kind: "panel", unreadVersions: new Set() });
+ const triggerRef = useRef<HTMLButtonElement>(null);
+ const hasUnread = unread.length > 0;
+
+ useEffect(() => {
+ if (unread.length === 0 || useWhatsNewSessionStore.getState().autoShown) return;
+ const timer = window.setTimeout(() => {
+ const session = useWhatsNewSessionStore.getState();
+ if (session.autoShown || !isRendered(triggerRef.current)) return;
+ session.markAutoShown();
+ setView({ kind: "card", releases: unread });
+ setOpen(true);
+ }, AUTO_OPEN_DELAY_MS);
+ return () => window.clearTimeout(timer);
+ }, [unread]);
+
+ if (visible.length === 0) return null;
+
+ const openPanel = () => {
+ setView({ kind: "panel", unreadVersions: new Set(unread.map((r) => r.version)) });
+ setOpen(true);
+ markSeen();
+ };
+ const dismiss = () => {
+ setOpen(false);
+ markSeen();
+ };
+ const label = t(($) => $.whats_new.trigger);
+
+ return (
+ <Popover
+ open={open}
+ onOpenChange={(next, details) => {
+ // Pressing the rail button while the card is up means "show me
+ // everything", not "close".
+ if (next || (view.kind === "card" && details.reason === "trigger-press")) openPanel();
+ else setOpen(false);
+ }}
+ >
+ <TooltipHint label={label} side="right">
+ <PopoverTrigger
+ ref={triggerRef}
+ aria-label={label}
+ data-unread={hasUnread || undefined}
+ className={RAIL_ICON_BUTTON_CLASS}
+ >
+ <Gift />
+ {hasUnread && (
+ <span
+ aria-hidden
+ data-slot="whats-new-dot"
+ className="absolute top-1.5 right-1.5 size-2 rounded-full bg-brand ring-2 ring-app-shell"
+ />
+ )}
+ </PopoverTrigger>
+ </TooltipHint>
+ <PopoverContent
+ side="right"
+ align="end"
+ sideOffset={8}
+ // An unprompted card must not pull focus out of whatever the user is typing in.
+ initialFocus={view.kind === "panel"}
+ className={cn("gap-0 overflow-hidden rounded-xl p-0", view.kind === "card" ? "w-[380px]" : "w-[400px]")}
+ >
+ {view.kind === "card" ? (
+ <WhatsNewCard releases={view.releases} onDismiss={dismiss} onViewDetails={openPanel} />
+ ) : (
+ <WhatsNewPanel releases={visible} unreadVersions={view.unreadVersions} onClose={() => setOpen(false)} />
+ )}
+ </PopoverContent>
+ </Popover>
+ );
+}
diff --git a/packages/views/whats-new/whats-new-panel.tsx b/packages/views/whats-new/whats-new-panel.tsx
new file mode 100644
index 0000000000..0fa6dd777f
--- /dev/null
+++ b/packages/views/whats-new/whats-new-panel.tsx
@@ -0,0 +1,120 @@
+"use client";
+
+import { ArrowUpRight, X } from "@multica/ui/icons";
+import { IconButton } from "@multica/ui/components/common/icon-button";
+import { cn } from "@multica/ui/lib/utils";
+import { useT } from "../i18n";
+import { CHANGELOG_URL } from "../layout/help-links";
+import { HighlightActionButton } from "./highlight-action";
+import { highlightCopy, type WhatsNewRelease } from "./releases";
+
+function versionLabel(version: string) {
+ return `v${version}`;
+}
+
+function releaseAnchor(version: string) {
+ return `${CHANGELOG_URL}#release-${version.replace(/\./g, "-")}`;
+}
+
+function formatReleaseDate(date: string, language: string) {
+ const parsed = new Date(`${date}T00:00:00Z`);
+ if (Number.isNaN(parsed.getTime())) return date;
+ return new Intl.DateTimeFormat(language, { month: "short", day: "numeric", timeZone: "UTC" }).format(parsed);
+}
+
+/** Every announced release, opened from the rail button. */
+export function WhatsNewPanel({
+ releases,
+ unreadVersions,
+ onClose,
+}: {
+ /** Newest first. */
+ releases: WhatsNewRelease[];
+ /** Releases to mark as new: captured when the panel opened, before the dismissal is recorded. */
+ unreadVersions: ReadonlySet<string>;
+ onClose: () => void;
+}) {
+ const { t, i18n } = useT("layout");
+
+ return (
+ <div className="flex flex-col" data-slot="whats-new-panel">
+ <div className="flex h-12 shrink-0 items-center gap-1.5 border-b border-border pr-2 pl-4">
+ <h2 className="flex-1 text-title-sm font-semibold">{t(($) => $.whats_new.panel.title)}</h2>
+ <IconButton label={t(($) => $.whats_new.panel.close)} onClick={onClose}>
+ <X />
+ </IconButton>
+ </div>
+
+ <div className="max-h-[min(70vh,560px)] overflow-y-auto p-4">
+ {releases.map((release, index) => {
+ const unread = unreadVersions.has(release.version);
+ return (
+ <section
+ key={release.version}
+ aria-label={versionLabel(release.version)}
+ className={cn(index > 0 && "mt-5 border-t border-border pt-5")}
+ >
+ <div className="mb-3 flex items-center gap-2 text-label">
+ <span className={cn("font-semibold tabular-nums", !unread && "text-muted-foreground")}>
+ {versionLabel(release.version)}
+ </span>
+ <span className="text-muted-foreground">{formatReleaseDate(release.date, i18n.language)}</span>
+ {unread && (
+ <span className="ml-auto inline-flex items-center gap-1.5 text-micro font-medium text-brand">
+ <span aria-hidden className="size-1.5 rounded-full bg-brand" />
+ {t(($) => $.whats_new.panel.new)}
+ </span>
+ )}
+ </div>
+ <ul className="flex flex-col gap-3.5">
+ {release.highlights.map((highlight) => {
+ const Icon = highlight.icon;
+ const copy = highlightCopy(highlight, i18n.language);
+ return (
+ <li key={highlight.id} className="flex gap-3">
+ <span className="grid size-8 shrink-0 place-items-center rounded-md bg-muted text-muted-foreground">
+ <Icon className="size-4" />
+ </span>
+ <div className="min-w-0">
+ <h3 className={cn("text-body font-medium", !unread && "text-muted-foreground")}>
+ {copy.title}
+ </h3>
+ <p className="text-label text-muted-foreground">{copy.body}</p>
+ {highlight.action && (
+ <div className="mt-0.5">
+ <HighlightActionButton action={highlight.action} variant="link" onDone={onClose} />
+ </div>
+ )}
+ </div>
+ </li>
+ );
+ })}
+ </ul>
+ <a
+ href={releaseAnchor(release.version)}
+ target="_blank"
+ rel="noopener noreferrer"
+ className="mt-3.5 inline-flex items-center gap-0.5 text-caption font-medium text-muted-foreground hover:text-foreground"
+ >
+ {t(($) => $.whats_new.panel.release_notes, { version: release.version })}
+ <ArrowUpRight className="size-3 text-faint-foreground" />
+ </a>
+ </section>
+ );
+ })}
+ </div>
+
+ <div className="flex h-11 shrink-0 items-center justify-end border-t border-border px-4">
+ <a
+ href={CHANGELOG_URL}
+ target="_blank"
+ rel="noopener noreferrer"
+ className="inline-flex items-center gap-0.5 text-label font-medium hover:underline"
+ >
+ {t(($) => $.whats_new.panel.full_changelog)}
+ <ArrowUpRight className="size-3.5 text-faint-foreground" />
+ </a>
+ </div>
+ </div>
+ );
+}
diff --git a/server/cmd/server/router.go b/server/cmd/server/router.go
index 31dae0118b..4418251b34 100644
--- a/server/cmd/server/router.go
+++ b/server/cmd/server/router.go
@@ -1719,6 +1719,7 @@ func NewRouterWithOptions(pool *pgxpool.Pool, hub *realtime.Hub, bus *events.Bus
r.Patch("/api/me/onboarding", h.PatchOnboarding)
r.Post("/api/me/onboarding/complete", h.CompleteOnboarding)
r.Post("/api/me/onboarding/cloud-waitlist", h.JoinCloudWaitlist)
+ r.Post("/api/me/whats-new/seen", h.MarkWhatsNewSeen)
// Credential minting is human-only (MUL-8154): an agent task token
// (mat_) or cloud-node PAT (mcn_) authenticates as its owner, so
// without this guard a prompt-injected agent could trade its scoped,
diff --git a/server/internal/handler/auth.go b/server/internal/handler/auth.go
index cecaa6e130..7277fa7d46 100644
--- a/server/internal/handler/auth.go
+++ b/server/internal/handler/auth.go
@@ -73,8 +73,11 @@ type UserResponse struct {
OnboardedAt *string `json:"onboarded_at"`
OnboardingQuestionnaire json.RawMessage `json:"onboarding_questionnaire"`
ProfileDescription string `json:"profile_description"`
- CreatedAt string `json:"created_at"`
- UpdatedAt string `json:"updated_at"`
+ // Always serialized (null when unset): clients treat a missing key as
+ // "server cannot track What's new" and suppress the auto-opening card.
+ WhatsNewSeenVersion *string `json:"whats_new_seen_version"`
+ CreatedAt string `json:"created_at"`
+ UpdatedAt string `json:"updated_at"`
}
// MaxProfileDescriptionLen caps the user-supplied profile_description body.
@@ -101,6 +104,7 @@ func (h *Handler) userToResponse(u db.User) UserResponse {
OnboardedAt: timestampToPtr(u.OnboardedAt),
OnboardingQuestionnaire: json.RawMessage(q),
ProfileDescription: u.ProfileDescription,
+ WhatsNewSeenVersion: textToPtr(u.WhatsNewSeenVersion),
CreatedAt: timestampToString(u.CreatedAt),
UpdatedAt: timestampToString(u.UpdatedAt),
}
diff --git a/server/internal/handler/whats_new.go b/server/internal/handler/whats_new.go
new file mode 100644
index 0000000000..5c474af4c0
--- /dev/null
+++ b/server/internal/handler/whats_new.go
@@ -0,0 +1,56 @@
+package handler
+
+import (
+ "encoding/json"
+ "errors"
+ "net/http"
+ "regexp"
+
+ "github.com/jackc/pgx/v5"
+
+ db "github.com/multica-ai/multica/server/pkg/db/generated"
+)
+
+// Bounded digit runs keep the advance query's int[] casts inside int32.
+var whatsNewVersionPattern = regexp.MustCompile(`^\d{1,6}\.\d{1,6}\.\d{1,6}$`)
+
+type markWhatsNewSeenRequest struct {
+ Version string `json:"version"`
+}
+
+// MarkWhatsNewSeen records the newest release whose highlights the user has
+// seen. The stored version only moves forward, so the response always carries
+// the effective value even when the request was stale.
+func (h *Handler) MarkWhatsNewSeen(w http.ResponseWriter, r *http.Request) {
+ userID, ok := requireUserID(w, r)
+ if !ok {
+ return
+ }
+ var req markWhatsNewSeenRequest
+ if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
+ writeError(w, http.StatusBadRequest, "invalid request body")
+ return
+ }
+ if !whatsNewVersionPattern.MatchString(req.Version) {
+ writeError(w, http.StatusBadRequest, "version must be MAJOR.MINOR.PATCH")
+ return
+ }
+
+ user, err := h.Queries.AdvanceWhatsNewSeenVersion(r.Context(), db.AdvanceWhatsNewSeenVersionParams{
+ ID: parseUUID(userID),
+ Version: req.Version,
+ })
+ if errors.Is(err, pgx.ErrNoRows) {
+ user, err = h.Queries.GetUser(r.Context(), parseUUID(userID))
+ if errors.Is(err, pgx.ErrNoRows) {
+ writeError(w, http.StatusUnauthorized, "user not found")
+ return
+ }
+ }
+ if err != nil {
+ writeError(w, http.StatusInternalServerError, "failed to update what's new state")
+ return
+ }
+
+ writeJSON(w, http.StatusOK, h.userToResponse(user))
+}
diff --git a/server/internal/handler/whats_new_test.go b/server/internal/handler/whats_new_test.go
new file mode 100644
index 0000000000..9f80c1ef5b
--- /dev/null
+++ b/server/internal/handler/whats_new_test.go
@@ -0,0 +1,110 @@
+package handler
+
+import (
+ "bytes"
+ "context"
+ "encoding/json"
+ "net/http"
+ "net/http/httptest"
+ "testing"
+)
+
+func markWhatsNewSeen(t *testing.T, userID string, body any) *httptest.ResponseRecorder {
+ t.Helper()
+ var buf bytes.Buffer
+ if err := json.NewEncoder(&buf).Encode(body); err != nil {
+ t.Fatalf("encode body: %v", err)
+ }
+ req := httptest.NewRequest("POST", "/api/me/whats-new/seen", &buf)
+ req.Header.Set("Content-Type", "application/json")
+ req.Header.Set("X-User-ID", userID)
+ w := httptest.NewRecorder()
+ testHandler.MarkWhatsNewSeen(w, req)
+ return w
+}
+
+func storedWhatsNewSeenVersion(t *testing.T, userID string) *string {
+ t.Helper()
+ var v *string
+ if err := testPool.QueryRow(context.Background(),
+ `SELECT whats_new_seen_version FROM "user" WHERE id = $1`, userID,
+ ).Scan(&v); err != nil {
+ t.Fatalf("lookup user: %v", err)
+ }
+ return v
+}
+
+func TestMarkWhatsNewSeenOnlyAdvances(t *testing.T) {
+ userID := newWaitlistTestUser(t, "[email protected]")
+
+ if v := storedWhatsNewSeenVersion(t, userID); v != nil {
+ t.Fatalf("new user should start with NULL, got %q", *v)
+ }
+
+ steps := []struct {
+ send string
+ want string
+ }{
+ {"0.7.9", "0.7.9"},
+ // Numeric, not lexicographic: 0.7.10 is newer than 0.7.9.
+ {"0.7.10", "0.7.10"},
+ // A stale client must not roll the marker back.
+ {"0.7.2", "0.7.10"},
+ {"0.7.10", "0.7.10"},
+ {"1.0.0", "1.0.0"},
+ }
+ for _, step := range steps {
+ w := markWhatsNewSeen(t, userID, map[string]string{"version": step.send})
+ if w.Code != http.StatusOK {
+ t.Fatalf("send %s: expected 200, got %d: %s", step.send, w.Code, w.Body.String())
+ }
+ var resp UserResponse
+ if err := json.Unmarshal(w.Body.Bytes(), &resp); err != nil {
+ t.Fatalf("decode response: %v", err)
+ }
+ if resp.WhatsNewSeenVersion == nil || *resp.WhatsNewSeenVersion != step.want {
+ t.Fatalf("send %s: response version = %v, want %s", step.send, resp.WhatsNewSeenVersion, step.want)
+ }
+ if v := storedWhatsNewSeenVersion(t, userID); v == nil || *v != step.want {
+ t.Fatalf("send %s: stored version = %v, want %s", step.send, v, step.want)
+ }
+ }
+}
+
+func TestMarkWhatsNewSeenRejectsMalformedVersion(t *testing.T) {
+ userID := newWaitlistTestUser(t, "[email protected]")
+
+ for _, version := range []string{"", "v0.7.2", "0.7", "0.7.2-beta", "0.7.2.1", "9999999.0.0", "a.b.c"} {
+ w := markWhatsNewSeen(t, userID, map[string]string{"version": version})
+ if w.Code != http.StatusBadRequest {
+ t.Fatalf("version %q: expected 400, got %d", version, w.Code)
+ }
+ }
+ if v := storedWhatsNewSeenVersion(t, userID); v != nil {
+ t.Fatalf("rejected requests must not write, got %q", *v)
+ }
+}
+
+func TestGetMeAlwaysSerializesWhatsNewSeenVersion(t *testing.T) {
+ userID := newWaitlistTestUser(t, "[email protected]")
+
+ req := httptest.NewRequest("GET", "/api/me", nil)
+ req.Header.Set("X-User-ID", userID)
+ w := httptest.NewRecorder()
+ testHandler.GetMe(w, req)
+ if w.Code != http.StatusOK {
+ t.Fatalf("expected 200, got %d: %s", w.Code, w.Body.String())
+ }
+
+ var raw map[string]json.RawMessage
+ if err := json.Unmarshal(w.Body.Bytes(), &raw); err != nil {
+ t.Fatalf("decode response: %v", err)
+ }
+ got, ok := raw["whats_new_seen_version"]
+ if !ok {
+ t.Fatal("whats_new_seen_version must be present so clients can detect support")
+ }
+ if string(got) != "null" {
+ t.Fatalf("expected null for a fresh user, got %s", got)
+ }
+}
diff --git a/server/migrations/611_user_whats_new_seen_version.down.sql b/server/migrations/611_user_whats_new_seen_version.down.sql
new file mode 100644
index 0000000000..fa129395f5
--- /dev/null
+++ b/server/migrations/611_user_whats_new_seen_version.down.sql
@@ -0,0 +1 @@
+ALTER TABLE "user" DROP COLUMN IF EXISTS whats_new_seen_version;
diff --git a/server/migrations/611_user_whats_new_seen_version.up.sql b/server/migrations/611_user_whats_new_seen_version.up.sql
new file mode 100644
index 0000000000..bb827ae567
--- /dev/null
+++ b/server/migrations/611_user_whats_new_seen_version.up.sql
@@ -0,0 +1,4 @@
+-- Newest release whose "What's new" highlights the user has seen, as
+-- MAJOR.MINOR.PATCH. NULL means the user has never dismissed the card; the
+-- client then counts releases dated after the account was created.
+ALTER TABLE "user" ADD COLUMN IF NOT EXISTS whats_new_seen_version TEXT;
diff --git a/server/pkg/db/generated/models.go b/server/pkg/db/generated/models.go
index 6ef60f450a..808d9e1142 100644
--- a/server/pkg/db/generated/models.go
+++ b/server/pkg/db/generated/models.go
@@ -1663,7 +1663,8 @@ type User struct {
Language pgtype.Text `json:"language"`
ProfileDescription string `json:"profile_description"`
// User-preferred IANA timezone for report rendering (Viewing tz). NULL means "use the browser-detected tz at render time". Affects dashboards, charts, and any "today" label shown to this user. Does not affect data materialisation — all rollups remain in UTC.
- Timezone pgtype.Text `json:"timezone"`
+ Timezone pgtype.Text `json:"timezone"`
+ WhatsNewSeenVersion pgtype.Text `json:"whats_new_seen_version"`
}
type UserComposioConnection struct {
diff --git a/server/pkg/db/generated/user.sql.go b/server/pkg/db/generated/user.sql.go
index da341bd844..624f6099e0 100644
--- a/server/pkg/db/generated/user.sql.go
+++ b/server/pkg/db/generated/user.sql.go
@@ -11,10 +11,55 @@ import (
"github.com/jackc/pgx/v5/pgtype"
)
+const advanceWhatsNewSeenVersion = `-- name: AdvanceWhatsNewSeenVersion :one
+UPDATE "user" SET
+ whats_new_seen_version = $1::text,
+ updated_at = now()
+WHERE id = $2
+ AND (
+ whats_new_seen_version IS NULL
+ OR string_to_array(whats_new_seen_version, '.')::int[] < string_to_array($1::text, '.')::int[]
+ )
+RETURNING id, name, email, avatar_url, created_at, updated_at, onboarded_at, onboarding_questionnaire, cloud_waitlist_email, cloud_waitlist_reason, starter_content_state, language, profile_description, timezone, whats_new_seen_version
+`
+
+type AdvanceWhatsNewSeenVersionParams struct {
+ Version string `json:"version"`
+ ID pgtype.UUID `json:"id"`
+}
+
+// Only moves forward: an older client reporting an older release must not
+// resurface highlights a newer client already dismissed. Both sides are
+// validated MAJOR.MINOR.PATCH strings, so the int[] casts cannot fail and
+// compare numerically (0.7.10 > 0.7.9). No row comes back when the stored
+// version is already at or past the requested one.
+func (q *Queries) AdvanceWhatsNewSeenVersion(ctx context.Context, arg AdvanceWhatsNewSeenVersionParams) (User, error) {
+ row := q.db.QueryRow(ctx, advanceWhatsNewSeenVersion, arg.Version, arg.ID)
+ var i User
+ err := row.Scan(
+ &i.ID,
+ &i.Name,
+ &i.Email,
+ &i.AvatarUrl,
+ &i.CreatedAt,
+ &i.UpdatedAt,
+ &i.OnboardedAt,
+ &i.OnboardingQuestionnaire,
+ &i.CloudWaitlistEmail,
+ &i.CloudWaitlistReason,
+ &i.StarterContentState,
+ &i.Language,
+ &i.ProfileDescription,
+ &i.Timezone,
+ &i.WhatsNewSeenVersion,
+ )
+ return i, err
+}
+
const createUser = `-- name: CreateUser :one
INSERT INTO "user" (name, email, avatar_url)
VALUES ($1, $2, $3)
-RETURNING id, name, email, avatar_url, created_at, updated_at, onboarded_at, onboarding_questionnaire, cloud_waitlist_email, cloud_waitlist_reason, starter_content_state, language, profile_description, timezone
+RETURNING id, name, email, avatar_url, created_at, updated_at, onboarded_at, onboarding_questionnaire, cloud_waitlist_email, cloud_waitlist_reason, starter_content_state, language, profile_description, timezone, whats_new_seen_version
`
type CreateUserParams struct {
@@ -41,12 +86,13 @@ func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (User, e
&i.Language,
&i.ProfileDescription,
&i.Timezone,
+ &i.WhatsNewSeenVersion,
)
return i, err
}
const getUser = `-- name: GetUser :one
-SELECT id, name, email, avatar_url, created_at, updated_at, onboarded_at, onboarding_questionnaire, cloud_waitlist_email, cloud_waitlist_reason, starter_content_state, language, profile_description, timezone FROM "user"
+SELECT id, name, email, avatar_url, created_at, updated_at, onboarded_at, onboarding_questionnaire, cloud_waitlist_email, cloud_waitlist_reason, starter_content_state, language, profile_description, timezone, whats_new_seen_version FROM "user"
WHERE id = $1
`
@@ -68,12 +114,13 @@ func (q *Queries) GetUser(ctx context.Context, id pgtype.UUID) (User, error) {
&i.Language,
&i.ProfileDescription,
&i.Timezone,
+ &i.WhatsNewSeenVersion,
)
return i, err
}
const getUserByEmail = `-- name: GetUserByEmail :one
-SELECT id, name, email, avatar_url, created_at, updated_at, onboarded_at, onboarding_questionnaire, cloud_waitlist_email, cloud_waitlist_reason, starter_content_state, language, profile_description, timezone FROM "user"
+SELECT id, name, email, avatar_url, created_at, updated_at, onboarded_at, onboarding_questionnaire, cloud_waitlist_email, cloud_waitlist_reason, starter_content_state, language, profile_description, timezone, whats_new_seen_version FROM "user"
WHERE email = $1
`
@@ -95,6 +142,7 @@ func (q *Queries) GetUserByEmail(ctx context.Context, email string) (User, error
&i.Language,
&i.ProfileDescription,
&i.Timezone,
+ &i.WhatsNewSeenVersion,
)
return i, err
}
@@ -145,7 +193,7 @@ UPDATE "user" SET
cloud_waitlist_reason = $3,
updated_at = now()
WHERE id = $1
-RETURNING id, name, email, avatar_url, created_at, updated_at, onboarded_at, onboarding_questionnaire, cloud_waitlist_email, cloud_waitlist_reason, starter_content_state, language, profile_description, timezone
+RETURNING id, name, email, avatar_url, created_at, updated_at, onboarded_at, onboarding_questionnaire, cloud_waitlist_email, cloud_waitlist_reason, starter_content_state, language, profile_description, timezone, whats_new_seen_version
`
type JoinCloudWaitlistParams struct {
@@ -175,6 +223,7 @@ func (q *Queries) JoinCloudWaitlist(ctx context.Context, arg JoinCloudWaitlistPa
&i.Language,
&i.ProfileDescription,
&i.Timezone,
+ &i.WhatsNewSeenVersion,
)
return i, err
}
@@ -184,7 +233,7 @@ UPDATE "user" SET
onboarded_at = COALESCE(onboarded_at, now()),
updated_at = now()
WHERE id = $1
-RETURNING id, name, email, avatar_url, created_at, updated_at, onboarded_at, onboarding_questionnaire, cloud_waitlist_email, cloud_waitlist_reason, starter_content_state, language, profile_description, timezone
+RETURNING id, name, email, avatar_url, created_at, updated_at, onboarded_at, onboarding_questionnaire, cloud_waitlist_email, cloud_waitlist_reason, starter_content_state, language, profile_description, timezone, whats_new_seen_version
`
func (q *Queries) MarkUserOnboarded(ctx context.Context, id pgtype.UUID) (User, error) {
@@ -205,6 +254,7 @@ func (q *Queries) MarkUserOnboarded(ctx context.Context, id pgtype.UUID) (User,
&i.Language,
&i.ProfileDescription,
&i.Timezone,
+ &i.WhatsNewSeenVersion,
)
return i, err
}
@@ -214,7 +264,7 @@ UPDATE "user" SET
onboarding_questionnaire = COALESCE($1, onboarding_questionnaire),
updated_at = now()
WHERE id = $2
-RETURNING id, name, email, avatar_url, created_at, updated_at, onboarded_at, onboarding_questionnaire, cloud_waitlist_email, cloud_waitlist_reason, starter_content_state, language, profile_description, timezone
+RETURNING id, name, email, avatar_url, created_at, updated_at, onboarded_at, onboarding_questionnaire, cloud_waitlist_email, cloud_waitlist_reason, starter_content_state, language, profile_description, timezone, whats_new_seen_version
`
type PatchUserOnboardingParams struct {
@@ -244,6 +294,7 @@ func (q *Queries) PatchUserOnboarding(ctx context.Context, arg PatchUserOnboardi
&i.Language,
&i.ProfileDescription,
&i.Timezone,
+ &i.WhatsNewSeenVersion,
)
return i, err
}
@@ -261,7 +312,7 @@ UPDATE "user" SET
END,
updated_at = now()
WHERE id = $1
-RETURNING id, name, email, avatar_url, created_at, updated_at, onboarded_at, onboarding_questionnaire, cloud_waitlist_email, cloud_waitlist_reason, starter_content_state, language, profile_description, timezone
+RETURNING id, name, email, avatar_url, created_at, updated_at, onboarded_at, onboarding_questionnaire, cloud_waitlist_email, cloud_waitlist_reason, starter_content_state, language, profile_description, timezone, whats_new_seen_version
`
type UpdateUserParams struct {
@@ -310,6 +361,7 @@ func (q *Queries) UpdateUser(ctx context.Context, arg UpdateUserParams) (User, e
&i.Language,
&i.ProfileDescription,
&i.Timezone,
+ &i.WhatsNewSeenVersion,
)
return i, err
}
diff --git a/server/pkg/db/queries/user.sql b/server/pkg/db/queries/user.sql
index 14fd23a54b..3a273097d3 100644
--- a/server/pkg/db/queries/user.sql
+++ b/server/pkg/db/queries/user.sql
@@ -63,6 +63,22 @@ UPDATE "user" SET
WHERE id = sqlc.arg('id')
RETURNING *;
+-- name: AdvanceWhatsNewSeenVersion :one
+-- Only moves forward: an older client reporting an older release must not
+-- resurface highlights a newer client already dismissed. Both sides are
+-- validated MAJOR.MINOR.PATCH strings, so the int[] casts cannot fail and
+-- compare numerically (0.7.10 > 0.7.9). No row comes back when the stored
+-- version is already at or past the requested one.
+UPDATE "user" SET
+ whats_new_seen_version = sqlc.arg('version')::text,
+ updated_at = now()
+WHERE id = sqlc.arg('id')
+ AND (
+ whats_new_seen_version IS NULL
+ OR string_to_array(whats_new_seen_version, '.')::int[] < string_to_array(sqlc.arg('version')::text, '.')::int[]
+ )
+RETURNING *;
+
-- name: JoinCloudWaitlist :one
-- Records interest in cloud runtimes. Does NOT mark onboarding
-- complete — the user still has to pick a real path (CLI / Skip)