Skip to content

feat: Artifacts, Design mode, canvas and website clone - #229

Merged
GoDiao merged 2 commits into
mainfrom
feat/artifacts-export
Nov 1, 2026
Merged

GoDiao merged 2 commits into
mainfrom
feat/artifacts-export

Conversation

@GoDiao

@GoDiao GoDiao commented Nov 1, 2026 •

Copy link
Copy Markdown
Owner

Summary

Pages, prototypes and canvases the agent makes now live as folders in the project (dc_artifacts/) instead of getting lost in the conversation. This PR adds the Artifacts page, a Design mode with a bundled template and design system library, a canvas artifact made of boards, and a website clone flow. It builds on the browser tools from #207 and #219.

There is no issue for this feature, so the PR does not close one. Windows verification overlaps with #188 and #221; this PR does not close them.

What changed

  • Artifacts. A folder with artifact.json (id, kind page or canvas, entry file) per artifact; an artifact_written event when the agent writes one; ArtifactCheck and ArtifactCopy tools; artifacts outside the working directory are read-only and are copied in with ArtifactCopy; deleting a worktree moves its artifacts, with the design systems they use, to a global folder. The Artifacts page lists artifacts of every project (cards or list, thumbnails, search, project filter), opens one full screen, continues it in a new chat, and exports a page as PDF, PNG or standalone HTML. The same list is a tab in each session's panel.
  • Design mode. The /design skill and the Design page: the agent interviews the user, offers templates with the ChooseDesignTemplate tool (an inline card in the chat), and builds a page or app prototype, applying a design system with UseDesignSystem. The library ships with the app: 60 page and prototype templates and 156 design systems. The templates and 151 of the systems are converted from Open Design (Apache-2.0, see THIRD_PARTY_NOTICES.md); 5 starter systems are written for DreamCoder. Slides are left out on purpose and will come back with their own entry.
  • Canvas. A canvas artifact lays several pages out as boards on one surface, with a zoom toolbar, panning, dragging and resizing; positions are written back to the manifest. Boards take no mouse input until the user clicks their Interact button or double-clicks them, so panning and zooming work with the mouse over a board. The artifacts and design skills tell the agent how to enter interaction mode.
  • Website clone. /design can clone a website: the agent opens it in a hidden browser session (the user grants access to the site first), reads its structure and styles with the bundled clone scripts, and rebuilds it as a page. The scripts are adapted copies of the Open Design ones (desktop/web-clone, license included).
  • Smaller changes that these features needed. The dreamcoder-project:// protocol serves byte ranges (206 and 416) so videos play and seek. The Artifacts pages use their own header as the window title row (new useTitleRow hook, shared with the session page). The Artifacts tab is restored after a restart.
  • CI. The macOS jobs in release.yml and smoke-test.yml move from macos-14 to macos-15: GitHub retires the macos-14 runner image on November 2 and was already failing its jobs on a schedule, so the macOS installer build of this PR could not run. macos-15 is Apple Silicon like macos-14.
  • Docs. docs/artifacts-tech-design.md describes the design and lists every deviation from it. CHANGELOG entries, and the README with new screenshots in both languages.

Reviewing this PR

The diff is large, but most of it is data: about 72k of the ~98k changed lines are the bundled design systems and templates (438 files), and ~3k lines are the vendored clone scripts. The hand-written parts are about 7.6k lines in src, 9.8k in desktop, 4.2k in the generator scripts under scripts/, and the docs. There are two commits, and the PR is squash-merged anyway: the feature, and a two-line CI change. To read the feature, start with docs/artifacts-tech-design.md (the intent and the deviations), then src (tools, skills, sidecar) and desktop (renderer and Electron). The bundled data under desktop/design-systems and desktop/design-templates and the vendored scripts under desktop/web-clone can be skipped.

No dependencies were added and the lockfiles are unchanged.

Decided and accepted for now: ten templates load the Tailwind CDN at runtime and a few load Google Fonts; two template thumbnails are not representative.

Known and not fixed (the ones worth knowing; the first review round also produced a few lower-confidence notes that were not acted on):

  • Removing a worktree reports success even when its artifacts could not be moved.
  • The clone scripts' Node fetch has no internal-address filter (the hidden browser path asks the user first).
  • Every artifact_written event bumps the write version, which can cause extra list reloads.
  • knownWorkDirs stats the project folders one by one.
  • The order of the flags in resumeEmulation was left as it is.
  • A canvas can flash the wrong theme on first paint, until the app sends its theme.

Testing

  • bun test: 2246 pass, 0 fail. Desktop bun run test -- --run: 2602 pass, 4 skipped. bun run lint passes.
  • Random order: the test files touched late in the work, run with --randomize (bun) and --sequence.shuffle with seeds 1 and 2 (vitest), pass.
  • Two rounds of code review (four reviewers and four verifiers each) led to 74 fixes (29 in the first round, 45 in the second). For the fixes with a behavior change I broke the fix, saw the new test fail for the expected reason, and restored it.
  • macOS: ran the dev app and checked the Artifacts page, the viewer, the Design page, the template card in a chat, and the canvas, including interaction mode (pixel check in a real Electron window). I also measured the title row in the real window.
  • Windows: a temporary workflow on windows-latest ran the same tests on main and on this branch. Both have the same failures: 6 server tests of ripgrep preparation and resolution (tar extraction on the runner) and 1 desktop test in electron/browser.test.ts. The branch adds no failure. The author also checked on Windows with the dev app: a project in a path with spaces, /design with such a path, the website clone (script quoting, no console window), video play and seek, deleting a worktree while keeping its artifacts and design systems, PDF, PNG and HTML export, thumbnails and template preview, canvas panning and interaction mode, restoring the Artifacts tab after a restart, and no console windows flashing. The packaged Windows app was not checked by hand; its installer is built in this PR through release.yml.
  • Not verified: the packaged Windows app, pinching on a real trackpad, Linux, and cloning more than the two sites tried while developing.

Pages, prototypes and canvases the agent makes are kept as folders in the
project's dc_artifacts/ instead of getting lost in the conversation.

- Artifacts: artifact.json manifest and ids, the artifact_written event,
  ArtifactCheck and ArtifactCopy tools, read-only foreign artifacts,
  worktree deletion that moves artifacts and their design systems to a global
  folder, the Artifacts page and full-screen viewer, thumbnails, and export to
  PDF, PNG or standalone HTML.
- Design mode: the /design skill and Design page, the ChooseDesignTemplate and
  UseDesignSystem tools, and a bundled library of 60 templates and 156 design
  systems (converted from Open Design, Apache-2.0).
- Canvas: boards on one surface with a zoom toolbar, written-back positions and
  an interaction mode so panning works with the mouse over a board.
- Website clone: bundled clone scripts and a hidden background browser session
  that the user grants access to first.
- The project protocol serves byte ranges so videos play and seek.
- Docs, CHANGELOG entries and README screenshots.
@GoDiao
GoDiao merged commit 3297feb into main Nov 1, 2026
8 checks passed
@GoDiao
GoDiao deleted the feat/artifacts-export branch November 1, 2026 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant