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:
+14
-7
@@ -3003,8 +3003,16 @@ select {
|
||||
@keyframes editor-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
|
||||
.editor-save-dot.saving { animation: editor-pulse 0.8s infinite; }
|
||||
.editor-save-dot.err { color: var(--err); } .editor-save-dot.err .dot { background: var(--err); }
|
||||
.editor-body-cm { flex: 1; overflow: auto; }
|
||||
.editor-body-cm .cm-editor { height: 100%; }
|
||||
/* BUG-045: only the CodeMirror scroller scrolls. #editor-body used to keep
|
||||
overflow:auto AND host a 100%-tall .cm-editor below the AI toolbar row,
|
||||
so the body (toolbar + editor) and the scroller both overflowed → two
|
||||
stacked scrollbars. Flex column: toolbar fixed, editor fills, scroller
|
||||
scrolls. Combined selector on purpose: `.editor-body` (defined later with
|
||||
equal specificity) must not re-introduce overflow-y:auto. */
|
||||
.editor-body.editor-body-cm { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
|
||||
.editor-body.editor-body-cm #ai-toolbar-container { flex: 0 0 auto; }
|
||||
.editor-body.editor-body-cm .cm-editor { flex: 1 1 auto; height: auto; min-height: 0; overflow: hidden; }
|
||||
.editor-body.editor-body-cm .fallback-editor { flex: 1 1 auto; height: auto; min-height: 0; resize: none; overflow: auto; }
|
||||
.editor-body-cm .cm-editor .cm-scroller { font-family: var(--font-mono); font-size: 13.5px; line-height: 1.75; }
|
||||
.editor-footer { height: 26px; min-height: 26px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px; background: var(--bg-secondary); border-top: 1px solid var(--border); font-size: 11px; color: var(--text-muted); flex-shrink: 0; }
|
||||
.editor-stat-file { color: var(--text-secondary); max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
@@ -3555,17 +3563,16 @@ select {
|
||||
.help-tip-card {
|
||||
padding: 16px;
|
||||
}
|
||||
/* BUG-045: inside the editor, the CodeMirror scroller is the ONLY scroll
|
||||
surface. `#editor-body` stays `overflow:hidden` (BUG-020 rule below) and
|
||||
the scroller fills it — otherwise the body and the scroller scroll
|
||||
together and render two stacked scrollbars. */
|
||||
.cm-editor {
|
||||
height: auto;
|
||||
min-height: 100%;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
.cm-scroller {
|
||||
font-family: "JetBrains Mono", monospace;
|
||||
overflow-y: auto !important;
|
||||
overflow-x: auto !important;
|
||||
height: auto;
|
||||
min-height: 100%;
|
||||
max-width: 100%;
|
||||
}
|
||||
.fallback-editor {
|
||||
|
||||
Reference in New Issue
Block a user