|
1 | 1 | # 3D Camera Path Editor Reengineering Design |
2 | 2 |
|
3 | | -Task: PR_26124_023-finalize-tool-design-docs |
| 3 | +Task: PR_26124_024 |
4 | 4 | Classification: rebuildable tool |
5 | 5 | Core priority: core-13 |
6 | 6 | Source folder: `tools/3D Camera Path Editor` |
7 | 7 | Publish target: `tools.3d-camera-path-editor` |
8 | 8 |
|
9 | 9 | ## Tool Purpose |
10 | | -3D camera path authoring. 3D Camera Path Editor owns `cameraPath`, waypoint editing, path normalization, export, and publish to `tools.3d-camera-path-editor`. |
| 10 | +3D Camera Path Editor owns camera path import, validation, waypoint editing, export, and publish to `tools.3d-camera-path-editor`. |
11 | 11 |
|
12 | | -## Exact Folder/Files Inspected |
| 12 | +## Folder/Files Inspected |
13 | 13 | - `tools/3D Camera Path Editor/how_to_use.html` |
14 | 14 | - `tools/3D Camera Path Editor/index.html` |
15 | 15 | - `tools/3D Camera Path Editor/main.js` |
16 | 16 | - `tools/3D Camera Path Editor/README.md` |
17 | 17 |
|
18 | | -## Exact Current Controls Found |
19 | | -- `tools/3D Camera Path Editor/index.html`: `button[button]#addCameraPointButton` - Add Waypoint |
20 | | -- `tools/3D Camera Path Editor/index.html`: `button[button]#normalizeCameraPathButton` - Normalize Path |
21 | | -- `tools/3D Camera Path Editor/index.html`: `textarea#cameraPathInput` - cameraPathInput |
22 | | -- `tools/3D Camera Path Editor/main.js`: `addCameraPointButton` via addButton |
23 | | -- `tools/3D Camera Path Editor/main.js`: `normalizeCameraPathButton` via normalizeButton |
24 | | -- `tools/3D Camera Path Editor/main.js`: `cameraPathStatus` via statusText |
25 | | -- `tools/3D Camera Path Editor/main.js`: `cameraPathInput` via input |
26 | | -- `tools/3D Camera Path Editor/main.js`: `cameraPathOutput` via output |
27 | | - |
28 | | -## Current Panels And Surfaces Found |
29 | | -- `tools/3D Camera Path Editor/index.html`: `.debug-tool-shell` |
| 18 | +## Controls: Control -> Action -> JSON Effect |
| 19 | +| Control | Action | JSON effect | |
| 20 | +|---|---|---| |
| 21 | +| `tools/3D Camera Path Editor/index.html`: `button[button]#addCameraPointButton` - Add Waypoint | Adds a new camera waypoint or path setting. | Appends schema-owned data to the draft 3D camera path payload; publish waits for validation. | |
| 22 | +| `tools/3D Camera Path Editor/index.html`: `button[button]#normalizeCameraPathButton` - Normalize Path | Processes the current 3D camera path payload. | Updates tool-owned derived data/report fields that must validate before tools.3d-camera-path-editor publish. | |
| 23 | +| `tools/3D Camera Path Editor/index.html`: `textarea#cameraPathInput` - cameraPathInput | Edits the active camera waypoint or path setting field. | Updates the draft 3D camera path payload field represented by `cameraPathInput` before validation. | |
| 24 | + |
| 25 | +## Panels And Surfaces Found |
| 26 | +- `tools/3D Camera Path Editor/how_to_use.html`: `.tools-platform-surface` |
30 | 27 | - `tools/3D Camera Path Editor/index.html`: `.app-shell` |
31 | | -- `tools/3D Camera Path Editor/index.html`: `.panel` |
32 | | -- `tools/3D Camera Path Editor/index.html`: `.debug-tool-panel` |
33 | 28 | - `tools/3D Camera Path Editor/index.html`: `.debug-tool-grid` |
| 29 | +- `tools/3D Camera Path Editor/index.html`: `.debug-tool-panel` |
| 30 | +- `tools/3D Camera Path Editor/index.html`: `.debug-tool-shell` |
| 31 | +- `tools/3D Camera Path Editor/index.html`: `.panel` |
34 | 32 |
|
35 | | -## Exact Current Functions And Classes |
36 | | -- `tools/3D Camera Path Editor/main.js`: function addWaypoint; function boot3dCameraPathEditor; function buildPresetLoadedStatus; function normalizeCameraPath; function normalizeCameraPathPayload; function normalizeSamplePresetPath; function parseInputPayload; function sanitizeNumber; function setStatus; function tryLoadPresetFromQuery; method getApi; method registerToolBootContract |
| 33 | +## Current Component/Class/Function Inventory |
| 34 | +- `tools/3D Camera Path Editor/main.js`: addWaypoint; boot3dCameraPathEditor; buildPresetLoadedStatus; getApi; normalizeCameraPath; normalizeCameraPathPayload; normalizeSamplePresetPath; parseInputPayload; registerToolBootContract; sanitizeNumber; setStatus; tryLoadPresetFromQuery |
37 | 35 |
|
38 | 36 | ## Target Controls |
39 | 37 | Keep: |
40 | | -- Add Waypoint |
41 | | -- Normalize Path |
42 | | -- camera path input textarea |
43 | | -- normalized output panel |
| 38 | +- waypoint controls |
| 39 | +- path preview/playback controls |
| 40 | +- import/export controls |
44 | 41 |
|
45 | 42 | Remove or rename: |
46 | | -- none identified in the current folder |
| 43 | +- preview playback state from published path JSON unless schema-owned |
47 | 44 |
|
48 | 45 | Add: |
49 | | -- Load Camera Path JSON |
50 | | -- delete/reorder waypoint controls |
51 | | -- Export Camera Path JSON |
| 46 | +- Validate Camera Path |
52 | 47 | - Publish `tools.3d-camera-path-editor` |
| 48 | +- waypoint/path diagnostics |
| 49 | + |
| 50 | +## JSON Schema/Input Contract Currently Expected |
| 51 | +Tool receives validated payload and owns behavior for 3D camera path payload. Current contract baseline: `tools/schemas/tools/3d-camera-path-editor.schema.json` (3d-camera-path-editor Payload). |
| 52 | +Required keys: `cameraPath`. |
| 53 | +Optional keys: none identified for this contract. |
53 | 54 |
|
54 | | -## JSON Contract Owned By This Tool |
55 | | -Owned JSON is the 3d-camera-path-editor payload. Required field is `cameraPath`; no other top-level fields are allowed. Camera path data owns waypoint order, positions, timing, and normalized path output. |
| 55 | +Tool-owned JSON responsibilities: |
| 56 | +- import/load: parse incoming 3D camera path payload and reject it before mutation when invalid |
| 57 | +- validate: apply the current 3D camera path payload contract before export, copy, or publish |
| 58 | +- edit/process: mutate only 3D camera path payload fields owned by 3D Camera Path Editor |
| 59 | +- export/save: serialize the validated 3D camera path payload as the tools.3d-camera-path-editor output shape |
| 60 | +- publish: write only the validated tools.3d-camera-path-editor value produced by 3D Camera Path Editor |
| 61 | +- copy/create payload: create copied payload text from the validated 3D camera path payload, not from unvalidated draft UI state |
56 | 62 |
|
57 | | -## Publish Output |
58 | | -Publish only to `tools.3d-camera-path-editor`. The published value must match the tool-owned contract above and must be produced by this folder's validation/export path. |
| 63 | +## Valid JSON Behavior |
| 64 | +- accepts the schema-defined camera path payload |
| 65 | +- keeps waypoint edits inside the tool-owned path payload |
| 66 | +- publishes only validated camera path JSON |
59 | 67 |
|
60 | | -## Invalid JSON Behavior |
| 68 | +## Invalid JSON Rejection Behavior |
61 | 69 | - malformed JSON |
62 | | -- missing `cameraPath` |
63 | | -- empty or invalid waypoint data |
64 | | -- nonnumeric camera position/timing values |
| 70 | +- payload shape outside `3d-camera-path-editor.schema.json` |
| 71 | +- invalid waypoint/path fields |
65 | 72 | - unsupported top-level fields |
66 | 73 |
|
67 | | -## Manual Test Plan |
68 | | -- Load or paste a valid camera path. |
69 | | -- Add a waypoint, normalize the path, and export. |
70 | | -- Try malformed JSON, empty waypoint arrays, and nonnumeric positions; publish must stay blocked. |
| 74 | +## Published Output |
| 75 | +Published Output: |
| 76 | +```jsonc |
| 77 | +tools.3d-camera-path-editor = { |
| 78 | + "cameraPath": "jsonValue" |
| 79 | +} |
| 80 | +``` |
| 81 | + |
| 82 | +## Playwright Expectations |
| 83 | +- load `tools/3D Camera Path Editor/index.html` without console errors |
| 84 | +- edit/play a valid path and confirm output JSON updates |
| 85 | +- reject invalid camera path JSON |
| 86 | + |
| 87 | +## Manual Test Expectations |
| 88 | +- Open `tools/3D Camera Path Editor/index.html` and confirm waypoint/path controls render. |
| 89 | +- Add or edit a waypoint, validate, export, and re-import. |
| 90 | +- Try malformed JSON and an invalid waypoint; each must block publish. |
| 91 | + |
| 92 | +## Known Gaps |
| 93 | +- Waypoint validation should identify the failing point. |
| 94 | +- Publish should be gated by path validation. |
| 95 | + |
| 96 | +## Rebuild Order Priority |
| 97 | +core-13: rebuild in the core tool lane after earlier priorities are stable. |
0 commit comments