ElyMark: an export panel that fails says why (M-09)

export_to splits picked, cancelled and failed as open_picked does;
a failure reaches panel_failed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ZacharyZhang-NYandClaude Opus 5.5 committed 2026-10-10 12:02:55 -04:00
1 parent 22d2d04d1e
commit 11a85d1a99
3 files changed
+18 -22

No files matched your search

+16 -21
View File
@@ -125,32 +125,27 @@ impl Desk {
let dir = ely_office::folder(tab).unwrap_or_else(std::env::temp_dir);
let chosen = cx.prompt_for_new_path(&dir, Some(&format!("{stem}.{}", output.extension())));
cx.spawn(async move |desk, cx| {
// A cancel says nothing; a panel that failed says why.
let failed = match chosen.await {
Ok(Ok(Some(path))) => Ok(path),
Ok(Ok(None)) => return log::info!("mark: the export panel was cancelled"),
let chosen = match chosen.await {
Ok(Ok(path)) => Ok(path),
Ok(Err(error)) => Err(error.to_string()),
Err(error) => Err(error.to_string()),
};
let path = match failed {
Ok(path) => path,
Err(why) => {
if desk.update(cx, |desk, cx| desk.panel_failed(&why, cx)).is_err() {
log::error!("mark: the export panel failed after its window: {why}");
let done = desk.update(cx, |desk, cx| match chosen {
Ok(Some(path)) => {
if let Err(error) = not_open(desk, &path) {
return desk.exported(Err(error), cx);
}
match output {
Output::Pdf => desk.render_pdf(id, Some(path), cx),
_ => desk.write_output(id, output, path, cx),
}
return;
}
};
desk.update(cx, |desk, cx| {
if let Err(error) = not_open(desk, &path) {
return desk.exported(Err(error), cx);
}
match output {
Output::Pdf => desk.render_pdf(id, Some(path), cx),
_ => desk.write_output(id, output, path, cx),
}
})
.ok();
Ok(None) => log::info!("mark: the export panel was cancelled"),
Err(why) => desk.panel_failed(&why, cx),
});
if done.is_err() {
log::info!("mark: the window closed before the export panel");
}
})
.detach();
}
+1 -1
View File
@@ -69,7 +69,7 @@
- [x] M-06 `on_app_quit` 无条件删恢复点与崩溃锁,AppKit 直接终止时丢未保存内容 — 未保存时退出只放下锁、不清点,窗口释放时不再删(审查 1 轮)
- [x] M-07 崩溃恢复的未命名副本按“第一个显示的未命名标签”配对,内容可能落错标签 — 未命名副本按新建时记下的标签号配对,经 Keeping::take(审查 2 轮)
- [x] M-08 页面重载后悬着的渲染回调永不完成,导出既不成功也不报错 — 页面失败后挂起与新到的渲染都以错误结束,载入成功才恢复(审查 2 轮)
- [ ] M-09 导出的保存面板出错被当作取消
- [x] M-09 导出的保存面板出错被当作取消 — 面板出错走 panel_failed,取消只记日志(审查 1 轮)
- [ ] M-10 关闭查找框只清当前标签的高亮
- [ ] M-11 页面把搜索词写进应用日志
- [ ] M-12 浏览器创建完成前 `WebView` 已释放,浏览器泄漏
+1
View File
@@ -0,0 +1 @@
PASS