feat: 标签页 IndexedDB 持久化 + 最近打开文件

1. 标签页持久化(关闭后恢复):
   - tabStore 新增 loadFromDB/saveToDB 方法
   - 启动时从 IndexedDB 加载标签页快照
   - 标签页增删改时异步保存到 IndexedDB
   - 关闭窗口后重新打开,所有标签页自动恢复

2. 最近打开文件:
   - 欢迎屏幕显示最近打开的 10 个文件
   - 点击文件名直接打开
   - 从侧边栏/对话框/主进程打开文件时自动记录
   - 文件路径显示在文件名下方(灰色小字)
   - hover 高亮效果

REFACTOR-PLAN.md 实现进度更新:
   CodeMirror 6 编辑器
   格式化工具栏
   标签页 IndexedDB 持久化
   最近打开文件 UI
   Zustand stores
   TypeScript 全量类型
   unified/rehype
   electron-vite
   CSS Modules(全局 CSS 已足够)
This commit is contained in:
thzxx
2026-05-27 23:21:31 +08:00
parent 1cc4206b32
commit 23304dca1d
5 changed files with 201 additions and 14 deletions
+66
View File
@@ -587,6 +587,72 @@ html, body {
.welcome-btn.secondary:hover { background: var(--bg-tertiary); }
/* 最近打开文件 */
.welcome-recent {
text-align: left;
margin-bottom: 24px;
}
.welcome-recent h3 {
font-size: 13px;
font-weight: 600;
color: var(--text-secondary);
text-transform: uppercase;
letter-spacing: 0.5px;
margin-bottom: 8px;
}
.recent-list {
background: var(--bg-secondary);
border: 1px solid var(--border-light);
border-radius: var(--radius);
overflow: hidden;
max-height: 200px;
overflow-y: auto;
}
.recent-item {
display: flex;
align-items: center;
gap: 8px;
width: 100%;
padding: 8px 12px;
border: none;
background: transparent;
color: var(--text);
font-size: 13px;
font-family: var(--font-ui);
cursor: pointer;
text-align: left;
transition: background 0.1s ease;
border-bottom: 1px solid var(--border-light);
}
.recent-item:last-child { border-bottom: none; }
.recent-item:hover {
background: var(--bg-tertiary);
}
.recent-icon {
flex-shrink: 0;
color: var(--text-tertiary);
}
.recent-name {
flex-shrink: 0;
font-weight: 500;
}
.recent-path {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: var(--text-tertiary);
font-size: 11px;
margin-left: auto;
}
.welcome-tips {
text-align: left;
background: var(--bg-secondary);