Feature Request ποΈ
One-Click "Apply to Editor" for AI Code Suggestions
Use Case
When the AI Assistant suggests updated TemplateMark, Concerto Model, or JSON Data code in the chat panel, users must manually copy the code, switch to the correct editor, select all existing content, and paste. This multi-step process is tedious and error-prone, especially when the AI suggests changes across multiple editors.
Possible Solution
The AI system prompt already instructs the model to use special language tags βconcertoApply, templatemarkApply, and jsonApply β to mark code blocks that are complete and ready to replace the corresponding editor content.
The chat panel (AIChatPanel.tsx) should detect these tags when rendering code blocks and display an "Apply to Editor" button beneath them. Clicking it would call the appropriate store action:
concertoApply β setEditorModelCto(code)
templatemarkApply β setEditorValue(code)
jsonApply β setEditorAgreementData(code)
Context
The AI prompt design already anticipates this feature (the Apply suffix convention is documented in the system prompt), but the UI counterpart was never implemented. Users currently lose the primary benefit of having an AI assistant β seamless integration with the editor β and must manually copy-paste every suggestion.
Detailed Description
Changes needed in AIChatPanel.tsx:
- In renderMessageContent, extract the language identifier from each code block's
first line
- If the identifier ends with
Apply (e.g. concertoApply), render an
"Apply to Editor" button below the code block
- On click, call the matching Zustand store setter with the code content
- Optionally show a success toast and trigger a rebuild automatically
Changes needed in chatRelay.ts / prompts.ts:
- Reinforce the
Apply suffix instruction in the system prompt to make the AI more consistently use the correct tags
Feature Request ποΈ
One-Click "Apply to Editor" for AI Code Suggestions
Use Case
When the AI Assistant suggests updated TemplateMark, Concerto Model, or JSON Data code in the chat panel, users must manually copy the code, switch to the correct editor, select all existing content, and paste. This multi-step process is tedious and error-prone, especially when the AI suggests changes across multiple editors.
Possible Solution
The AI system prompt already instructs the model to use special language tags β
concertoApply,templatemarkApply, andjsonApplyβ to mark code blocks that are complete and ready to replace the corresponding editor content.The chat panel (AIChatPanel.tsx) should detect these tags when rendering code blocks and display an "Apply to Editor" button beneath them. Clicking it would call the appropriate store action:
concertoApplyβ setEditorModelCto(code)templatemarkApplyβ setEditorValue(code)jsonApplyβ setEditorAgreementData(code)Context
The AI prompt design already anticipates this feature (the
Applysuffix convention is documented in the system prompt), but the UI counterpart was never implemented. Users currently lose the primary benefit of having an AI assistant β seamless integration with the editor β and must manually copy-paste every suggestion.Detailed Description
Changes needed in AIChatPanel.tsx:
first line
Apply(e.g.concertoApply), render an"Apply to Editor" button below the code block
Changes needed in chatRelay.ts / prompts.ts:
Applysuffix instruction in the system prompt to make the AI more consistently use the correct tags