forked from 1b-agent/opencadstudio-upstream
fix(plot): never fail silently on PDF export; add EXPORTPDF <path> (#369)
Export to PDF could end in complete silence: the flow hands off to an async rfd save dialog, and when that future resolves to None the app mapped it straight to Task::none(). None does not only mean the user cancelled — on Linux the XDG portal SaveFile call can fail outright (rfd then tries a zenity fallback, which may not be installed) and the future still just resolves to None. rfd reports those failures only through the `log` crate, and logging is opt-in (--log / RUST_LOG), so the reporter saw exactly what #369 describes: no dialog, no error, no console output, no file. - EXPORT / EXPORTPDF now accept an optional path argument that exports straight to the file with no dialog — both the workaround for systems where the native save dialog cannot open and a headless-testable entry point. A relative path lands next to the drawing; a missing extension gets .pdf. - The dialog-None arms (PlotExportPath / PlotWindowExportPath) now push a command-line message pointing at EXPORTPDF <path> instead of doing nothing. - The success message prints the full output path, not just the file name, so users can find the PDF. Verified end to end on the real binary via --serve: LINE + CIRCLE then EXPORTPDF <path> writes a valid PDF with the expected geometry. Both new tests fail on the previous code. Fixes #369 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4bcf5063e9
commit
d2af4c0b34
5 files changed
+116
-11
No files matched your search
+2
-2
@@ -303,8 +303,8 @@ Status of every standard CAD command in Open CAD Studio:
|
||||
| `QSAVE` | — | Quick save | ✅ |
|
||||
| `SAVEALL` | — | Save all open drawings | ✅ |
|
||||
| `PLOT` | — | Print / plot | ✅ |
|
||||
| `EXPORT` | — | Export | ✅ |
|
||||
| `EXPORTPDF` | — | Export to PDF | ✅ |
|
||||
| `EXPORT [path]` | — | Export to PDF (save dialog, or straight to `path`) | ✅ |
|
||||
| `EXPORTPDF [path]` | — | Export to PDF (save dialog, or straight to `path`) | ✅ |
|
||||
| `PAGESETUP` | — | Page setup | ✅ |
|
||||
| `PLOTSTYLE` | — | Plot style | ✅ |
|
||||
| `PURGE` | PU | Purge unused items | ✅ |
|
||||
|
||||
Reference in new issue
Block a user