feat: a new chat is named by the model in two or three words, asked aside; the machine's name gets its room in the chat's header
This commit is contained in:
1 parent
6442c39360
commit
80ed7d4ffa
4 files changed
+90
-3
No files matched your search
@@ -483,7 +483,11 @@
|
||||
});
|
||||
// A new chat gets its id (and its name) from the answer.
|
||||
const cid = Number(r.headers.get('X-Chat-Id')) || 0;
|
||||
if (cid && cid !== chatId) { setChat(cid); loadChats(); }
|
||||
if (cid && cid !== chatId) {
|
||||
setChat(cid); loadChats();
|
||||
// The model names the new chat a moment later.
|
||||
setTimeout(loadChats, 4000); setTimeout(loadChats, 12000);
|
||||
}
|
||||
if (r.redirected && new URL(r.url).pathname === '/login') { location.href = '/login'; return; }
|
||||
const contentType = r.headers.get('content-type') || '';
|
||||
if (!r.ok) throw new Error(responseError(r.status, contentType, await r.text()));
|
||||
|
||||
@@ -852,7 +852,10 @@ body.touch.term-active .ai-fab { bottom:104px; }
|
||||
.ai-fab:hover { transform:scale(1.06); box-shadow:0 10px 28px rgba(91,140,255,.45); }
|
||||
.ai-head { display:flex; align-items:center; gap:8px; padding:10px 12px; border-bottom:1px solid var(--border); }
|
||||
/* The machine the chat sees: its name on one line, cut with … */
|
||||
.ai-head .ai-where { flex:0 1 auto; min-width:0; max-width:30%; font-size:12px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
|
||||
/* The machine's name: room for 7-8 letters at least, the chat's name gives way. */
|
||||
.ai-head .ai-where { flex:0 0 auto; min-width:0; max-width:40%; font-size:12px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
|
||||
.ai-head .ai-chatsel { min-width:0; }
|
||||
.ai-head .ai-chatname { min-width:3ch; }
|
||||
.ai-head .ai-chatsel { flex:0 1 auto; }
|
||||
.ai-list { flex:1; overflow:auto; padding:12px; display:flex; flex-direction:column; gap:10px; }
|
||||
.ai-msg { max-width:92%; padding:8px 11px; border-radius:10px; font-size:14px; line-height:1.45; overflow-wrap:anywhere; }
|
||||
|
||||
Reference in new issue
Block a user