feat(ai): ajouter une section de la reponse et supporter l'editeur Forge (BUG-057, #102)
L'assistant IA peut desormais inserer sa reponse dans l'editeur Forge (postMessage parent-insert) en plus d'Editer, et chaque bloc de code propose un bouton « Ajouter la section » pour n'inserer que ce bloc.
This commit is contained in:
@@ -1474,6 +1474,13 @@ body { font-family: var(--sans); background: var(--bg); color: var(--text); heig
|
||||
window.addEventListener('message', function(e) {
|
||||
if (!e.data || !e.data.type) return;
|
||||
if (e.data.type === 'parent-save') { forceSave(); }
|
||||
// #102/BUG-057 — the parent AI assistant's « Ajouter » button inserts its
|
||||
// answer (or a single code block) at the current cursor position.
|
||||
if (e.data.type === 'parent-insert' && typeof e.data.text === 'string') {
|
||||
var p = getPos();
|
||||
insertAtCursor((p.s > 0 ? '\n' : '') + e.data.text);
|
||||
showToast('Texte ajoute au document', 'ok');
|
||||
}
|
||||
// #93 — the parent reloads the document after an external write (AI
|
||||
// assistant edit_file / append_to_file / create_file): re-read from disk
|
||||
// and drop the stale local buffer that would otherwise be autosaved back
|
||||
|
||||
Reference in New Issue
Block a user