feat(canvas): add creation slash command - #767
Open
beruro wants to merge 2 commits into
Open
Conversation
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: