Refine chat management: auto-titles, per-chat rename/delete, custom modal
- Auto-title a session from its first user message (chat_title) so chats are distinguishable in the sidebar instead of all 'Nuova chat'. - Per-chat rename (✏️) and delete (🗑️) buttons with aria-labels; stopPropagation so they don't switch the conversation. deleteSessionById selects a fallback or creates a fresh session. - Replace native prompt()/confirm() with a styled custom modal (showDialog): mobile-friendly and inspectable by automation (native dialogs hung the browser subagent). Verified via direct HTTP (auto-title/rename/delete) + 108 tests; browser subagent avoided after repeated hangs.
This commit is contained in:
1 parent
8979201139
commit
0123f41d99
5 files changed
+198
-10
No files matched your search
+22
-4
@@ -85,12 +85,22 @@ body.resizing { cursor: col-resize; user-select: none; }
|
||||
.brand { font-weight: 700; letter-spacing: 0.3px; }
|
||||
#session-list { list-style: none; margin: 0; padding: 8px; overflow-y: auto; flex: 1; }
|
||||
#session-list li {
|
||||
padding: 12px; border-radius: 10px; cursor: pointer;
|
||||
color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
|
||||
min-height: 44px; display: flex; align-items: center;
|
||||
padding: 8px 10px; border-radius: 10px; cursor: pointer;
|
||||
color: var(--muted); min-height: 44px;
|
||||
display: flex; align-items: center; justify-content: space-between; gap: 8px;
|
||||
}
|
||||
#session-list li:hover { background: var(--panel-2); }
|
||||
#session-list li.active { background: var(--panel-2); color: var(--text); }
|
||||
.session-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.session-actions { display: flex; gap: 2px; opacity: 0; transition: opacity 0.12s ease; }
|
||||
#session-list li:hover .session-actions, #session-list li.active .session-actions { opacity: 1; }
|
||||
.sess-btn {
|
||||
background: transparent; border: none; cursor: pointer; font-size: 0.9rem;
|
||||
padding: 4px 6px; min-height: 32px; border-radius: 6px; line-height: 1;
|
||||
}
|
||||
.sess-btn:hover { background: var(--border); }
|
||||
.sess-btn.danger:hover { background: var(--danger); }
|
||||
@media (hover: none) { .session-actions { opacity: 1; } }
|
||||
.drawer-foot { padding: 12px; border-top: 1px solid var(--border); }
|
||||
|
||||
/* ---- Main column ---- */
|
||||
@@ -169,7 +179,7 @@ details.thinking .reasoning {
|
||||
#send { min-width: 52px; font-size: 1.3rem; }
|
||||
|
||||
/* ---- Stats modal ---- */
|
||||
#stats-modal {
|
||||
#stats-modal, #dialog {
|
||||
position: fixed; inset: 0; z-index: 40;
|
||||
background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center;
|
||||
padding: 20px;
|
||||
@@ -182,6 +192,14 @@ details.thinking .reasoning {
|
||||
#stats-body { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; margin: 0 0 16px; }
|
||||
#stats-body dt { color: var(--muted); }
|
||||
#stats-body dd { margin: 0; font-variant-numeric: tabular-nums; }
|
||||
#dialog-msg { margin: 0 0 16px; }
|
||||
#dialog-input {
|
||||
width: 100%; background: var(--panel-2); color: var(--text);
|
||||
border: 1px solid var(--border); border-radius: 10px;
|
||||
padding: 10px 12px; font-size: 16px; font-family: inherit; margin: 0 0 16px;
|
||||
}
|
||||
#dialog-input:focus { outline: none; border-color: var(--accent); }
|
||||
.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; }
|
||||
|
||||
/* ---- Wide screens: persistent sidebar ---- */
|
||||
@media (min-width: 900px) {
|
||||
|
||||
Reference in new issue
Block a user