docs: record CAD import and image-reference planning notes
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
+66
@@ -1,5 +1,20 @@
|
||||
# Progress Log
|
||||
|
||||
## Session: 2026-07-15 (Vector Reference Follow-up)
|
||||
|
||||
### Phases 21-22
|
||||
- Restored the existing CAD work and regression context after session handoff.
|
||||
- Confirmed the two independent failures: nested-parenthesis directives bypass the capsule parser, and SVG bytes reach a raster-only image-generation API.
|
||||
- Locked the product boundary: SVG remains the canvas source; only model-bound references become temporary transparent WebP assets.
|
||||
- Ran the focused frontend suite and reproduced both English and Chinese nested-parenthesis directives as deterministic failures; the raster WebP baseline still passes.
|
||||
- Fixed nested-parenthesis directive parsing; all English, Chinese, and existing raster capsule parser cases pass.
|
||||
- Added browser-side SVG detection by name, URL, response MIME, and content sniffing; model-bound SVG references render to a transparent 2048px WebP derivative, upload once, and cache by source URL.
|
||||
- Wired both Agent Chat and the canvas image-generator composer through the shared submission adapter while retaining original SVG canvas content and display names.
|
||||
- The 14-test frontend suite, TypeScript build, and diff whitespace checks pass.
|
||||
- In-app browser initialization succeeded but no browser backend is currently available, so capsule hover and live request inspection remain unavailable in this environment.
|
||||
- Production Next/Vite builds pass, the exact nested CAD filename regression passes, and the active Vite preview remains available at `http://127.0.0.1:5174`.
|
||||
- Restored the pre-existing `frontend/next-env.d.ts` development route import after Next rewrote it during the production build.
|
||||
|
||||
## Session: 2026-07-10
|
||||
|
||||
### Phase 1: Architecture Discovery
|
||||
@@ -87,3 +102,54 @@
|
||||
- Added backend validation, prompt constraints, clean-source plus guide-image inputs, action lifecycle copy, generator metadata, and focused action coverage.
|
||||
- Targeted Go tests, locale JSON parsing, and frontend TypeScript validation pass.
|
||||
- Updated the action contract so visual annotation preserves the original and generates into a sibling copy placed to its right.
|
||||
|
||||
## Session: 2026-07-15
|
||||
|
||||
### Phase 15: CAD Import Discovery and Design
|
||||
- **Status:** in_progress
|
||||
- Loaded the repository go-zero instructions plus the applicable Go, frontend, and file-planning skills.
|
||||
- Preserved the pre-existing `frontend/next-env.d.ts` change and added the DWG/DXF request as a new plan phase.
|
||||
- Completed the required workflow/skill reads and confirmed the frontend/backend toolchains and API-first constraint.
|
||||
- Located the canvas upload/drop surfaces, generic asset upload API, existing SVG render/export support, and canvas node model.
|
||||
- Traced the exact optimistic upload/save flow and confirmed converted CAD can reuse image-node rendering without changing persistence schemas.
|
||||
- Confirmed no local CAD converter binary is available and began evaluating a browser-capable dependency that genuinely handles both DXF and DWG.
|
||||
- Found an MIT-licensed client-side DWG-to-DXF WASM option and isolated the canvas-only import points that need extension.
|
||||
- Compared candidate packages and selected `@node-projects/acad-ts` for a single browser-side DWG/DXF-to-SVG pipeline, pending package-level verification.
|
||||
- Downloaded the exact package tarball for API/runtime inspection without changing repository dependencies yet.
|
||||
- First package source inspection raced extraction in a parallel tool call; no repository files were affected, and inspection will continue from the actual extracted path.
|
||||
- Verified the extracted package layout and confirmed the required reader/writer exports are browser-neutral.
|
||||
- Inspected reader and SVG writer internals; scheduled a runtime fixture because the packaged XML closing logic appears incomplete.
|
||||
- Ran a real DXF line/circle fixture: parsing succeeds, while raw SVG is invalid exactly as suspected. Conversion will include explicit normalization and validation around the third-party writer.
|
||||
- Completed CAD import discovery and selected a worker-based, frontend-only conversion design with no REST contract changes.
|
||||
- The first dependency install was blocked by parent-workspace discovery (`workspace:*`); no implementation files were changed by the failed command.
|
||||
- Installed `@node-projects/acad-ts@2.3.0` with the repository's pnpm toolchain; package manifest and lockfile are now updated.
|
||||
- Added the worker converter, SVG repair/sanitization, CAD-aware picker/drop flow, localized statuses, toolbar semantics, and README documentation. Initial typecheck found one third-party collection API mismatch.
|
||||
- Corrected the collection API mismatch; `pnpm exec tsc -b`, locale JSON parsing, and `git diff --check` now pass.
|
||||
- `pnpm build` passes for Next and Vite; Vite produced an isolated CAD worker chunk. Began real-browser verification against the already-running local stack.
|
||||
- Confirmed backend 8888 is this project but frontend 5173 is unrelated; will launch this frontend on 5174 and use upstream CAD fixtures for DXF/DWG tests.
|
||||
- Found a Next/Turbopack worker packaging defect before runtime release; the fix is to use Next's supported webpack mode for dev/build while keeping the existing isolated worker architecture.
|
||||
- Updated Next dev/build scripts to webpack mode and reran `pnpm build` successfully; both Next and Vite now produce executable isolated worker chunks.
|
||||
- Authenticated in a real browser, created a blank project, confirmed the CAD-aware toolbar control, and triggered a real AC1015 DXF import. Added a visible error toast because conversion failures were otherwise hidden in the canvas state.
|
||||
- Reproduced the user-visible failure with an upstream DXF fixture and captured the exact cause: the third-party parser returned no model-space entities. Converter dependency/path replacement is now required.
|
||||
- Received and identified the user's actual failing DXF as R11/R12 AC1009; switched verification to that exact file and stopped two stalled directory-list commands without touching the file.
|
||||
- Reproduced the exact failure in Node and reduced it to a minimal R12 DXF: `SvgXmlWriter` crashes when POINT/TEXT fill colors use inherited ByLayer index 256.
|
||||
- Extracted the worker's conversion core, resolved non-renderable inherited CAD colors before serialization, and added a Node regression test covering R12 point/text entities.
|
||||
- Imported the exact 915,957-byte user file through the Vite production worker, confirmed upload/save success, visually checked the rendered paper patterns, and confirmed reload persistence with no browser console errors.
|
||||
- Reproduced a Next-production-only zero-bounds result caused by class-name mangling in the CAD library's metadata lookup; restored exported constructor names inside the worker and added the mangled-name case to the regression test.
|
||||
- Verified the regular minified Next production build with both the exact R12 DXF and a real DWG fixture; both upload and render successfully without globally disabling minification.
|
||||
|
||||
### Phase 18: General CAD Compatibility Follow-up
|
||||
- **Status:** in_progress
|
||||
- Reproduced the second user-provided DWG conversion outside the UI: parsing succeeds, but recursive block expansion produces a roughly 50 MB SVG and reaches the browser timeout boundary.
|
||||
- Profiled model-space entity contributions and isolated repeated `INSERT` serialization as the dominant time and output-size cost.
|
||||
- Confirmed the third-party insert path also ignores rotation and scale, making reusable block references a correctness fix as well as a performance fix.
|
||||
- Located the existing compact vector toolbar and confirmed SVG export already downloads the original SVG source.
|
||||
- Reduced the second DWG conversion from roughly 44 seconds/50 MB to about 9.6 seconds/8.5 MB by emitting 196 reachable block definitions once and 748 transformed references.
|
||||
- Imported the optimized DWG in the browser and reproduced the remaining tiny-content framing problem; traced the false extents to a source entity explicitly marked invisible.
|
||||
- Excluded invisible, off-layer, and frozen-layer entities from output and bounds. Reimport now produces a correctly framed 1200 x 839 vector node instead of 4074 x 1005 with large blank extents.
|
||||
- Confirmed uploaded SVG/CAD nodes show only the compact `矢量` toolbar and download action; corrected the source-SVG filename so downloads do not gain a duplicate `.svg` suffix.
|
||||
- Added focused regression coverage for inherited R12 colors, reusable repeated inserts, full insert transforms, MINSERT arrays, cyclic blocks, invisible extents, and SVG vector-node detection; all seven tests pass.
|
||||
- Rechecked the exact R12 DXF after the assembler change: conversion completes in about 0.3 seconds and emits a 2.14 MB reusable SVG.
|
||||
- Rechecked `/Users/liangxu/Desktop/花语江南6-204方案.dwg`: conversion completes in about 10 seconds, emits an 8.49 MB SVG instead of roughly 50 MB, and frames the visible drawing at a 1.43:1 aspect ratio.
|
||||
- Browser import, nonblank rendering, compact vector toolbar, source SVG download, save, and reload persistence all pass at `http://127.0.0.1:5174`.
|
||||
- Final `pnpm test`, TypeScript validation, `pnpm build`, and `git diff --check` pass; the build retains only the repository's existing Vite large-chunk warning.
|
||||
|
||||
Reference in New Issue
Block a user