fix: resolve all remaining code review items#22
Merged
Wintersta7e merged 7 commits intomainfrom Mar 27, 2026
Merged
Conversation
Convergence nodes (multiple incoming edges) were emitting their LABEL commands at the current branch indent level. When JUMP_TO_LABEL landed inside a Show Choices or Conditional Branch block, RPG Maker's interpreter could re-enter the branch scope, causing infinite loops or wrong execution. Now all convergence nodes are deferred and processed at indent 0 after the main DFS traversal, ensuring labels are always outside branch structures. Co-Authored-By: Rooty
The shallow spread { ...engine.state } shared mutable Maps, Sets, and
arrays between the engine's internal state and the Zustand store. Engine
mutations would silently alter the store snapshot, breaking React change
detection. Now clonePreviewState() creates independent copies of all
collection types.
Co-Authored-By: Rooty
Reordering menu choices via move up/down changed the array indices but left edge sourceHandle references (choice-0, choice-1, etc.) pointing at the old positions. Now moveChoice also remaps the affected edges so connections follow their original choices to the new indices. Co-Authored-By: Rooty
BUG-8: Number keys 1-7 no longer create nodes while the preview panel is open — the quick-add shortcut now checks previewState.isOpen first. PERF-7: computeGuideLines skips nodes whose center is more than 600px from the dragged node, avoiding unnecessary alignment checks on large graphs. Co-Authored-By: Rooty
SEC-8: exportToMap now validates each command object has numeric code, numeric indent, and a parameters array before writing to the map file. SEC-10: file:load enforces a 50MB limit on .mzinteraction files. Project JSON reads (maps, system) enforce a 100MB limit via a shared readProjectFile() helper. Prevents memory exhaustion from oversized or malicious files. Co-Authored-By: Rooty
ARCH-1: Extract API interface types into src/shared/api-types.ts as a single source of truth. Preload re-exports them; renderer api.d.ts imports and narrows TemplateAPI with concrete NodeTemplate types. ARCH-3: Remove unused electron-updater dependency (never imported). ARCH-4: Replace unmaintained dagre 0.8.5 with @dagrejs/dagre 3.0.0 (actively maintained fork, API-compatible). Co-Authored-By: Rooty
47 new tests covering the three biggest coverage gaps: - export.test.ts: All action types (script, set_switch, set_variable, common_event, show_text, plugin_command), condition branches (switch, variable, script), static/dynamic menus, convergence node label placement at indent 0 (BUG-1 regression tests), empty graphs. - documentStore.test.ts: Node/edge CRUD, preset management, bookmark toggle, removeNode edge cleanup, document lifecycle (set/new). - historyStore.test.ts: Undo/redo cycles, 20-entry limit, push clears future, clear resets all, null returns on empty history. Co-Authored-By: Rooty
e12ffff to
97454a6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resolves all remaining items from the 2026-03-13 extensive code review (8 bugs, 2 security, 3 perf, 3 arch, test gaps).
Bug fixes:
Performance:
Security:
Architecture:
src/shared/api-types.ts(single source of truth)electron-updaterdagre0.8.5 →@dagrejs/dagre3.0.0Tests: 47 new tests (228 total, up from 181):
Test plan
npm test— 228 tests passing across 17 filesnpm run typecheck— clean (only pre-existing TS4023 in nodeTypes)npm run lint— clean on all changed filesCo-Authored-By: Rooty