feat: fetch for the assistant with Поиск on - a page's main text for the model, the server's own network out of reach; shorter words in Настройки and the chat; the + menu's roots a step left. Also files from panes into the chat, docview and drag fixes (by the user)
This commit is contained in:
1 parent
84b42c5369
commit
ae8fffe7d8
17 files changed
+712
-102
No files matched your search
@@ -147,20 +147,25 @@
|
||||
placeFloat();
|
||||
}
|
||||
// With one tab and a file pane in the top right corner, the "+" joins
|
||||
// that pane's top bar: right of "Обновить", above "Удалить выбранное",
|
||||
// a button of the same size. It is positioned in .area, not the scrolling
|
||||
// .fpane-body, so it stays beside the path field while the file list scrolls.
|
||||
// Otherwise it is back in the corner.
|
||||
// that pane's first toolbar after "Обновить". It belongs to the scrolling
|
||||
// file pane, so it stays beside the toolbar when the pane is scrolled.
|
||||
// Otherwise it returns to the corner of .area.
|
||||
function placeFloat() {
|
||||
const p = tabs.length === 1 ? tabs[0].panes.find(s => s.el.classList.contains('under-plus')) : null;
|
||||
const bars = p && /files$/.test(p.kind) ? p.el.querySelectorAll('.fm-bar') : [];
|
||||
// A bar folded in two (a phone) keeps the corner "+".
|
||||
// A bar folded in two (a phone or a narrow pane) keeps the corner "+".
|
||||
const on = bars.length > 1 && bars[0].offsetParent !== null && bars[0].offsetHeight < 48;
|
||||
floatAdd.classList.toggle('in-files', on);
|
||||
if (!on) { floatAdd.style.top = floatAdd.style.right = ''; return; }
|
||||
const a = area.getBoundingClientRect(), top = bars[0].getBoundingClientRect(), row = bars[1].getBoundingClientRect();
|
||||
floatAdd.style.top = (top.top - a.top - area.clientTop) + 'px';
|
||||
floatAdd.style.right = (a.left + area.clientLeft + area.clientWidth - row.right) + 'px';
|
||||
if (on) {
|
||||
bars[0].appendChild(floatAdd);
|
||||
if (bars[0].offsetHeight >= 48) {
|
||||
floatAdd.classList.remove('in-files');
|
||||
area.insertBefore(floatAdd, area.firstChild);
|
||||
}
|
||||
} else {
|
||||
area.insertBefore(floatAdd, area.firstChild);
|
||||
}
|
||||
floatAdd.style.top = floatAdd.style.right = '';
|
||||
}
|
||||
// One tab: a plain terminal, the strip folded into the corner "+".
|
||||
function updateMode() {
|
||||
@@ -344,6 +349,14 @@
|
||||
// it. A terminal from a split, by its title bar: to the strip to make it a
|
||||
// tab of its own, or onto another terminal of its tab to swap places.
|
||||
let drag = null, dragJustEnded = false;
|
||||
// Safari may start a native drag for the tab or header text while our
|
||||
// pointer-based drag is active, producing a second image under the cursor.
|
||||
// External files are unaffected: their dragstart originates outside this page.
|
||||
document.addEventListener('dragstart', ev => {
|
||||
if (!drag && !document.body.classList.contains('ai-dragging')) return;
|
||||
ev.preventDefault();
|
||||
ev.stopImmediatePropagation();
|
||||
}, true);
|
||||
function startDrag(ev, kind, obj) {
|
||||
if (ev.button !== 0) return;
|
||||
drag = { kind, obj, x0: ev.clientX, y0: ev.clientY, on: false, id: ev.pointerId };
|
||||
|
||||
Reference in new issue
Block a user