docs: Update progress after code consolidation

This commit is contained in:
m1ngsama 2025-12-27 18:00:10 +08:00
parent 2878b42d36
commit 3f7b627da5

View file

@ -1,23 +1,13 @@
# TUT 2.0 - 下次继续从这里开始 # TUT 2.0 - 下次继续从这里开始
## 当前位置 ## 当前位置
- **阶段**: Phase 6 - 异步HTTP (已完成!) - **阶段**: 代码整合完成,准备发布 v2.0.0
- **进度**: 非阻塞加载、加载动画、可取消请求已完成 - **进度**: 所有核心功能已完成,代码库已整合简化
- **最后提交**: `feat: Add async HTTP requests with non-blocking loading` - **最后提交**: `refactor: Consolidate v2 architecture into main codebase`
## 立即可做的事 ## 立即可做的事
### 1. 启用图片支持 (首次使用时需要) ### 1. 使用书签功能
```bash
# 下载 stb_image.h (如果尚未下载)
curl -L https://raw.githubusercontent.com/nothings/stb/master/stb_image.h \
-o src/utils/stb_image.h
# 重新编译
cmake --build build_v2
```
### 2. 使用书签功能
- **B** - 添加当前页面到书签 - **B** - 添加当前页面到书签
- **D** - 从书签中移除当前页面 - **D** - 从书签中移除当前页面
- **:bookmarks** 或 **:bm** - 查看书签列表 - **:bookmarks** 或 **:bm** - 查看书签列表
@ -82,12 +72,13 @@ cmake --build build_v2
``` ```
src/ src/
├── browser_v2.cpp/h # 新架构浏览器 (pImpl模式) ├── browser.cpp/h # 主浏览器 (pImpl模式)
├── main_v2.cpp # tut2 入口点 ├── main.cpp # 程序入口点
├── http_client.cpp/h # HTTP 客户端 (支持二进制) ├── http_client.cpp/h # HTTP 客户端 (支持二进制和异步)
├── dom_tree.cpp/h # DOM 树 ├── dom_tree.cpp/h # DOM 树
├── html_parser.cpp/h # HTML 解析 ├── html_parser.cpp/h # HTML 解析
├── input_handler.cpp/h # 输入处理 ├── input_handler.cpp/h # 输入处理
├── bookmark.cpp/h # 书签管理
├── render/ ├── render/
│ ├── terminal.cpp/h # 终端抽象 (ncurses) │ ├── terminal.cpp/h # 终端抽象 (ncurses)
│ ├── renderer.cpp/h # FrameBuffer + 差分渲染 │ ├── renderer.cpp/h # FrameBuffer + 差分渲染
@ -97,29 +88,35 @@ src/
│ └── decorations.h # Unicode 装饰字符 │ └── decorations.h # Unicode 装饰字符
└── utils/ └── utils/
├── unicode.cpp/h # Unicode 处理 ├── unicode.cpp/h # Unicode 处理
└── stb_image.h # [需下载] 图片解码库 └── stb_image.h # 图片解码库
tests/ tests/
├── test_terminal.cpp # Terminal 测试 ├── test_terminal.cpp # Terminal 测试
├── test_renderer.cpp # Renderer 测试 ├── test_renderer.cpp # Renderer 测试
└── test_layout.cpp # Layout + 图片占位符测试 ├── test_layout.cpp # Layout + 图片占位符测试
├── test_http_async.cpp # HTTP 异步测试
├── test_html_parse.cpp # HTML 解析测试
└── test_bookmark.cpp # 书签测试
``` ```
## 构建与运行 ## 构建与运行
```bash ```bash
# 构建 # 构建
cmake -B build_v2 -S . -DCMAKE_BUILD_TYPE=Debug cmake -B build -S . -DCMAKE_BUILD_TYPE=Debug
cmake --build build_v2 cmake --build build
# 运行 # 运行
./build_v2/tut2 # 显示帮助 ./build/tut # 显示帮助
./build_v2/tut2 https://example.com # 打开网页 ./build/tut https://example.com # 打开网页
# 测试 # 测试
./build_v2/test_terminal # 终端测试 ./build/test_terminal # 终端测试
./build_v2/test_renderer # 渲染测试 ./build/test_renderer # 渲染测试
./build_v2/test_layout # 布局+图片测试 (按回车进入交互模式) ./build/test_layout # 布局+图片测试
./build/test_http_async # HTTP异步测试
./build/test_html_parse # HTML解析测试
./build/test_bookmark # 书签测试
``` ```
## 快捷键 ## 快捷键
@ -135,7 +132,10 @@ cmake --build build_v2
| / | 搜索 | | / | 搜索 |
| n/N | 下一个/上一个匹配 | | n/N | 下一个/上一个匹配 |
| r | 刷新 (跳过缓存) | | r | 刷新 (跳过缓存) |
| B | 添加书签 |
| D | 删除书签 |
| :o URL | 打开URL | | :o URL | 打开URL |
| :bookmarks | 查看书签 |
| :q | 退出 | | :q | 退出 |
| ? | 帮助 | | ? | 帮助 |
| Esc | 取消加载 | | Esc | 取消加载 |
@ -154,17 +154,15 @@ cmake --build build_v2
## Git 信息 ## Git 信息
- **当前标签**: `v2.0.0-alpha` - **当前标签**: `v2.0.0-alpha`
- **最新提交**: `18859ee feat: Add async HTTP requests with non-blocking loading`
- **远程仓库**: https://github.com/m1ngsama/TUT - **远程仓库**: https://github.com/m1ngsama/TUT
```bash ```bash
# 恢复开发 # 恢复开发
git clone https://github.com/m1ngsama/TUT.git git clone https://github.com/m1ngsama/TUT.git
cd TUT cd TUT
curl -L https://raw.githubusercontent.com/nothings/stb/master/stb_image.h -o src/utils/stb_image.h cmake -B build -S . -DCMAKE_BUILD_TYPE=Debug
cmake -B build_v2 -S . -DCMAKE_BUILD_TYPE=Debug cmake --build build
cmake --build build_v2 ./build/tut
./build_v2/tut2
``` ```
--- ---