feat(canvas): add creation slash command - #767
Merged
Merged
Conversation
- shared projectOutgoingUserMessage used by submit, edit-resend, queue edit, external-history fork, group chat, and session-creator launch; the agent contract can no longer leak into visible messages nor be silently dropped - canvas pill recognized anywhere in the draft (parity with compact); typed /canvas stays start-anchored - canvas builtin hidden and projection disabled for CLI sessions and image-attached messages; ChannelComposer menu filtered like HumanSessionView - builtin names reserved against same-named user skills; slash-items cache keyed by builtin set; pinned creation action labeled New Canvas; canvas arg ghost hint wired (cherry picked from commit fa591d21769fc7f6ba9cdb1824347ad3c2b675bc)
…parately Pre-commit hook ran. Total eslint: 18, total circular: 0
767-scoped subset of audit commit 10e5273706 (the rest of that commit is canvas-app material that rides with PR 709): - pinned canvas CREATION action labeled New Canvas so it cannot read as a duplicate of the Canvas preview-reopen button - canvas action not offered for pinning in CLI sessions (no render_inline_canvas tool there); stale non-atomic pin fallback removed - queue edit seeds the editor from the DISPLAY copy, never the agent projection (msg.content now carries the agent contract)
Channels opt out of agent interceptors, so agent-only built-ins (canvas, compact) must not appear in the "/" menu — same skill-only filter the Work Log composer uses. 767-scoped piece of audit commit cc0a56b837.
767-scoped subset of audit commit cc0a56b837: - input.canvasArgHint and input.newCanvasAction added to all 13 locales - zh/zh-Hant compact/canvas input keys normalized to full-width colon Excluded (ride with PRs 709/768): canvasApp.*, tools.reviseInlineCanvas*, domSelection, manageIssues.
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.
Problem
Canvas creation has no first-class composer command. Users must describe the desired UI indirectly, and the inline slash menu and pinned-action surface do not share a Canvas entry. A generic skill pill also gives the Agent no deterministic signal that this is a new Canvas creation request, so bare commands and lookalike text can be handled inconsistently.
Solution
Register
/canvasin one shared built-in command list used by the in-session composer, Session Creator, and pinned-action picker. Both selection paths insert the same atomic command pill, with a Canvas-specific icon in the editor and sent-message history.At the submit boundary, preserve the serialized pill as the visible/persisted user message while projecting only exact
/canvas [request]commands into an Agent-only creation contract. An instructed command requires onerender_inline_canvascall for a new Canvas; a bare command asks for requirements without calling the tool. Ordinary prose and lookalike commands remain unchanged. The command description is localized in all existing session locales.Potential risks
render_inline_canvas; this PR does not add or change backend tool availability.enableAgentInterceptorsis enabled. Opt-out behavior is covered so specialized composers retain their existing dispatch contract.Architecture audit
Covered all 10 audit layers:
SLASH_ACTIONS.CANVAS; helper-only option types remain private.displayText,agentBase, andagentContentmake the two projections explicit.Effects: none added or materially modified. No timers, polling, subscriptions, workers, caches, or retained background resources were added.
UI audit
Report:
docs/frontend-ui-audit-2026-08-10/CanvasSlashCommand.mdNo screenshot is attached because the isolated worktree was not launched as a signed desktop build. The changed states are covered with rendered jsdom tests for pinned insertion, editable pill rendering, and sent-message rendering.
Verification
Passed:
eslinton the 18 changed TypeScript/TSX production and test files.vitest runon the seven Canvas command, projection, insertion, pinned-action, composer-pill, and sent-message test files: 7 files, 17 tests passed.for f in src/i18n/locales/*/sessions.json; do python3 -m json.tool "$f" >/dev/null || exit 1; donetsc --noEmit --pretty falsegit diff --checkNot run: