Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.
Go
feat(chat): default floating chat window to on (#5113)
Jiayuan Zhang23e4f125b299
diff --git a/packages/core/chat/store.test.ts b/packages/core/chat/store.test.tsindex 302d83b999..227cbea0f1 100644--- a/packages/core/chat/store.test.ts+++ b/packages/core/chat/store.test.ts@@ -97,8 +97,15 @@ describe("chat store — draft attachments", () => {});describe("chat store — floating window preference", () => {- it("defaults OFF when no preference is stored (opt-in)", () => {+ it("defaults ON when no preference is stored", () => {const store = createChatStore({ storage: memStorage() });+ expect(store.getState().floatingChatEnabled).toBe(true);+ });++ it("honours an explicit stored 'false' preference (opt-out)", () => {+ const storage = memStorage();+ storage.setItem("multica:chat:floatingChatEnabled", "false");+ const store = createChatStore({ storage });expect(store.getState().floatingChatEnabled).toBe(false);});diff --git a/packages/core/chat/store.ts b/packages/core/chat/store.tsindex 182e1d40df..20b37e4841 100644--- a/packages/core/chat/store.ts+++ b/packages/core/chat/store.ts@@ -40,8 +40,8 @@ const OPEN_KEY = "multica:chat:isOpen";* Whether the floating chat window (FAB + overlay) is available at all,* persisted globally like OPEN_KEY. This is the Settings → Chat preference:* when off, the FAB/overlay never mount and Chat lives only in its tab.- * Missing key = default OFF — the floating window is opt-in, enabled from- * the Settings → Chat tab.+ * Missing key = default ON — the floating window is on by default and can+ * be turned off from the Settings → Chat tab.*/const FLOATING_KEY = "multica:chat:floatingChatEnabled";@@ -179,9 +179,10 @@ export function createChatStore(options: ChatStoreOptions) {const storedOpen = storage.getItem(OPEN_KEY);const initialIsOpen = storedOpen === "true";- // Default OFF: the floating window is opt-in — only an explicit "true"- // (set from the Settings → Chat tab) enables it.- const initialFloatingEnabled = storage.getItem(FLOATING_KEY) === "true";+ // Default ON: the floating window is enabled unless the user explicitly+ // turned it off ("false") from the Settings → Chat tab. A missing key+ // (new user) resolves to enabled.+ const initialFloatingEnabled = storage.getItem(FLOATING_KEY) !== "false";const store = create<ChatState>((set, get) => ({isOpen: initialIsOpen,diff --git a/packages/views/settings/components/chat-tab.tsx b/packages/views/settings/components/chat-tab.tsxindex 803585d398..36cb58f475 100644--- a/packages/views/settings/components/chat-tab.tsx+++ b/packages/views/settings/components/chat-tab.tsx@@ -6,8 +6,8 @@ import { useT } from "../../i18n";/*** Chat settings — its own tab under "My Account". Currently just the- * floating-window toggle: when off (the default), the FAB / overlay never- * mount and Chat is reachable only from its dedicated tab. The preference is+ * floating-window toggle: when off, the FAB / overlay never mount and Chat+ * is reachable only from its dedicated tab. It is on by default. The preference is* a persisted client setting (`floatingChatEnabled`), so it applies* immediately without a round-trip.*/