Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.
Go
docs(agents): desktop tabs share Zustand stores, so page-source state is per tab (MUL-9357) (#10692)
Jiayuan Zhang8c00ca97db23
diff --git a/AGENTS.md b/AGENTS.mdindex eb0bddd351..aa87023658 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -55,6 +55,7 @@ Docs-only changes can use link/reference checks and `git diff --check`; state th- TanStack Query owns API/server data. Zustand owns client state such as filters, drafts, modals, and tab layout; persist only durable preferences/drafts/layout, not server data or ephemeral UI state.- Web/desktop shared stores live in `packages/core/`. Desktop platform stores remain in desktop; mobile stores remain in mobile. Do not define stores in `packages/views/`.+- Desktop tabs in a window share one set of Zustand stores and mount one at a time; a web tab gets its own. State describing how the current page was reached (source list, selection, highlight) must not assume one page: a click that opens a new tab leaves the current page's record intact and still records the target tab's own (`sidebarTabIssuesByWorkspace` in `packages/core/inbox/selection-store.ts`).- On web/desktop, workspace identity is route-driven; platform mirrors exist only for request headers, storage namespaces, and reconnects. React Context is for platform plumbing, not a second server-state store.- Among stores, only auth/workspace stores may call `api.*` directly; other server interactions belong in queries/mutations.- Workspace-scoped query keys include `wsId`; account-level keys remain account-scoped. Hooks needing workspace context accept `wsId` unless guaranteed to run under its provider.