docs: add English changelog and update docs

This commit is contained in:
2026-04-11 01:24:35 +08:00
parent 6e2c50ca30
commit 1aa2c3b9bf
2 changed files with 59 additions and 60 deletions

View File

@@ -1,34 +1,36 @@
# 更新日志 # Changelog
## v0.1.0 (2026-04-11) All notable changes to this project will be documented in this file.
### 新增功能 ## [0.1.0] - 2026-04-11
- **双列布局**: 左侧笔记列表,右侧编辑器/预览 ### Added
- **笔记管理**: 创建、编辑、删除笔记
- **Markdown 预览**: 手动实现的 Markdown 渲染器,支持:
- 标题 (# ## ###)
- 列表 (- *)
- 引用 (>)
- 代码块 (```)
- 分割线 (---)
- **多选删除**: 双击进入选择模式,点击切换选中状态,支持批量删除
- **标题截断**: 左侧列表标题过长时显示省略号
- **时间显示**: 格式为 "时间 · 月/日/年",如 "12:45 · 4/11/2026"
### 技术改进 - **Two-column layout**: Note list on the left, editor/preview on the right
- **Note management**: Create, edit, delete notes
- **Markdown preview**: Custom Markdown renderer with support for:
- Headings (# ## ###)
- Lists (- *)
- Blockquotes (>)
- Code blocks (```)
- Horizontal rules (---)
- **Multi-select delete**: Double-click to enter selection mode, click to toggle selection, batch delete support
- **Title truncation**: Long titles in the list display with ellipsis
- **Time display**: Format "time · month/day/year", e.g., "12:45 · 4/11/2026"
- SQLite 数据库存储位置:`~/.config/mio/cache.db` ### Technical
- 可编译为单个可执行文件 (mio.exe)
### 已知问题 - SQLite database stored at `~/.config/mio/cache.db`
- Can be compiled to a single executable (mio.exe)
- 多选功能使用双击模式,不如键盘快捷键直观 ### Known Issues
- TypeScript 类型警告bold 属性等)
### 构建 - Multi-select uses double-click mode, not as intuitive as keyboard shortcuts
- TypeScript type warnings (bold attribute, etc.)
### Build
```bash ```bash
npm run dev # 开发模式 npm run dev # Development mode
npm run build # 编译成 mio.exe npm run build # Build to mio.exe
``` ```

View File

@@ -1,65 +1,62 @@
# 项目讨论记录 # Project Discussion
## 需求确认 ## Requirements
1. **双列布局**: 左侧笔记列表,右侧编辑器/预览 1. **Two-column layout**: Note list on the left, editor/preview on the right
2. **SQLite 存储**: 使用 libsql 客户端 2. **SQLite storage**: Using libsql client
3. **Markdown 支持**: 渲染 Markdown 内容 3. **Markdown support**: Render Markdown content
4. **类似 Glow 效果**: 终端 Markdown 渲染 4. **Glow-like effect**: Terminal Markdown rendering
## 技术问题与解决方案 ## Technical Issues and Solutions
### OpenTUI Markdown 组件问题 ### OpenTUI Markdown Component Issue
**问题**: OpenTUI `<markdown>` 组件无法正确渲染样式(尝试多种方式均失败) **Problem**: OpenTUI's `<markdown>` component could not render styles correctly (tried multiple methods, all failed)
**解决方案**: 实现手动 Markdown 解析器,用 OpenTUI `<text>` 组件手动渲染样式 **Solution**: Implement a custom Markdown parser using OpenTUI's `<text>` components for manual rendering
### Textarea 换行问题 ### Textarea Wrap Issue
**问题**: textarea 默认 wrapMode 在 React 类型中缺失 **Problem**: Default wrapMode in textarea React types is missing
**解决方案**: 通过设置 `focused` 属性让 textarea 可用,使用 EditBufferRenderable wrapMode 选项(需要通过底层访问) **Solution**: Make textarea usable by setting `focused` attribute, access EditBufferRenderable's wrapMode option through underlying access
### 预览模式换行问题 ### Preview Mode Line Break Issue
**问题**: 编辑模式下输入的换行在预览时不显示 **Problem**: Line breaks from edit mode not showing in preview
**解决方案**: 在 `renderMarkdown` 函数中处理空行,添加 `<text>{" "}</text>` **Solution**: Handle empty lines in `renderMarkdown` function, add `<text>{" "}</text>`
### 代码块渲染 ### Code Block Rendering
**问题**: ``` 代码块里的缩进渲染有问题 **Problem**: Indentation rendering issues inside ``` code blocks
**解决方案**: 实现代码块检测和渲染逻辑,每行代码单独渲染 **Solution**: Implement code block detection and rendering logic, render each code line separately
### 多选功能 ### Multi-select Feature
**问题**: OpenTUI `onMouseDown` 事件不包含 ctrlKey/shiftKey 修饰键信息,且 `useKeyboard` 无法捕获修饰键 **Problem**: OpenTUI's `onMouseDown` event doesn't include ctrlKey/shiftKey modifier info, and `useKeyboard` couldn't capture modifier keys
**解决方案**: **Solution**:
- 尝试使用 `useKeyboard` 监听修饰键但失败(终端可能不发送单独的修饰键事件) - Tried using `useKeyboard` to listen for modifier keys but failed (terminal may not send separate modifier key events)
- 改用双击进入"选择模式"的方案:双击任意笔记切换选择模式,在选择模式下点击可多选 - Switched to double-click "selection mode" approach: double-click any note to toggle selection mode, click to multi-select in selection mode
### 数据库跨平台路径 ### Cross-platform Database Path
**问题**: 硬编码的数据库路径在不同平台不兼容 **Problem**: Hardcoded database path not compatible across platforms
**解决方案**: 实现 `getDbPath()` 函数,根据 `os.platform()` 判断系统类型 **Solution**: Implement `getDbPath()` function to use `~/.config/mio/cache.db` for all platforms
- Windows: `%APPDATA%/mio/cache.db`
- Mac: `~/Library/Application Support/mio/cache.db`
- Linux: `~/.config/mio/cache.db`
## 待解决问题 ## Unresolved Issues
1. **多选功能**: 双击选择模式的体验不够理想,键盘修饰键方案未能实现 1. **Multi-select feature**: Double-click selection mode experience is not ideal, keyboard modifier key approach couldn't be implemented
2. **TypeScript 类型错误**: NoteEditor 中存在一些类型错误bold 属性不存在等) 2. **TypeScript type errors**: Some type errors in NoteEditor (bold attribute doesn't exist, etc.)
## 构建说明 ## Build Instructions
```bash ```bash
npm run dev # 开发模式 npm run dev # Development mode
npm run build # 编译成 mio.exe npm run build # Build to mio.exe
``` ```
数据库位置:`~/.config/mio/cache.db`(所有平台统一) Database location: `~/.config/mio/cache.db`