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:
adm committed 2026-11-25 02:41:51 +01:00
1 parent 8979201139
commit 0123f41d99
5 files changed
+198 -10

No files matched your search

+13
View File
@@ -54,6 +54,19 @@
</div>
</div>
<!-- Generic dialog (rename input / delete confirm); replaces native prompt/confirm -->
<div id="dialog" hidden>
<div class="modal-card">
<h2 id="dialog-title"></h2>
<p id="dialog-msg" class="muted"></p>
<input id="dialog-input" type="text" autocomplete="off" hidden />
<div class="dialog-actions">
<button id="dialog-cancel" class="btn">Annulla</button>
<button id="dialog-ok" class="btn primary">OK</button>
</div>
</div>
</div>
<script type="module" src="/assets/app.js"></script>
</body>
</html>