Repository navigation
feat(slides): add slide decks as an artifact kind, with templates and a start chip - #256
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
index.html, one file per slide underslides/, a shareddeck.cssand a manifest of kinddeck. The stage scriptdeck.jsrenders 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.ETagand answerHEAD.canvas-shelltoartifact-shell.Export
Agent side
/slidesskill with its references;ArtifactCheckgained adeckbranch.Templates and entry
e5e204fb, recorded inTHIRD_PARTY_NOTICES.md), with the conversion scripts inscripts/design-templates/. Upstream scripts are removed, not run.designorslides)./designor/slides, picking it from the slash menu or pasting it produces the same chip, on the new task page too.user_messagegained an optionaltitle, used for the session title.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.tsno 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.applystep (ArtifactCheckand the mechanical checks); 351 slides were rendered and checked for overflow./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
url()indeck.css,srcsetorposter.