PR: #446: feat(agents): pin Atlas dock by default, drag-resize 50vw, persist prefs [Story-1778] by @ankitmaheshwari-com
View PR →
Story-1778

Atlas dock: pin-by-default, drag-resize to 50vw, cookie persist

The Atlas Agent Dock used to open as a fixed overlay floating on top of the workspace at a hardcoded 440px. This change makes it pinned by default (part of the layout, content reflows), adds a left-edge drag-to-resize handle, a pin/unpin toggle, and persists the choice per user in a cookie.

What changed

Pinned vs floating

Pinned + open: the aside drops its shadow/overlay and app-chrome.tsx reserves paddingRight = width on its root flex container, so the rail + page reflow beside the panel and never overlap. Unpinned restores today's fixed z-40 drawer-shadow overlay, content full-width beneath.

Drag-to-resize (340px–50vw)

The left-edge handle (ported from add-matter/step5-review/atlas-drawer.tsx) uses pointer capture and clampDockWidth. Floor 340px (matches the ACP min-w-[340px]); ceiling 50% of the viewport — width can never exceed half the screen, and a window resize re-clamps a previously-saved width down.

Pin toggle + i18n

A lucide Pin/PinOff button sits in the ACP header beside the Session menu and close. Labels Agents.pinPanel / Agents.unpinPanel / Agents.resizePanel ship in both en.json and hi.json.

Cookie persistence, no SSR flash

pinned + width persist in the atlas-dock-prefs cookie (sameSite=lax, path=/, ~180d, NOT httpOnly). The (workspace) layout reads it server-side and hydrates the store. Open/close stays ephemeral.

Where it lives

Verify

pnpm lint
pnpm typecheck
pnpm test
pnpm build

Stories: Agents/AgentDock (Pinned / Unpinned / Closed, live resize) and Agents/AgentChatPanel (WithPinToggle). Unit coverage in dock-prefs.test.ts (clamp/parse/cookie round-trip) and agent-dock-store.test.ts (pin default, persist, hydrate).

Files changed

13 file(s), +539 / -42 lines

Path Role + -
messages/en.jsonConfig+3-0
messages/hi.jsonConfig+3-0
src/app/[locale]/(workspace)/layout.tsxApp route+24-9
src/components/agents/agent-chat-panel.stories.tsxComponent+29-0
src/components/agents/agent-chat-panel.tsxComponent+30-1
src/components/agents/agent-dock-mount.tsxComponent+53-0
src/components/agents/agent-dock.stories.tsxComponent+36-4
src/components/agents/agent-dock.tsxComponent+84-10
src/components/app-chrome.tsxComponent+12-0
src/lib/agents/dock-prefs.test.tsLibrary+83-0
src/lib/agents/dock-prefs.tsLibrary+93-0
src/stores/agent-dock-store.test.tsTest+34-1
src/stores/agent-dock-store.tsSource+55-17