Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
eb0d91e
Plan design mode v2: the live app canvas
sambitcreate Nov 23, 2026
3ba4935
Design mode v2: settle pre-build checks, revise PR split, plan Phase 1a
sambitcreate Nov 23, 2026
5fc2a98
feat(design): canvas document v3 with chat pages and no view state
sambitcreate Nov 23, 2026
5f73bed
Design mode v2: apply adversarial review amendments to spec and 1a plan
sambitcreate Nov 23, 2026
7856991
refactor(design): canvas helpers take the page explicitly
sambitcreate Nov 23, 2026
2af82b9
feat(design): one canvas file per workspace
sambitcreate Nov 23, 2026
62a612b
Design mode v2: round-2 review amendments to the 1a plan and spec
sambitcreate Nov 23, 2026
cd5b37c
fix(design): round-2 amendments A8, A9, A15 for the merged steps
sambitcreate Nov 23, 2026
40ca251
feat(design): main keeps each chat's canvas view
sambitcreate Nov 23, 2026
5be941a
Design mode v2: round-3 amendments — main owns persisted views
sambitcreate Nov 23, 2026
76e5ba8
feat(design): main owns and persists each chat's canvas view
sambitcreate Nov 23, 2026
2975b8d
feat(design): canvas tools follow the chat's own view
sambitcreate Nov 23, 2026
bf8e8c7
feat(design): placements land on the acting chat's page
sambitcreate Nov 23, 2026
cdb639c
feat(design): each chat keeps its own page and view
sambitcreate Nov 23, 2026
e4c4199
docs(plan): tick Task 7 steps
sambitcreate Nov 23, 2026
7a4d2a2
feat(design): shared workspace canvas with per-chat artifacts; docs
sambitcreate Nov 23, 2026
d5b1b14
fix(design): main-side review fixes for the shared workspace canvas
sambitcreate Nov 23, 2026
f78a6b0
fix(design): renderer review fixes for the shared workspace canvas
sambitcreate Nov 23, 2026
bd6f866
Merge remote-tracking branch 'origin/main' into t3/design-mode-live-a…
sambitcreate Nov 23, 2026
3d6d9de
docs(plan): Phase 1a is in review as PR #894
sambitcreate Nov 23, 2026
c5db788
fix(design): order canvas writes after workspace removal and keep unc…
sambitcreate Nov 24, 2026
19d79bb
fix(design): hold frame-only uncounted fits to the page on screen
sambitcreate Nov 24, 2026
14243a8
Merge remote-tracking branch 'origin/main' into t3/design-mode-live-a…
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
12 changes: 12 additions & 0 deletions .memory/design-mode.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Design mode

v2 (2026-11-23): owner approved the live app canvas spec `docs/superpowers/specs/2026-11-23-design-mode-live-app-design.md` (live dev-server routes as frames, localhost-only, one canvas per workspace with a page per chat, Aiden-controlled dev server, Inspect tool X, DESIGN.md as the design-system source, React mock apps for non-web React projects). Pre-build checks are in spec §11 (`@google/design.md` 0.4.0: Apache-2.0, `/linter` `lint(content)` offline; v1 `design-system*.ts` used only by `main.ts`, deleted in 3b; no default-session `webRequest` listener exists; E2E fixture symlinks root `node_modules`). The PR split was revised in §8: 1a must move every `activePageId` reader at once (tools, placement, focus with `pageId`, renderer view store), and 1b only writes `chatPages` and handles lifecycle. Phase 1a plan: `docs/superpowers/plans/2026-11-23-design-mode-v2-p1a-workspace-canvas.md`, built 2026-11-23 on `t3/design-mode-live-app-plan`, PR #894 opened 2026-11-23 after code review fixes (main `d5b1b14e9`, renderer `f78a6b0ef`); see "v2 Phase 1a" below. Key 1a decisions: `DesignChatCanvases` adapter (chat → workspace) so callers keep chat ids; a `.layout-v3` marker in `design-canvases/` triggers the one-time wipe; `designCanvas:updated` carries `workspaceId`; each No workspace chat has its own hidden workspace and so its own canvas (only legacy chats with no `workspaceId` share `default`). An adversarial plan review on 2026-11-23 added amendments A1–A12 to the 1a plan (origin `chatId` on updates, comment tray filtered by chat in 1a, per-window ordered views, Aiden's page change applied in main at once, attach merges the hidden canvas). An adversarial spec review the same day added §12 S1–S15: subframe `will-redirect` fix, a per-workspace start consent with a script-text hash plus a read-only refusal, a fail-closed null-frame rule, `file://` cookie handling, a narrowed network guarantee, a `design` job owner, an install stamp, a permission dispatcher shared with Gemini Live, no `allow-modals`, untrusted bridge output, Vite-client HMR, loopback binding, and 2b–5 behind `AIDEN_EXPERIMENTAL_DESIGN_LIVE` until Phase 7.

