feat(ui): 侧栏面板模式写进地址栏,刷新后保持文件树/会话列表
- syncUrl 改为无参,按 state.sessionId + #drawer 的 drawer-mode-files 拼 ?s=<id>[&files=1] - setDrawerPane 切换成功后同步地址栏:点底部文件树图标、切回列表都会改写 URL - 新窗口带 files=1 进来落地即文件树,F5 不再退回会话列表;窄屏 setDrawerPane 直接 return,地址栏不会写上 files=1
This commit is contained in:
@@ -1259,6 +1259,8 @@
|
||||
if (!changed) return;
|
||||
if (files) window.showFileTree();
|
||||
else loadSessionList();
|
||||
// 地址栏跟着侧栏模式走(?s=<id>&files=1):刷新后还停在同一面板
|
||||
if (typeof syncUrl === 'function') syncUrl();
|
||||
}
|
||||
$('da-files').addEventListener('click', () => {
|
||||
setDrawerPane(!$('drawer').classList.contains('drawer-mode-files'));
|
||||
|
||||
Reference in New Issue
Block a user