Repository navigation
feat: add a static canvas artifact kind - #35618
dodgeblaster wants to merge 2 commits into
Conversation
UX Review (Opus 5.5) — ✅ human override accepted@dodgeblaster overrode this lane for |
Design Review (Opus 5.5) — ✅ human override accepted@dodgeblaster overrode this lane for |
First Principles Review (Opus 5.5) — ✅ human override accepted@dodgeblaster overrode this lane for |
006922c to
2164b6b
Compare
GPT 6.1 Review — 🔴 changes requested (blocking)GPT 6.1 found at least one blocking issue that must be resolved before merging This comment is updated in place on each push. BLOCKING --
BLOCKING --
[BLOCK-MERGE] 6934dee Adjudication (Opus 5.5) — is blocking on each finding proportionate?F1 is MEDIUM harm. On a desktop canvas, F2 is MEDIUM harm. The False positive or not applicable? A repository writer can comment: |
|
Owner decision (design/UX): the canvas visual design (sticker look, toolbars, sticky notes, dock) is being worked out directly with the design team. I accept the Design Review and UX Review objections on this PR and am overriding those two lanes; design feedback is tracked with the design team, not in these lanes. |
|
/ai-review override design 2164b6b owner-decision: design is being worked out with the design team, recorded at #35618 (comment) |
|
/ai-review override ux 2164b6b owner-decision: design is being worked out with the design team, recorded at #35618 (comment) |
Human judgment recorded@dodgeblaster recorded a owner-decision release (class
This decision applies only to this commit. A new push requires a new judgment. |
|
Human judgment recorded, but the following reviewer lane(s) could not be re-run automatically: Design Review. Re-run the lane's latest workflow run for |
Human judgment recorded@dodgeblaster recorded a owner-decision release (class
This decision applies only to this commit. A new push requires a new judgment. |
|
Human judgment recorded, but the following reviewer lane(s) could not be re-run automatically: UX Review. Re-run the lane's latest workflow run for |
2164b6b to
332384e
Compare
|
/ai-review override design 332384e reissue: same owner decision for the new head, recorded at #35618 (comment) |
|
/ai-review override ux 332384e reissue: same owner decision for the new head, recorded at #35618 (comment) |
Human judgment recorded@dodgeblaster recorded a reissue release (class
This decision applies only to this commit. A new push requires a new judgment. |
Human judgment recorded@dodgeblaster recorded a reissue release (class
This decision applies only to this commit. A new push requires a new judgment. |
Opus 5.5 Review — ✅ human override acceptedReviewed Human judgment by @dodgeblaster overrides the Opus 5.5 finding for [OPUS-OVERRIDE] 6934dee Verdict recorded from an authorized human decision for commit False positive or not applicable? A repository writer can comment: |
332384e to
f2a28ed
Compare
|
/ai-review override design f2a28ed reissue: same owner decision for the new head, recorded at #35618 (comment) |
|
/ai-review override ux f2a28ed reissue: same owner decision for the new head, recorded at #35618 (comment) |
Human judgment recorded@dodgeblaster recorded a reissue release (class
This decision applies only to this commit. A new push requires a new judgment. |
Human judgment recorded@dodgeblaster recorded a reissue release (class
This decision applies only to this commit. A new push requires a new judgment. |
|
|
/ai-review override design b0596f6 reissue: same owner decision for the new head, recorded at #35618 (comment) |
Human judgment recorded@dodgeblaster recorded a reissue release (class
This decision applies only to this commit. A new push requires a new judgment. |
|
Human judgment recorded, but the following reviewer lane(s) could not be re-run automatically: Design Review. Re-run the lane's latest workflow run for |
|
/ai-review override ux b0596f6 reissue: same owner decision for the new head, recorded at #35618 (comment) |
Human judgment recorded@dodgeblaster recorded a reissue release (class
This decision applies only to this commit. A new push requires a new judgment. |
|
Human judgment recorded, but the following reviewer lane(s) could not be re-run automatically: UX Review. Re-run the lane's latest workflow run for |
|
/ai-review override first-principles b0596f6 reissue: same owner decision for the new head, recorded at #35618 (comment) |
Human judgment recorded@dodgeblaster recorded a reissue release (class
This decision applies only to this commit. A new push requires a new judgment. |
|
Human judgment recorded, but the following reviewer lane(s) could not be re-run automatically: First Principles Review. Re-run the lane's latest workflow run for |
|
/ai-review override fable b0596f6 owner-decision: the canvas selection toolbars keep FigJam-style formatting controls and the Artifacts create row keeps Doc and Canvas tiles beside More, by the owner's decisions recorded at #35618 (comment) and #issuecomment-6953579440 |
Human judgment recorded@dodgeblaster recorded a owner-decision release (class
This decision applies only to this commit. A new push requires a new judgment. |
|
Human judgment recorded, but the following reviewer lane(s) could not be re-run automatically: Opus 5.5. Re-run the lane's latest workflow run for |
Shapes are drawn as die-cut stickers: a white edge (or the picked border colour and weight) with a short lift, instead of FigJam's coloured outline; only a dashed border draws an outline. Stickies are tilted, dog-eared and taped paper. Connectors stop clear of the shapes they join. The chrome moves from FigJam's fixed dark panels to themed floating panels, with purple stickers for the active state. Text boxes get a toolbar for colour, size, bold, strikethrough and alignment, and shapes with text get alignment and size, centred by default. Shape text is typed centred with an Add text hint. The dock shows a tool's name and key after a short hover, and the selection frame stays visible while resizing. The canvas strings are translated into all eleven shipped catalogs, inserted in each catalog's existing order.
|
|
/ai-review override design 6934dee reissue: same owner decision for the new head, recorded at #35618 (comment) |
Human judgment recorded@dodgeblaster recorded a reissue release (class
This decision applies only to this commit. A new push requires a new judgment. |
|
Human judgment recorded, but the following reviewer lane(s) could not be re-run automatically: Design Review. Re-run the lane's latest workflow run for |
|
/ai-review override ux 6934dee reissue: same owner decision for the new head, recorded at #35618 (comment) |
Human judgment recorded@dodgeblaster recorded a reissue release (class
This decision applies only to this commit. A new push requires a new judgment. |
|
Human judgment recorded, but the following reviewer lane(s) could not be re-run automatically: UX Review. Re-run the lane's latest workflow run for |
|
/ai-review override first-principles 6934dee reissue: same owner decision for the new head, recorded at #35618 (comment) |
Human judgment recorded@dodgeblaster recorded a reissue release (class
This decision applies only to this commit. A new push requires a new judgment. |
|
Human judgment recorded, but the following reviewer lane(s) could not be re-run automatically: First Principles Review. Re-run the lane's latest workflow run for |
|
/ai-review override fable 6934dee owner-decision: the canvas selection toolbars keep FigJam-style formatting controls and the Artifacts create row keeps Doc and Canvas tiles beside More, by the owner's decisions recorded at #35618 (comment) and #issuecomment-6953579440 |
|
AI-review override not recorded: the handler could not load its command reader (a GitHub read failed, not your command). Re-issue the command. |
|
/ai-review override fable 6934dee owner-decision: the canvas selection toolbars keep FigJam-style formatting controls and the Artifacts create row keeps Doc and Canvas tiles beside More, by the owner's decisions recorded at #35618 (comment) and #issuecomment-6953579440 |
Human judgment recorded@dodgeblaster recorded a owner-decision release (class
This decision applies only to this commit. A new push requires a new judgment. |
|
Human judgment recorded, but the following reviewer lane(s) could not be re-run automatically: Opus 5.5. Re-run the lane's latest workflow run for |
buluoray
left a comment
There was a problem hiding this comment.
Thanks for this, it's a careful piece of work, and thanks for the rebase. I reviewed head 6934dee6 against current main. It now merges cleanly, and the code looks good to me. There is one small gap and one CI item.
1. Agent tool schema does not list canvas (non-blocking). In src/kiro_crew/mcp_tools/catalog/artifacts.py, the artifact_save kind list (lines 53-62) and the artifact_list kind list (lines 243-252) stop at dashboard. But docs/system-specs/modules/artifacts.md:324 says the field accepts canvas, and server validation already accepts it. So an agent cannot save with kind="canvas" or filter the list by it. Could you either add canvas to both lists, the way dashboard was added, or say in the doc that agents edit canvases but do not create them? (image is missing from these lists on main too, so this is not a regression.)
2. Screenshot Evidence check. PR Policy is red on this head because Screenshot Evidence failed. This is a UI change, so it needs screenshots before it can merge. The other red checks (GPT 6.1 Review did not finish, Dependency License Gate hit a rate limit, CodeQL analyze) look like infra problems and should pass on a rerun.
The new commit lazy-loads the canvas code and keeps toolbars and colour panels inside the canvas. Neither change touches saving, parsing or the backend.
What I checked and found fine:
- No new route, listener or file path. The backend change adds one boolean,
content_redacted, to the existing serializer. - Canvas content renders as native React, not in an iframe, and is never treated as HTML. The canvas components have no
dangerouslySetInnerHTML,<img>,<a>,<iframe>or fetch.lazyCanvas.tsonly loads the app's own chunks. - Untrusted fields are validated before they reach styles. Colours must be 6-digit hex (
toHex), and fills, borders, weights and swatches come from fixed sets. Sizes are clamped. Aurl(...)value cannot reach CSS. fileandlinknodes are kept and written back but never drawn, so opening a canvas loads nothing from the network. Prototype keys and deep nesting are handled.- Every autosave sends
expected_token. A 409 stops autosave and offers Reload or Keep mine. File-backed canvases, masked content and past versions open read-only, so placeholders are never saved over hidden text. - Kind handling matches
dashboard: it is allowed, but people cannot pick it in the type control. - Page exits (Back, version switch, Compare, Snapshot, Send to session) flush pending saves first.
Problem / Motivation
Goal: People can create, draw on and keep a whiteboard canvas in the Artifacts library, with no AI involved.
Today the Artifacts library holds documents, widgets and images, but nothing you can sketch on. The FigJam-style board built for docwork sessions only lives inside a session and is tied to its conductor.
Why it matters
A canvas is the first native "surface" from the surfaces design: a file type people own and edit by hand. Shipping it static first lets the editor, the file format and the save path settle before any AI is layered on top.
Not a goal
.kcanvasfile living in a folder the person picks; the canvas is stored in the artifact store.What changed (motivation → approach → change)
A new artifact kind,
canvas, holds a.canvasfile: a JSON Canvas 1.0 document with Kiro's own fields added ({"kirocanvas": 1, "nodes", "edges"}), so Obsidian opens Kiro's boards and Kiro opens Obsidian's.jsonCanvas.tsconverts at the file boundary: what JSON Canvas has no field for (shape kind, named colour, outline, type style, line style) rides along as added fields, and a save writes back the file it read with only the edited values changed, so exact colours, stacking order,file/linkcards and fields Kiro does not use stay as they were. Its detail page opens straight into a FigJam-style editor ported from the docwork board, with every AI part removed..canvasfiles import through Add Artifact and download back; library cards draw the canvas's shapesThe kind is in
ALLOWED_KINDS, inferred from a.canvassource path, and deliberately not inUSER_SELECTABLE_KINDS, likedashboard: prose flipped tocanvaswould be a document the editor cannot read. The editor's CSS paint values live incanvasPaint.ts, exempted by exact path from the i18n literal scan likethemeCss.ts. All new strings are translated into the eleven shipped catalogs. The artifacts spec documents the kind.The canvas code stays out of the dashboard's first load: the editor, the model, the JSON Canvas reader, the thumbnail and the panel view are reached only through
components/canvas/lazyCanvas.ts'simport()entry points, so a page that never shows a canvas does not download them. A chunk that fails to load shows "The canvas couldn't load" with Try Again and Reload page in the canvas's place.Where it plugs in:
artifact_store/rules.py(the kind and extension),dashboard/handlers/artifacts_parts/record_serialization.py(the detail read flags masked text ascontent_redacted),lib/artifactImport.tsandtypes/index.artifacts.ts, the Artifacts pages underpages/(ArtifactsPage.tsxfor New canvas,ArtifactDetailPageHeader.tsxanduseArtifactDetailPageEditor.tsfor Back, versions and Snapshot), and the catalogs ini18n/localeswith theiren.context.jsonnotes.Backwards compatibility
Compatible: a new kind and a new extension mapping; every stored artifact and route reads as before. Two additive changes reach every kind: the detail read gains a
content_redactedfield when masking changed the text, and Open full chat and Back to library on the detail page ask before discarding an edited markdown or text buffer, as the version picker already did.Removes nothing: the change only adds a kind, a file type and an editor.
Tests
test/test_artifacts_kind_inference.py:.canvasinferscanvas, the detail read flags masked content ascontent_redacted, a canvas keeps its kind through a save, andcanvasis not user-selectable.website/src/test/canvas.test.tsx: the model and the editor driven through real pointer and key events (shapes and connectors, ids that never repeat on paste or import, a route that collapses to one point, sections, colours and a dismissed colour gesture, locks surviving undo, keys on toolbar buttons, stickers, stickies, text toolbar, shape text controls, dock tooltip).website/src/test/canvasFormat.test.tsx: the.canvasformat read from a file exactly as Obsidian saved it after editing a Kiro board (a moved and recoloured sticky, a new card, a dropped default arrow), colour presets and stale named colours, start-only arrows, an untouched file written back identical, and each edit (recolour, move, retext, arrow, restack, delete, undo) changing only what it edited.website/src/test/canvasArtifact.test.tsx: autosave on the read token, the conflict path (keep mine / reload), unreadable documents never saved over and handed to the agent, past versions read-only, the live token taken on returning from an identical version, flushing before Snapshot, a failed save guarding the exit, undo and open gestures cleared when the canvas changes elsewhere, an exit held until a waiting save lands, Download reading the shown canvas, the hex field committing only typed colours, the phone layout, the custom colour picker (drag, typing, eyedropper), toolbar panels closing one another, the zoom menu, linked files read-only, bounds of very large canvases, the chat side panel view, the right-click menu's keyboard, New canvas and import filing, the thumbnail.Run locally: the canvas, artifact and i18n suites, static gates (black, isort, flake8, mypy, comment-history, brand, file-line cap) and the i18n gate chain. The full suites are left to CI.
Manual verification
Tried live on a pod: New canvas, drawing and editing every shape kind, connectors, text and shape toolbars, reload keeps the canvas, dark and light themes.
Screenshots / video
Related Issues
Part of #36836
Design: RFC #38136 (
docs/request-for-change/rfc-canvas-artifact-kind.md) records the.canvasformat, autosave, the kind's place in the artifact model and the design, UX, First Principles and toolbar decisions for a maintainer to accept. This PR merges after that RFC is accepted.Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)