Skip to content

feat(slides): add slide decks as an artifact kind, with templates and a start chip - #256

Merged
GoDiao merged 8 commits into
mainfrom
feat/slides
Nov 15, 2026
Merged

GoDiao merged 8 commits into
mainfrom
feat/slides

Conversation

@GoDiao

@GoDiao GoDiao commented Nov 15, 2026

Copy link
Copy Markdown
Owner

What

Adds slide decks as a third artifact kind (deck), with viewing, presenting, export, templates and an entry on the Artifacts page. Phases 1 and 2 of docs/features/slides/tech-design.md; phase 3 (editing by the user) is not in this PR.

Format and viewing

  • A deck is an artifact folder with a fixed index.html, one file per slide under slides/, a shared deck.css and a manifest of kind deck. The stage script deck.js renders the slides on a fixed 1920×1080 canvas scaled to fit, with single-slide, overview and presentation modes, a print layout and a static mode for exports.
  • Slide numbers come from CSS counters, so they follow the slide order. Chapter numbers are content written in the slide.
  • The stage reloads a slide's images, media and embedded pages when the files appear or change; project protocol responses carry an ETag and answer HEAD.
  • The shell script folder is renamed from canvas-shell to artifact-shell.
  • A tab is recognised as an artifact tab when the page announces itself. Refresh, export and thumbnails apply only while the tab still shows that artifact.
  • The side browser has slide controls (previous, next, counter, overview, present).

Export

  • Decks export as standalone HTML, PDF and PNG.
  • PNG export for every artifact kind now renders in a hidden window, which fixes pages taller than the panel repeating their visible part.
  • Standalone HTML export inlines the pages an artifact embeds from its own folder.

Agent side

  • New /slides skill with its references; ArtifactCheck gained a deck branch.

Templates and entry

  • 34 slide templates converted from zarazhangrui/beautiful-html-templates (MIT, pinned at e5e204fb, recorded in THIRD_PARTY_NOTICES.md), with the conversion scripts in scripts/design-templates/. Upstream scripts are removed, not run.
  • The Artifacts page has a Slides tile next to Design; the start page takes a scope (design or slides).
  • Starting from a template, from scratch or from a website clone opens a new chat with a chip in the composer instead of sending a message at once; the artifact is created on send. Typing /design or /slides, picking it from the slash menu or pasting it produces the same chip, on the new task page too.
  • user_message gained an optional title, used for the session title.
  • New GET /api/skills/slash-commands; the new task page's slash menu uses it and now lists the built-in commands.

Also in this PR

  • cronTasks.test.ts no longer writes to the project's .claude/scheduled_tasks.json.

Why

Slides are the next artifact type after pages and the canvas. The format keeps each slide a plain HTML file so the agent can edit one slide at a time and the user can comment on and pick elements in it like any other artifact.

How it was tested

  • bun test: 2718 pass, 0 fail.
  • cd desktop && bun run lint: pass.
  • cd desktop && bun run test -- --run: 3019 pass, 4 skipped.
  • All 34 templates pass the conversion script's apply step (ArtifactCheck and the mechanical checks); 351 slides were rendered and checked for overflow.
  • Checked in the dev app on macOS: making a deck with /slides, paging, overview, presenting, the three exports, embedded pages written after the slide, reopening at the same slide, a long-page PNG export, dark theme, Chinese, starting from a template, and the chip from the start page, from the slash menu and from typed commands on the new task page.

Known limits

  • Not checked on Windows.
  • After a refresh, a reconnect, or on another client, the first message of a chat started with a chip shows the raw command and path; the display text exists only in the sender's local message.
  • PNG export shows the page as freshly loaded, without what was clicked or typed in the tab.
  • The stage does not track files loaded by an embedded page itself, url() in deck.css, srcset or poster.

Design for a deck artifact kind: one HTML file per slide, a stage script shipped with the app, a separate Slides entry and /slides skill, templates from beautiful-html-templates, and text, reorder and delete editing.

Revised after a source-backed review and after probing the key assumptions in Electron 45. PNG export moves to a hidden window for every artifact kind, because a capture larger than the webview's visible surface comes out as repeated tiles.
…nting and export

Phase 1 of docs/features/slides/tech-design.md: the format and viewing.

A deck is an artifact of kind `deck`: a fixed entry file that only loads the
app's stage script, a `deck.css`, and one `<section>` file per slide listed in
`slides` of the manifest. The stage script (`deck.js`) renders the slides on a
fixed 1920x1080 stage that scales to the view, with browse, overview and
presentation modes, steps (`.fragment`), the current slide in the address, a
refresh that replaces only what changed, print styles with one page per slide,
and a static mode for the exported standalone file.

App side:
- The shell script folder is now `artifact-shell`; shared constants moved to
  `src/utils/artifactShell.ts`, deck ones to `src/utils/deck.ts`.
