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,65 +1,62 @@
# 项目讨论记录
# Project Discussion
## 需求确认
## Requirements
1. **双列布局**: 左侧笔记列表,右侧编辑器/预览
2. **SQLite 存储**: 使用 libsql 客户端
3. **Markdown 支持**: 渲染 Markdown 内容
4. **类似 Glow 效果**: 终端 Markdown 渲染
1. **Two-column layout**: Note list on the left, editor/preview on the right
2. **SQLite storage**: Using libsql client
3. **Markdown support**: Render Markdown content
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
**解决方案**:
- 尝试使用 `useKeyboard` 监听修饰键但失败(终端可能不发送单独的修饰键事件)
- 改用双击进入"选择模式"的方案:双击任意笔记切换选择模式,在选择模式下点击可多选
**Solution**:
- 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()` 判断系统类型
- Windows: `%APPDATA%/mio/cache.db`
- Mac: `~/Library/Application Support/mio/cache.db`
- Linux: `~/.config/mio/cache.db`
**Solution**: Implement `getDbPath()` function to use `~/.config/mio/cache.db` for all platforms
## 待解决问题
## Unresolved Issues
1. **多选功能**: 双击选择模式的体验不够理想,键盘修饰键方案未能实现
2. **TypeScript 类型错误**: NoteEditor 中存在一些类型错误bold 属性不存在等)
1. **Multi-select feature**: Double-click selection mode experience is not ideal, keyboard modifier key approach couldn't be implemented
2. **TypeScript type errors**: Some type errors in NoteEditor (bold attribute doesn't exist, etc.)
## 构建说明
## Build Instructions
```bash
npm run dev # 开发模式
npm run build # 编译成 mio.exe
npm run dev # Development mode
npm run build # Build to mio.exe
```
数据库位置:`~/.config/mio/cache.db`(所有平台统一)
Database location: `~/.config/mio/cache.db`