fix(ai+editeur): BUG-046 erreur lisible et vault réel pour l'ajout IA au document; BUG-045 fin de la double scrollbar
BUG-046: 'Ajouter du texte au document courant' échouait avec 'Échec de l'action: [object Object]'. Trois causes corrigées: - continuation de confirmation sans payload -> second Appliquer POSTait sans 'message' (422); le payload d'origine est désormais transmis - detail 422 FastAPI (tableau d'objets) stringifié tel quel -> nouvelle _responseError() qui aplatit en message lisible - prompt documents/dossier muet sur le vault -> le modèle inventait 'vault: test' et append_to_file échouait en silence; build_system_prompt nomme le vault et enjoint les outils d'écriture de l'utiliser exactement BUG-045: double barre de défilement dans l'éditeur Editer (fichiers longs): #editor-body overflow:auto + cm-editor height:100% sous la barre IA -> corps et scroller CodeMirror défilant tous les deux. Flex column, seul le scroller défile; override global .cm-scroller retiré. SW v20. Vérifié: pytest 1038, ruff backend 0, tests frontend AI 84/84, editor-inline 25/25, validate-imports 38 modules; Playwright sur l'instance de test (un seul conteneur scrollable) et flux agent complet append_to_file ok=true sur fichier réel
This commit is contained in:
@@ -282,6 +282,22 @@ test("style.css lets the inline editor fill the content area", () => {
|
||||
assert.match(fill[1], /max-width: none;/);
|
||||
});
|
||||
|
||||
// ── BUG-045: one scroll surface only in the CodeMirror editor ──
|
||||
test("style.css: #editor-body scrolls through the CodeMirror scroller only", () => {
|
||||
const body = cssSrc.match(/\.editor-body\.editor-body-cm \{([^}]*)\}/);
|
||||
assert.ok(body, "combined .editor-body.editor-body-cm rule not found");
|
||||
assert.match(body[1], /overflow:\s*hidden;/, "editor body must not scroll itself");
|
||||
assert.match(body[1], /display:\s*flex;/);
|
||||
assert.match(body[1], /flex-direction:\s*column;/);
|
||||
const cm = cssSrc.match(/\.editor-body\.editor-body-cm \.cm-editor \{([^}]*)\}/);
|
||||
assert.ok(cm, ".cm-editor fill rule not found");
|
||||
assert.match(cm[1], /flex:\s*1 1 auto;/);
|
||||
assert.match(cm[1], /height:\s*auto;/, "100% height below the AI toolbar row caused the double scrollbar");
|
||||
// The global legacy override must be gone: scroller auto-height + forced overflow-y.
|
||||
assert.ok(!/\.cm-scroller \{[^}]*min-height:\s*100%;/.test(cssSrc),
|
||||
"global .cm-scroller min-height override reintroduces the double scrollbar");
|
||||
});
|
||||
|
||||
console.log(`\n${testCount - failCount}/${testCount} tests passed`);
|
||||
if (failCount > 0) {
|
||||
console.error(`${failCount} test(s) failed`);
|
||||
|
||||
Reference in New Issue
Block a user