- The page-to-renderer channel has a shared layer with one bridge per shell.
  A deck reports its state and a canvas reports `ready`; a tab the agent
  opened is recognised as that artifact's tab after its address is checked
  against the artifact's entry. Theme and refresh go to whichever shell a
  project page has.
- Deck controls (previous, next, position, overview, present) appear under the
  address bar of any tab that shows a deck and in the full-screen viewer.
  Presenting makes the webview's slot full screen.
- PNG export renders the page again in a hidden window for every artifact
  kind. A capture taken in the tab repeated the visible part for anything
  beyond it. A deck exports one 1920x1080 slide; a page is laid out at the
  size of the tab and captured whole.
- Standalone HTML inlines same-origin iframes from their source into `srcdoc`.
- Thumbnails of a deck capture only the first slide; picks and selections on a
  slide name the slide and its file; a reopened tab keeps the part after `#`.
- A tab is treated as its artifact's tab only while its address is inside the
  artifact folder: refresh, export and thumbnails skip it otherwise. The
  full-screen viewer no longer offers export for a canvas.

Agent side:
- `ArtifactCheck` checks a deck: entry, deck.css, slide ids and files, one
  section per file without scripts, references resolved from the artifact
  folder, embedded pages, unlisted slide files.
- New `/slides` skill with format, interview, layout, design-system and check
  references; the `artifacts` skill describes the deck layout; design-system
  guidance depends on the artifact kind.

Templates, the Slides entry and editing by the user are later phases.
…ge, and number slides with CSS counters

Two things found while trying phase 1 in the app.

A slide whose embedded page was written after the slide itself stayed on
"Not found" until the tab was reloaded: a refresh only rebuilt a slide when
the text of its file changed. The stage now also looks at the same-origin
files a slide refers to directly (the `src` of iframe, img, video, audio and
source). On every refresh it sends a HEAD request for each, keeps the status
and ETag on the element, and reloads only an element whose file appeared,
changed or went away, by setting its `src` to the same value again. Elements
whose file did not change are left alone, so an embedded page the user is
working in is not reset. The project protocol gives file responses an ETag
made from size and modification time and answers HEAD with the headers only.
Files an embedded page loads itself, `url()` images in deck.css, `srcset` and
`poster` are not tracked.

Page numbers were typed into every slide, as layout.md asked for, so adding a
slide meant editing all of them and reordering would make them wrong. The
stage now provides two CSS counters: `dc-slide` is the number of the slide and
`dc-slides` the number of slides. Both live on the stage's own elements, so
nothing is added to a slide, and they are right in every mode and export,
including the standalone file. format.md and layout.md of the `/slides` skill
tell the agent to write the page number once in deck.css and never to type a
number that depends on the order into a slide file.
Slide templates are a third template category. Creating an artifact from one keeps the template's own deck manifest and slides, and the guidance points the agent at deck.css, the slides and DESIGN.md while the stage file stays fixed. The Artifacts page gets a Slides entry next to Design, sharing one start page that filters the templates by scope, and the template preview has deck controls. The slides skill gains a template-or-scratch step, and its rules now separate page numbers, which only come from counters, from section numbers, which are content kept consistent when sections change.
…-templates

Each upstream example deck is split into one file per slide and a shared deck.css on the 1920 by 1080 stage, with its navigation script, slide counter and typed page numbers replaced by the deck stage and CSS counters. Responsive decks are sized as they look in a 960 by 540 window scaled up twice. The conversion script drafts, checks and applies the templates, takes screenshots through headless Chrome, and keeps the web templates when it rewrites the catalog. Thumbnails, the MIT license, third-party notices, the changelog and the slides technical design are updated.
…ed tasks file

The test now adds a session-only task, reads its fields back from the session store and removes it afterwards, checking that the project file is left unchanged.
…poser instead of sending at once

Choosing a template, starting from scratch or cloning a website on the start page now opens a new chat with the choice as a chip in the composer, a question that fits it, and the focus in the input. Nothing is sent and nothing is created until the user sends: then the template is copied or the design system installed, and the command goes first with the user's words after it. Sending the chip alone sends the same command as before, a failure keeps the chip and the text, and removing the chip leaves a plain chat. The chat shows the chip and the words instead of the folder path, and user_message carries an optional title so the session is named from the words or the chip. The chip lives beside the references in the chat context store, at most one per session.
… on the new task page too

Typing the command, picking it from the slash menu or pasting it puts the chip in the composer instead of sending the command as text. The new task page keeps the chip in its draft and sends through its own launch flow, with the command first.

The new task page's slash menu now reads the same command list as a session, through GET /api/skills/slash-commands, so it lists the built-in commands; it used to list only skills on disk.
@GoDiao
GoDiao merged commit 0bcd8dc into main Nov 15, 2026
4 checks passed
@GoDiao
GoDiao deleted the feat/slides branch November 15, 2026 15:59
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