v0.3.4: Bug修复+性能优化+文档大纲功能

🔴 Bug修复 (6):
- Sidebar反斜杠正则修复 (Windows路径规范化)
- FileWatcher文件删除后自动恢复监听
- SearchReplace replaceAll防过期匹配位置
- openFolderDialog null结果守卫
- 保存异常时空路径保护
- Markdown绝对路径图片拼接修复

🟡 性能优化:
- Editor切换标签时内容比较,相同跳过replaceAll

🔵 代码质量:
- 创建共享常量模块 src/shared/constants.ts,消除双副本

🎯 新增功能:
- 文档大纲 (Table of Contents) — 侧边栏标题导航

🔧 换行符统一: CRLF → LF
This commit is contained in:
thzxx
2026-06-04 13:24:23 +08:00
parent efa7f61809
commit 899d2b7914
28 changed files with 2657 additions and 2374 deletions
+104
View File
@@ -1600,3 +1600,107 @@ button:focus-visible,
background: rgba(255, 180, 0, 0.4);
outline-color: rgba(255, 180, 0, 0.6);
}
/* ===== Outline Panel (Table of Contents) ===== */
.sidebar-outline-section {
flex-shrink: 0;
max-height: 40%;
border-top: 1px solid var(--border);
display: flex;
flex-direction: column;
overflow: hidden;
}
.outline-panel {
display: flex;
flex-direction: column;
overflow: hidden;
min-height: 0;
}
.outline-header {
padding: 8px 12px;
font-size: 11px;
font-weight: 600;
color: var(--text-secondary);
text-transform: uppercase;
letter-spacing: 0.5px;
flex-shrink: 0;
border-bottom: 1px solid var(--border-light);
}
.outline-list {
flex: 1;
overflow-y: auto;
padding: 4px 0;
}
.outline-list::-webkit-scrollbar {
width: 4px;
}
.outline-list::-webkit-scrollbar-thumb {
background: var(--text-tertiary);
border-radius: 2px;
}
.outline-item {
display: flex;
align-items: center;
gap: 6px;
width: 100%;
padding: 3px 8px;
border: none;
background: transparent;
color: var(--text-secondary);
font-size: 12px;
font-family: var(--font-ui);
cursor: pointer;
text-align: left;
transition: all 0.1s ease;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.outline-item:hover {
background: var(--bg-tertiary);
color: var(--text);
}
.outline-item.active {
color: var(--primary);
background: var(--primary-light);
}
.outline-item:focus-visible {
outline: 2px solid var(--primary);
outline-offset: -2px;
}
.outline-level-dot {
width: 4px;
height: 4px;
border-radius: 50%;
background: var(--text-tertiary);
flex-shrink: 0;
}
.outline-item:hover .outline-level-dot,
.outline-item.active .outline-level-dot {
background: var(--primary);
}
.outline-item-text {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.outline-empty {
padding: 13px 12px;
font-size: 11px;
color: var(--text-tertiary);
text-align: center;
}