Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
b26e8c2
docs(plan): design mode v2 Phase 1b (chat pages) plan, reviewed
sambitcreate Nov 24, 2026
3761b53
fix(design): undo keeps deleted pages; chat page rules
sambitcreate Nov 24, 2026
84ce9ae
feat(design): saves keep main's chat pages and report them back
sambitcreate Nov 24, 2026
cd93962
feat(design): a chat falls back to its own page
sambitcreate Nov 24, 2026
278e3cd
fix(design): review fixes for chat page rules and claims
sambitcreate Nov 24, 2026
b3259ae
feat(design): a page made for a chat follows its title
sambitcreate Nov 24, 2026
9b77a80
feat(design): main can list the pages other chats look at
sambitcreate Nov 24, 2026
c437bac
feat(design): a chat claims its page when design mode opens
sambitcreate Nov 24, 2026
8cf4f06
feat(design): canvas_page use and pages other chats rely on
sambitcreate Nov 24, 2026
8da3e05
feat(design): a chat claims the page its first write lands on
sambitcreate Nov 24, 2026
fbdfd5a
fix(design): review fixes for chat page claims, entry and title follow
sambitcreate Nov 24, 2026
021e487
feat(design): chat delete takes its page claim and artifacts off the …
sambitcreate Nov 24, 2026
6c65034
feat(design): the page picker shows each page's chats
sambitcreate Nov 24, 2026
ce56763
feat(design): two chats keep their own pages; docs
sambitcreate Nov 24, 2026
d20e379
fix(design): final review fixes for chat pages
sambitcreate Nov 24, 2026
31d9289
docs(plan): Phase 1b is in review as PR #908
sambitcreate Nov 24, 2026
e88271d
fix(design): a placement writes nothing to a canvas its chat moved aw…
sambitcreate Nov 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion .memory/design-mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -364,4 +364,18 @@ Deviations from the P1 plan:
- Artifact frames load through `frame.chatId ?? the viewing chat`; main serves preview, export and source only when that chat exists and shares the workspace.
- Cleanup (`design-canvas/cleanup.ts`): chat delete prunes the chat's comments (no write when there are none) and its view, before and after the commit, using the workspace captured before the delete; it never deletes the canvas file. Workspace remove deletes the canvas, its corrupt copies and the views file.
- Attach (`design-canvas/carry.ts`, A8/A22): only with `fileAction: "copy"` and not a legacy shared scratch folder, right after the attach commits and before the hidden workspace is released, `appendCanvasPages` appends the hidden canvas's pages named "<chat title> · <page>", file and image frames follow the copied paths (`ScratchCopyTransaction.copied` `{ from, to }` pairs), frames whose files did not come are dropped, and the chat is shown the first new page. Over a limit or on an error nothing merges and the attach result has `canvasCarried: false`; the dialog toasts "The canvas was too large to bring along."
- Phase 1b still owns `chatPages` writes and `canvas_page use`.
- Phase 1b (below) added `chatPages` writes and `canvas_page use`.

## v2 Phase 1b: chat pages (2026-11-24)

