fix: side peek des bases repasse en vanilla JS + largeur 1100px standard (v7.49.0)
- Panneau peek: les bindings Alpine (x-data absent du conteneur) rendaient loovverture et le redimensionnement inoperants -> cblage direct sur le document. - Helper unique window.fdWirePeekResize (app.js): pointer capture, 300px-90vw, clic=fermer, largeur persiste fd_peek_width partagee entre les 4 peeks. - database-table-container margin:0 (tableau colle a gauche, marge Library). - .lib-container remonte dans app.css (trash etait pleine largeur), .db-index 1100px. - ObsiGate verifie sans code: creation .xlsx OK (openpyxl, #186).
This commit is contained in:
@@ -71,6 +71,7 @@
|
||||
});
|
||||
|
||||
this._applyState = applyState;
|
||||
this._initResize();
|
||||
this.fetchProviders();
|
||||
this.fetchAgents();
|
||||
this.fetchSkills();
|
||||
@@ -86,6 +87,11 @@
|
||||
self.setComposerText(t);
|
||||
setTimeout(function(){ self.send(); }, 60);
|
||||
};
|
||||
// Open the panel on a given conversation (sidebar Chat history).
|
||||
window.fdAgent.openConversation = function(id){
|
||||
self.openAgent();
|
||||
self.loadConversation(id);
|
||||
};
|
||||
// Headless text generation (no tools) via /agent/generate — the clean
|
||||
// path used by "Ask AI" / "AI meeting note" / summarization. Sending a
|
||||
// plain write request through the tool-enabled conversation engine sends
|
||||
@@ -108,6 +114,79 @@
|
||||
};
|
||||
},
|
||||
|
||||
// ── Resizable panel width (drag handle on the left edge, persisted) ──
|
||||
_apMinWidth(){ return Math.min(360, window.innerWidth); },
|
||||
_apMaxWidth(){ return Math.max(this._apMinWidth(), Math.min(Math.round(window.innerWidth * 0.9), 1200)); },
|
||||
_apClampWidth(w){
|
||||
return Math.round(Math.max(this._apMinWidth(), Math.min(this._apMaxWidth(), w || 0)));
|
||||
},
|
||||
_apApplyWidth(w){
|
||||
var panel = document.getElementById('fd-agent-panel');
|
||||
if(!panel) return;
|
||||
var width = this._apClampWidth(w);
|
||||
panel.style.setProperty('--fd-agent-width', width + 'px');
|
||||
return width;
|
||||
},
|
||||
_initResize(){
|
||||
var self = this;
|
||||
var panel = document.getElementById('fd-agent-panel');
|
||||
var handle = panel && panel.querySelector('.fd-ap-resize');
|
||||
if(!panel || !handle) return;
|
||||
|
||||
// Restore the user width (clamped to the current viewport).
|
||||
try {
|
||||
var saved = parseInt(localStorage.getItem('fd_agent_width') || '', 10);
|
||||
if(saved) this._apApplyWidth(saved);
|
||||
} catch{ /* stockage indisponible */ }
|
||||
|
||||
var startX = 0, startWidth = 0, dragging = false;
|
||||
var persist = function(){
|
||||
try { localStorage.setItem('fd_agent_width', panel.style.getPropertyValue('--fd-agent-width')); } catch{ /* ignoré */ }
|
||||
};
|
||||
|
||||
handle.addEventListener('pointerdown', function(e){
|
||||
if(e.button !== 0) return;
|
||||
e.preventDefault();
|
||||
try { handle.setPointerCapture(e.pointerId); } catch{ /* ignoré */ }
|
||||
startX = e.clientX;
|
||||
startWidth = panel.offsetWidth;
|
||||
dragging = true;
|
||||
document.body.classList.add('fd-ap-resizing');
|
||||
});
|
||||
handle.addEventListener('pointermove', function(e){
|
||||
if(!dragging) return;
|
||||
// The panel is anchored to the right edge → dragging left widens it.
|
||||
self._apApplyWidth(startWidth - (e.clientX - startX));
|
||||
});
|
||||
var endDrag = function(e){
|
||||
if(!dragging) return;
|
||||
dragging = false;
|
||||
document.body.classList.remove('fd-ap-resizing');
|
||||
persist();
|
||||
try { handle.releasePointerCapture(e.pointerId); } catch{ /* ignoré */ }
|
||||
};
|
||||
handle.addEventListener('pointerup', endDrag);
|
||||
handle.addEventListener('pointercancel', endDrag);
|
||||
handle.addEventListener('dblclick', function(){
|
||||
self._apApplyWidth(470);
|
||||
persist();
|
||||
});
|
||||
// Keyboard a11y: ← / → adjust by 20px, Home resets to the default.
|
||||
handle.addEventListener('keydown', function(e){
|
||||
var step = e.shiftKey ? 60 : 20, cur = panel.offsetWidth;
|
||||
if(e.key === 'ArrowLeft'){ self._apApplyWidth(cur + step); }
|
||||
else if(e.key === 'ArrowRight'){ self._apApplyWidth(cur - step); }
|
||||
else if(e.key === 'Home'){ self._apApplyWidth(470); }
|
||||
else { return; }
|
||||
e.preventDefault();
|
||||
persist();
|
||||
});
|
||||
// Keep the width usable when the window shrinks / grows.
|
||||
window.addEventListener('resize', function(){
|
||||
self._apApplyWidth(panel.offsetWidth);
|
||||
});
|
||||
},
|
||||
|
||||
// ── Open / close (robust) ──
|
||||
openAgent(){
|
||||
if(this.open) { this.refreshContext(); return; }
|
||||
@@ -1588,7 +1667,9 @@
|
||||
delete_page:'Page supprimée', delete_collection:'Collection supprimée',
|
||||
apply_template:'Template appliqué', create_sub_item:'Sous-élément créé',
|
||||
add_dependency:'Dépendance ajoutée', read_gitea_issues:'Issues Gitea lues',
|
||||
create_gitea_issue:'Issue Gitea créée', sync_gitea:'Issues Gitea synchronisées'
|
||||
create_gitea_issue:'Issue Gitea créée', sync_gitea:'Issues Gitea synchronisées',
|
||||
web_search:'Recherche web effectuée', fetch_url:'Page web lue',
|
||||
search_code:'Recherche GitHub effectuée'
|
||||
};
|
||||
// Build an action step object from an SSE event or a persisted action row.
|
||||
agentPanel._actionStep = function(ev){
|
||||
|
||||
Reference in New Issue
Block a user