An SVG path whose first command is an arc (A) — or one whose leading
commands push no anchor point — reaches the arc branch with an empty
`points` array, so `points[points.length - 1].type` threw a TypeError
and aborted the entire PPTX export. toPoints() documents that a malformed
path should return [] (mirroring getSvgPathRange) so a single bad or
LLM-hallucinated shape does not take down the export; this restores that
contract with a `!lastPoint` guard. Adds a regression test for the
arc-first case.
Co-authored-by: ly-wang19 <ly-wang19@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: wyuc <wang-yc24@mails.tsinghua.edu.cn>
A single unparseable shape path (e.g. an upstream LLM hallucination that
turns an `A` arc command into the literal token `alert`) used to throw
out of `toPoints` and crash the entire `buildPptxBlob` run, surfacing a
generic "导出失败 / Export failed" toast and producing no file.
Make `toPoints` mirror the existing tolerant behaviour of
`getSvgPathRange`: warn and return `[]` on parse failure. The shape
branch in `buildPptxBlob` then skips the offending element and keeps
exporting the rest of the deck.
Closes#504
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* feat(export): add classroom ZIP manifest type definitions
* feat(i18n): add classroom export/import translation keys for all locales
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(export): add classroom ZIP utilities and unit tests
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(export): add useExportClassroom hook for ZIP export
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(import): add useImportClassroom hook for ZIP import
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(ui): add Export Classroom ZIP option to header dropdown
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(ui): add Import Classroom button to home page
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* test(export): add integration tests and fix lint issues
* fix(ui): improve import button placement and read appVersion from package.json
* chore: fix prettier formatting
* fix: address PR review feedback
- Read appVersion from process.env.npm_package_version instead of hardcoding
- Remove unused buildIdMap export and its tests
- Add forward-compat comment on ManifestAgent.voiceConfig
- Add file size warning for large ZIP imports
- Distinguish storage quota errors from parse errors in import
- Move poster check before first DB put to avoid redundant write
- Use CLASSROOM_ZIP_EXTENSION constant in export hook
- Add storageFull i18n key for all 4 locales
* fix: adapt to language→languageDirective rename from #412
* fix(ui): widen import button hover expand to prevent text truncation
* fix(ui): use grid 0fr→1fr for import button expand instead of fixed max-w
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>