Branch `t3/design-mode-v2-p1b`, stacked on PR #894. Plan `docs/superpowers/plans/2026-11-23-design-mode-v2-p1b-chat-pages.md`.
- Rules live in `renderer/shared/design-canvas/chat-pages.ts` (pure): `claimPage` (cap 2 000, evicts dead chats, else `ChatPagesFullError`), `addChatPage`, `uniquePageName` (60 chars, " 2"…), `followChatTitle`, `withLazyClaim`, `forgetChatOnCanvas`, `forgetChatMove`, `mergeSavedChatPages`, `deletedClaims`, `withoutGoneClaims`, `chatsOnCanvas`. The planned `chatPageId` was removed as unused: chat-aware page resolution lives in `designTurnPages` (main) and `useDesignView` (renderer). `DesignPage.namedFor` marks a page made for a chat; no schema bump.
- D1: only main claims, only for the acting chat: entry, the lazy claim (a design turn's first write), `canvas_page use`, attach carry. Every claim read/write is inside `store.update` on the latest doc; liveness (`designLiveChats` in `liveness.ts`: one chat-index `list(workspaceId)` per check; the chat exists and is in that workspace) is read before.
- D2 entry rules: keep a live claim; else the page holding most of the chat's written pages (not another live chat's); else the resolved page as it is when it isn't another live chat's `namedFor` (a gone chat's mark is stripped in the same write), no other live chat claims it, and it is empty or no other chat's kept view is on it (`DesignCanvasViews.pageIdsOf`); else a new page after it, named after the chat, `namedFor`. Entry always `show`s, then runs the title follow. The consent card's `enter` awaits entry (`awaitEntry`); lazy claims wait for a pending entry (`PendingEntries`).
- D3 saves: the store merges claims from the stored doc; a renderer save never adds a claim. An in-memory per-workspace delete record (`DeletedPage`: chat → where the delete moved it, plus `namedFor`; 200 pages, oldest out) lets an undo bring a page back with every recorded chat that is still where the delete moved it, whatever the saved copy says. A chat whose page a save removes goes to the page the save names for it when both docs have that page, else the first page (so undo/redo of a turn that added and used a page round-trips). The save answer carries `chatPages`/`namedFor` when the merge changed them; the renderer carries them into every kept step (no undo step). `changesBetween` applies page changes item by item.
- D4: `deletePage` moves the page's chats to the first page left. `canvas_page delete` refuses once (person's/locked frames and/or other live chats' claims, pluralised) unless `force: true`.
- D6: `chatStore.onTitleChanged` → `designTitleFollow.follow` (per-chat queue, reads the title at run time). `DesignCanvasStore.namedChats(workspaceId)` (refreshed on every read and write) lets a follow skip chats with no named page without reading the canvas. `renamePage` clears `namedFor`; duplicate and carry never copy it.
- D7: main resolves shown-this-turn → message page → kept view → claim → first; the renderer view → claim → newest earlier → first, and reports a fallback page to main.
- Lifecycle: `forgetChat(chatId, workspaceId, scope)`: `comments` before a delete commits, `all` (claim, `namedFor`, artifact frames) after; `move` for `moveEmptyToWorkspace` (also deletes an empty page made for the chat). Startup recovery uses `recoverDeletedChatCanvas` (cleanup.ts); when the chat's metadata is already gone (crash after the remove) it runs `all` on every canvas (`DesignCanvasStore.workspaceIds`), because the pending-deletion marker lives in the subagent run stores' strict V1 format and can't carry a workspace id. Attaching from a shared legacy No workspace canvas runs `move` on it. Attach carry claims the first carried page; at a full `chatPages` it asks liveness and evicts gone chats, else skips only the claim.
- Picker (`design-toolbar.tsx`): trailing tertiary label "This chat", "This chat · N more", "1 chat", "N chats"; accessible name "Page 1, This chat". Counts only, from the doc. Only entry, `canvas_page use` and `canvas_page delete` drop leftover claims and `namedFor` marks of chats that are not live; other `canvas_page` actions and other writes don't.
- E2E: `tests/e2e/design-canvas.spec.ts` "two chats on one workspace…" (screenshot `1440-canvas-two-chats-{light,dark}.png` in the test's output folder).
2 changes: 1 addition & 1 deletion PRODUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ First-run setup and Settings → Providers share an account, API key and local-m
- Settings → Storage shows how much disk Aiden uses on this computer, split into chats, logs, artifacts, browser data, voice models, Bot computers, saved work from removed worktrees, other app data and worktrees, with the largest worktrees and chats listed. Cleanup offers unused worktrees, one chat at a time, the browser cache (sign-ins kept) and logs behind a review that names what will be removed and how much it frees; voice models and Bot computers link to their own settings. Worktrees with uncommitted or unpushed work, a chat or terminal using them or a scheduled task in them are never removed, and cleanup re-checks that right before deleting. See [docs/storage.md](docs/storage.md).
- A provider's usage limit makes a reply wait, never switch to another model; limits that last days and billing problems fail at once with the reset time. Spending limits are the owner's: each chat, each Bot's month and each routine run can stop at a dollar amount counted from API-key requests only, and only the person can allow more (on the Mac or a paired phone). See [docs/usage-limits-and-spending.md](docs/usage-limits-and-spending.md).
- In chats with Web Search on, the agent can read a public web page. Opt-in extract mode, set up with the person's own Cloudflare account, returns only the named values it asks for, each with supporting page text; a value that is not on the page comes back as a guess, never as read.
- Design mode (desktop, on by default; `AIDEN_DESIGN_MODE=0` turns it off) puts a workspace chat beside an infinite design canvas. Design mode keeps one canvas per workspace, shared by its chats; each chat remembers its own page and view, so a pan, a zoom or a page switch in one chat never moves another. Canvases from earlier versions are cleared on first start; files under `design/` are untouched. Deleting a chat removes its comments from the canvas, removing a workspace deletes its canvas, and a No workspace chat attached to a workspace with its files copied brings its canvas pages along, named after the chat (attaching without copying the files leaves the canvas behind). Pages stay workspace HTML files served only to the canvas in a sandbox with no network; Aiden changes the canvas only in attended desktop turns, through its canvas tools or by an HTML page it writes, edits or makes with a command under the workspace's `design/` folder landing as a frame (and, when the person opens design mode, the pages the chat's earlier replies wrote landing on the chat's empty page), and a comment or an in-place word edit the person makes goes to Aiden only with their next message, while plain word edits are written into the page's file and can be undone. The first time design mode is on in a workspace with no `design/tokens.css`, Aiden reads a few of its style files on the device and offers in chat to write a tokens file and a specimen page from the colours and fonts it found; it writes them only after the person agrees, and asks once per workspace.
- Design mode (desktop, on by default; `AIDEN_DESIGN_MODE=0` turns it off) puts a workspace chat beside an infinite design canvas. Design mode keeps one canvas per workspace, shared by its chats; each chat remembers its own page and view, so a pan, a zoom or a page switch in one chat never moves another. Opening design mode gives the chat a page of its own: the page on screen when no other chat is using it, otherwise a new page named after the chat, which follows the chat's title until someone renames the page. Aiden can switch the chat to another page. Deleting a page moves its chats to the first page, and Aiden won't delete a page another chat uses unless the person asks; the page picker shows how many chats use each page, never which. Deleting a chat removes its comments, its page claim, and the images and visuals it sent from the chat (artifact frames); workspace images, its page, notes and page frames stay. Canvases from earlier versions are cleared on first start; files under `design/` are untouched. Removing a workspace deletes its canvas, and a No workspace chat attached to a workspace with its files copied brings its canvas pages along, named after the chat, and uses the first of them as its page (attaching without copying the files leaves the canvas behind). Pages stay workspace HTML files served only to the canvas in a sandbox with no network; Aiden changes the canvas only in attended desktop turns, through its canvas tools or by an HTML page it writes, edits or makes with a command under the workspace's `design/` folder landing as a frame (and, when the person opens design mode, the pages the chat's earlier replies wrote landing on the chat's page), and a comment or an in-place word edit the person makes goes to Aiden only with their next message, while plain word edits are written into the page's file and can be undone. The first time design mode is on in a workspace with no `design/tokens.css`, Aiden reads a few of its style files on the device and offers in chat to write a tokens file and a specimen page from the colours and fonts it found; it writes them only after the person agrees, and asks once per workspace.
- Bot computers (Apple silicon): an opt-in macOS VM per Bot, which the Bot sees and uses with its own `computer` tool (screenshots and clicks, each step with a stated intent the rules read) and `computer_shell` tool, on routine runs too. The Bot panel's Computer tab shows it live with the Bot's avatar where it last pointed; the person's first click or key, or Take over, stops the Bot's current action until Give back, and Float over chat keeps the screen in view. Element control (Aiden's pinned cua-driver in the base computer, allowed once for Accessibility and Screen Recording and inherited by every Bot computer made from it) lets the Bot read an app's buttons and fields and click them by number, and the rules then also read the element acted on; skipping it keeps screen-only Bots. A Bot can ask the person to sign in on its own computer: Open hands the person the computer with Safari at the site, the Bot's computer tools wait, and the password never reaches the model. The onboarding tour introduces Bot computers only where they exist. See [docs/bot-computers.md](docs/bot-computers.md).
- On iPhone, an `svg` code block in a reply has View, which draws it with no scripts and no network. A workspace `.html` file opens on a themed Preview, with no network and a Source switch, and tapping a "File written" line in a workspace chat opens that file.

Expand Down
2 changes: 1 addition & 1 deletion docs/plans/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Research addition 2026-10-03 against `main` at `3f86d41af` (0.52.0): [all-PR inv

- [Design mode Tweaks panel](design-mode-tweaks-panel-plan.md) — Built 2026-11-18 on `claude/project-thread-m755wc`, in review (owner answered 1a 2a 3a+b). DialKit-style Tweaks: folders, typed number values, a 2D pad, words and buttons as page controls; saved versions with in-memory pictures and Show all; Shuffle, Send to Aiden, Copy and Make default with Undo; and the same controls floating over a page you are inside.

- [Design mode v2: the live app canvas](../superpowers/specs/2026-11-23-design-mode-live-app-design.md) — Approved 2026-11-23. The workspace's real dev-server routes as live, interactive frames (localhost-only network), one canvas per workspace with a page per chat, Aiden-controlled dev server, Inspect tool (X) with measure and drift checks, element chips into the composer, change toasts, error frames with Fix with Aiden, live directions with Adopt, a Styles frame, the app's design system kept in Google's open `DESIGN.md` format (read, linted and drafted by Aiden), React mock apps for non-web React projects such as Electron apps, and later `*.canvas.tsx` component cards. Pre-build checks done and the PR split revised (1a, 1b, 2a–2c, 3a–3d, DM, 4, 5, 7, 6) on 2026-11-23; Phase 1a (workspace canvas document) built 2026-11-23 on `t3/design-mode-live-app-plan`, in review as [PR #894](https://github.com/sambitcreate/aiden-agent/pull/894), plan [p1a](../superpowers/plans/2026-11-23-design-mode-v2-p1a-workspace-canvas.md).
- [Design mode v2: the live app canvas](../superpowers/specs/2026-11-23-design-mode-live-app-design.md) — Approved 2026-11-23. The workspace's real dev-server routes as live, interactive frames (localhost-only network), one canvas per workspace with a page per chat, Aiden-controlled dev server, Inspect tool (X) with measure and drift checks, element chips into the composer, change toasts, error frames with Fix with Aiden, live directions with Adopt, a Styles frame, the app's design system kept in Google's open `DESIGN.md` format (read, linted and drafted by Aiden), React mock apps for non-web React projects such as Electron apps, and later `*.canvas.tsx` component cards. Pre-build checks done and the PR split revised (1a, 1b, 2a–2c, 3a–3d, DM, 4, 5, 7, 6) on 2026-11-23; Phase 1a (workspace canvas document) built 2026-11-23 on `t3/design-mode-live-app-plan`, in review as [PR #894](https://github.com/sambitcreate/aiden-agent/pull/894), plan [p1a](../superpowers/plans/2026-11-23-design-mode-v2-p1a-workspace-canvas.md). Phase 1b (chat pages) built 2026-11-24 on `t3/design-mode-v2-p1b`, in review as [PR #908](https://github.com/sambitcreate/aiden-agent/pull/908), stacked on PR #894, plan [p1b](../superpowers/plans/2026-11-23-design-mode-v2-p1b-chat-pages.md).
- [Design Studio + Create Images rebuild](design-studio-create-images-rebuild-plan.md) — Active (Create Images only; Design Studio superseded 2026-10-31). Track F (Studio Foundation) merged in [#375](https://github.com/sambitcreate/aiden-agent/pull/375) and [#376](https://github.com/sambitcreate/aiden-agent/pull/376). Create Images CI-1 merged in [#382](https://github.com/sambitcreate/aiden-agent/pull/382) (headless core) and [#383](https://github.com/sambitcreate/aiden-agent/pull/383) (UI and Playwright); CI-1.10 live OpenRouter acceptance passed (owner, 2026-10-08). Design Studio DS-1a (headless core: projects, design runs, partial publish + Resume, preview resolver, IPC) merged in [#385](https://github.com/sambitcreate/aiden-agent/pull/385) (2026-10-08, shipped in 0.55.0); DS-1b was never started. The Design Studio half was superseded 2026-10-31 by [Design mode](../superpowers/specs/2026-10-31-design-mode-design.md); Studio code removed in P0, and `AIDEN_EXPERIMENTAL_DESIGN_STUDIO` no longer does anything. Create Images continues under this plan behind `AIDEN_EXPERIMENTAL_CREATE_IMAGES` (default off). Haiku-built tasks were independently audited on Opus 5.5 and fixed before merge. Create Images viewer, editor History tab, All Images library and always-on auto-save to Pictures merged in [#689](https://github.com/sambitcreate/aiden-agent/pull/689) (2026-11-02, stacked on [#686](https://github.com/sambitcreate/aiden-agent/pull/686)) and shipped in 0.64.0.

- [On-device speech engine foundation (STT sub-project 1)](stt-engine-foundation-spec.md) — Merged in [PR #436](https://github.com/sambitcreate/aiden-agent/pull/436), with hardening in #439; shipped in 0.56.0. Plan: [implementation plan](../superpowers/plans/2026-10-09-stt-engine-foundation.md); the smoke run, packaging check and native client tests are recorded in its Progress section and `.memory/stt-engine-foundation.md`. The onboarding voice step is deferred to sub-project 4. First of four Handy-informed speech-to-text sub-projects (engine foundation, live and accuracy, dictation UX, consistency and onboarding). It stays on sherpa-onnx (pinned 1.13.8) and covers:
Expand Down
Loading
Loading