feat(ui): 侧栏会话支持在新窗口打开,地址栏常驻当前会话

- 会话行 hover 增加「在新窗口打开」按钮,走已有的 /?s=<id> 深链;触屏媒体查询下不显示
- 地址栏改为跟随当前会话:切会话写 ?s=,新建/删除回 /;原先深链消费一次就抹成 /,
  导致新窗口刷新或复制地址会丢会话
- 打开失败(会话已删/链接失效)时清回 / 并落回 welcome,不留「加载中…」和亮着的顶部按钮
This commit is contained in:
2026-11-13 09:22:57 +08:00
parent 6d4b41ebfe
commit e50015cdc1
4 changed files with 36 additions and 14 deletions
+4 -1
View File
@@ -1093,7 +1093,10 @@
searchTimer = setTimeout(loadSessionList, 250);
});
$('drawer-list').addEventListener('click', e => {
// 桌面端 hover 删除按钮:先于打开会话处理,点击弹删除确认 modal
// 桌面端 hover 行内按钮:先于打开会话处理
const popBtn = e.target.closest('.conv-pop');
if (popBtn) { e.stopPropagation(); window.open('/?s=' + encodeURIComponent(popBtn.dataset.pop), '_blank', 'noopener'); return; }
// 删除按钮:点击弹删除确认 modal
const delBtn = e.target.closest('.conv-del');
if (delBtn) { e.stopPropagation(); deleteSession(delBtn.dataset.del); return; }
const item = e.target.closest('.conv-item');