ElyTable: a large text file no longer freezes the window before its import dialog (T-09)

This commit is contained in:
ZacharyZhang-NY committed 2026-10-09 18:42:39 -04:00
1 parent 0c87b0bbf7
commit 6145b5cea2
3 files changed
+11 -7

No files matched your search

+9 -6
View File
@@ -235,13 +235,16 @@ impl Book {
let reading = path.clone();
let chinese = ely_ui::i18n::resolve(&ely_platform::locale::system()) == "zh-CN";
cx.spawn(async move |this, cx| {
let bytes = cx
.background_spawn(async move { std::fs::read(&reading) })
// Guessing checks the whole file: off the window thread.
let pending = cx
.background_spawn(async move {
std::fs::read(&reading).map(|bytes| Pending::new(reading, bytes, chinese))
})
.await;
in_window(&this, cx, |book, _, cx| match bytes {
Ok(bytes) => {
log::info!("table: import asks for {} bytes", bytes.len());
book.imports.push_back(Pending::new(path, bytes, chinese));
in_window(&this, cx, |book, _, cx| match pending {
Ok(pending) => {
log::info!("table: import asks for {} bytes", pending.bytes.len());
book.imports.push_back(pending);
book.next_import(cx);
}
Err(error) => book.failed_open(&path.display().to_string(), &error, cx),
+1 -1
View File
@@ -16,7 +16,7 @@
- [x] T-06 滚轮向下被内核平铺区卡住 — 表格的可滚范围先行两屏、止于表尾;R1 PASS
- [x] T-07 表头点选、行高列宽拖动是“按编号的命令”,而每次点击与拖选都推进修订,紧接着的表头操作被当作过期拒绝 — 行列号不再算作按编号的命令;R1 PASS
- [x] T-08 自动筛选的列菜单对光标所在的表而不是按钮所在的表筛选、排序 — 先把光标移到按钮所在格再排序或筛选;R1 PASS
- [ ] T-09 导入文本文件时整文件的 UTF-8 校验在界面线程跑
- [x] T-09 导入文本文件时整文件的 UTF-8 校验在界面线程跑 — 编码与分隔符的猜测随读文件在后台;R1 PASS
- [ ] T-10 CSV 导入对话框开着时打开任何别的对话框,待导入的文件静默消失
- [ ] T-11 对话框比其标签活得久:导出、定义名称、重命名不可见却“开着”,挡住导入;名称表的“转到”激活已关闭的标签
- [ ] T-12 打印区域是整列或整行时页面设置无法应用
+1
View File
@@ -0,0 +1 @@
PASS