From 1aa2c3b9bfde5a333cff458d21115692381632f8 Mon Sep 17 00:00:00 2001 From: "Z.To" Date: Sat, 11 Apr 2026 01:24:35 +0800 Subject: [PATCH] docs: add English changelog and update docs --- changelog.md | 48 ++++++++++++++++++---------------- docs/taolun.md | 71 ++++++++++++++++++++++++-------------------------- 2 files changed, 59 insertions(+), 60 deletions(-) diff --git a/changelog.md b/changelog.md index d6d05b8..010c290 100644 --- a/changelog.md +++ b/changelog.md @@ -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 -- **双列布局**: 左侧笔记列表,右侧编辑器/预览 -- **笔记管理**: 创建、编辑、删除笔记 -- **Markdown 预览**: 手动实现的 Markdown 渲染器,支持: - - 标题 (# ## ###) - - 列表 (- *) - - 引用 (>) - - 代码块 (```) - - 分割线 (---) -- **多选删除**: 双击进入选择模式,点击切换选中状态,支持批量删除 -- **标题截断**: 左侧列表标题过长时显示省略号 -- **时间显示**: 格式为 "时间 · 月/日/年",如 "12:45 · 4/11/2026" +### Added -### 技术改进 +- **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` -- 可编译为单个可执行文件 (mio.exe) +### Technical -### 已知问题 +- SQLite database stored at `~/.config/mio/cache.db` +- Can be compiled to a single executable (mio.exe) -- 多选功能使用双击模式,不如键盘快捷键直观 -- TypeScript 类型警告(bold 属性等) +### Known Issues -### 构建 +- Multi-select uses double-click mode, not as intuitive as keyboard shortcuts +- TypeScript type warnings (bold attribute, etc.) + +### Build ```bash -npm run dev # 开发模式 -npm run build # 编译成 mio.exe +npm run dev # Development mode +npm run build # Build to mio.exe ``` \ No newline at end of file diff --git a/docs/taolun.md b/docs/taolun.md index 7afe0a8..492c08b 100644 --- a/docs/taolun.md +++ b/docs/taolun.md @@ -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 的 `` 组件无法正确渲染样式(尝试多种方式均失败) +**Problem**: OpenTUI's `` component could not render styles correctly (tried multiple methods, all failed) -**解决方案**: 实现手动 Markdown 解析器,用 OpenTUI 的 `` 组件手动渲染样式 +**Solution**: Implement a custom Markdown parser using OpenTUI's `` 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` 函数中处理空行,添加 `{" "}` +**Solution**: Handle empty lines in `renderMarkdown` function, add `{" "}` -### 代码块渲染 +### 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`(所有平台统一) \ No newline at end of file +Database location: `~/.config/mio/cache.db` \ No newline at end of file