Status: active. P0 (retire Studio), P1 (layout shell) and P2 (canvas and frames, Tasks 1–7) are done. The Mac Studio work was pushed as `claude/design-mode-deep-dive` on 2026-11-05, then merged with `origin/main` on `claude/project-thread-29fzrr` (the PR branch). P3 (Aiden on the canvas) is done (2026-11-05, P3a–P3d, on the PR #778 branch), plan `docs/superpowers/plans/2026-11-05-design-mode-p3-aiden-on-canvas.md`. P3a (canvas tools) is done: `main/services/design-canvas/canvas-tools.ts` (four tools, 20 calls per turn at the time, 60 now, `designCanvasToolsAllowed` gate, `DESIGN_MODE_PROMPT_SECTION`), wired in `llm-client.ts` as the `aiden.design-canvas` runtime extension (static prompt section; since 2026-11-18 the `canvasPromptLine` counts go to the transcript as a `design-canvas-status` section note via `withCanvasStatusNote`, only when they changed, instead of a volatile system prompt line). P3b (artifact frames) is done: `artifact-frames.ts` places committed `render_artifact` visuals after `generativeUiArtifactStore.commit` (never on a failed turn), same-title Aiden frames swap `mediaId` and keep their box; `ArtifactNode` keys its loaded src by mediaId. P3c (skill) is done: `design-canvas/skill.ts` (`aiden-design`, `DESIGN_CANVAS_SKILLS`), registered in `skill-registry-main.ts` only when the flag is on, dropped by `withoutSkills` unless `designCanvasOffered` in llm-client, and from Remote and Telegram catalogs. P3d is done: `design-mode-tool.ts` (`DesignModeConsent`, `design_mode`, on-demand), `canvas-snapshots.ts`, card `renderer/design/design-mode-consent.tsx`, focus store `renderer/design/canvas-focus-requests.ts`; canvas tools held back and added by `withEnteredCanvasTools` after Enter; new tests must also go in `scripts/ci-test-registry.json` or `npm test` fails its registry check. P4 plan (owner chose everything in their reference screenshots): `docs/superpowers/plans/2026-11-05-design-mode-p4-full-canvas.md`; P4a built 2026-11-05, P4e, P4b, P4c, P4d, P4f, P4g and P4h built 2026-11-06, P5 (launch) built 2026-11-06. Placement moved to `renderer/shared/design-canvas/placement.ts`; summaries in `canvas-summary.ts`. P4–P5 plans are written before each phase.

- Spec: `docs/superpowers/specs/2026-10-31-design-mode-design.md`. Plans: `docs/superpowers/plans/2026-10-31-design-mode-p0-retire-studio.md`, `docs/superpowers/plans/2026-10-31-design-mode-p1-layout.md`.
Expand Down Expand Up @@ -353,3 +355,13 @@ Deviations from the P1 plan:
- Live's idle corner pill left in #855, but design mode still kept `--aiden-dock-gutter` (96 px) on the chat column's right only, so the narrow design chat showed an empty lane right of the composer. The design column now uses `--design-mode-gutter` (16 px) on both sides, and the design-mode-only wide inline visual rule above is gone: the generic rule fills the slim column.
- Outside design mode, `.aiden-dock-inset` keeps 6rem per side at usual widths (reading width unchanged) but gives way down to `--chat-column-gutter-min` (1rem) when the pane is narrow; Full narrows like Default; `[data-chat-card-inset]` keeps the fixed 6rem because Quick View's docking math assumes it.
- Live's transient corner pill (connecting, stopping, disconnected, approval) now rises just above the composer when it would cover it (`liveCornerClearance` in `use-live-ribbon-placement.ts`).

## v2 Phase 1a: one canvas per workspace (2026-11-23)

- Document: canvas v3 has no `activePageId` and no page viewport; frames and comments may carry `chatId` (the chat that made them). One file per workspace, `userData/design-canvases/<workspaceId>.json`. A folder without `.layout-v3` is wiped once (no migration code). `DesignChatCanvases` maps chat → workspace and refuses a removed workspace ("This workspace is no longer available.").
- Views live only in main (`DesignCanvasViews`, `views.ts`), persisted per workspace in `userData/design-canvas-views/<workspaceId>.json` as `{ [chatId]: { pageId, viewports, focusId } }`, written at most once a second. No `localStorage` copy (A17). The renderer (`renderer/design/use-design-view.ts`) reads `designCanvas:view:get` on mount, reports `{ workspaceId, view, focusId }` 250 ms after the last change, flushes then sends `{ mounted: false }` on unmount. `kept()`/`view:get` also return per-page `viewports` (a deviation from the plan) so each page opens where the chat left it. Pans, zooms and page switches never save the document or make an undo step.
- Focus: `designCanvas:focus { chatId, pageId, frameIds, focusId? }`; the renderer applies the page even when the fit is skipped (A19) and a focus without a page uses its frames' page (A7). Saves pass `{ workspaceId, undone? }`; a `moved` answer carries the newer `workspaceId`, the renderer drops its edits and the region remounts (A23). Updates are filtered by `workspaceId`; only this chat's `aidenTurn`/`step` updates become undo steps (A2).
- 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`.
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. Pages stay workspace HTML files served only to that chat's 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 an empty canvas), 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. 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.
- 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
1 change: 1 addition & 0 deletions docs/plans/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +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 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