Fix 72 issues from comprehensive code review#6
Merged
Wintersta7e merged 7 commits intomainfrom Mar 13, 2026
Merged
Conversation
…coercion, parseInt handling - Fix timeline drag reverting wrong event on text overlap (drag.js) - Fix autosave recovery setting events before openProjectPath which cleared them - Replace all || with ?? in mz-converter.js to allow valid falsy values (opacity 0, scale 0, duration 0, blend 0, origin 0 now work correctly) - Fix parseInt(...) || 0 in bind-input.js zeroing fields mid-keystroke - Fix tintPicture wait defaulting to !== false instead of ?? true Co-Authored-By: Rooty
- Add try/catch to save-scene and load-scene IPC handlers - Add per-directory error handling in scanDirectory (skip unreadable dirs) - Add try/catch around get-folder-contents readdir - Add user notification on drag-drop scene load failure - Capture error variable in catch blocks (screen-resolution, autosave-read) - Log errors in get-maps and get-map-events handlers - Replace || with ?? for pageIndex and screenWidth defaults - Add validation for terminating code 0 in export-to-map splice - Remove dead _scaleFactor code - Add webSecurity: true to webPreferences - Clear processedTextEvents on scene change (newScene, loadScene, loadSceneFromFile) Co-Authored-By: Rooty
- Rebuild showConfirmDialog with safe DOM APIs (no innerHTML with params) - Add focus trap, Escape-to-close, and focus restore to confirm dialog - Escape HTML in filesystem names (image-browser, image-picker) - Set textarea value programmatically instead of interpolating in innerHTML - Add Content-Security-Policy meta tag to index.html - Fix openExternal hostname check: exact match instead of endsWith - Add console.debug in preload catch block instead of empty catch - Escape img.path in data-attribute context Co-Authored-By: Rooty
- Add try/catch to saveSettings for QuotaExceededError - Capture error in getSettings and getLastExport catch blocks - Show user notification on folder structure load failure - Surface autosave write failures after 3 consecutive errors - Add .catch() to OPEN_RECENT_PROJECT async handler - Remove orphan SCENE_LOADED event listener from init.js - Add null-check warnings for critical DOM elements in elements.js - Add debounced image search filter (150ms) - Add aria-label to notification close button Co-Authored-By: Rooty
- Add lightweight updateTimelineCursor() for playback (avoids full DOM rebuild at 60fps) - Add updateMinimapCursor() for cursor-only minimap updates during playback - Debounce window resize handler on minimap with requestAnimationFrame - Eliminate O(n²) indexOf in renderPreviewAtFrame by using loop index directly - Playback uses cursor-only updates; full rebuild reserved for structural changes Co-Authored-By: Rooty
- Fix double render on Delete key (deleteSelectedEvent already emits RENDER) - Add debounced undo state for arrow key image movement - Deduplicate getPreviewScale: drag.js now imports from preview/index.js - Remove unused event constants (STATE_CHANGED, EVENT_SELECTED, FRAME_CHANGED, SCENE_SAVED, SCENE_LOADED, RENDER_PROPERTIES) - Remove will-change from virtual dropdown items (reduces GPU memory) - Update event-bus tests to match removed constants Co-Authored-By: Rooty
… keyframes - Replace outline:none with focus-visible pattern on inputs and search - Add slideIn/slideOut keyframes (moved from notifications.js) - Remove dead .btn[title] rule - Remove unnecessary !important on timeline event min-width - Consolidate duplicate showText/erasePicture selectors - Scope .btn transition to specific properties instead of 'all' - Remove will-change and backface-visibility from dropdown items - Add focus-visible support to virtual-dropdown-search - Add aria-labels and semantic HTML (section instead of footer) Co-Authored-By: Rooty
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
Comprehensive code review identified 72 issues across the codebase, all resolved in 7 logical commits:
Critical Bug Fixes
openProjectPath()which cleared them||vs??coercion throughoutmz-converter.js— opacity 0, scale 0, duration 0 were silently overridden to defaults (identical class of bug already fixed for showText/screenFlash, but never applied to other event types)parseInt || 0zeroed property fields mid-keystroke during editingSecurity Hardening
showConfirmDialogwith safe DOM APIs (was using innerHTML with parameters)openExternalhostname check (endsWith→ exact match, preventingevil-github.com)webSecurity: trueexplicitly to webPreferencesError Handling
.catch()to async event bus handlerselements.jssaveSettingsfor QuotaExceededErrorPerformance
updateTimelineCursor()for cursor-only updates; full rebuild reserved for structural changesupdateMinimapCursor()for minimap cursor-only updates during playbackindexOfinrenderPreviewAtFrameby using loop index directlywill-change: transformfrom every virtual dropdown itemArchitecture Cleanup
getPreviewScale()(was defined in both preview/index.js and drag.js)processedTextEventson scene changeDEFAULT_DURATIONinconsistency (local 30 vs state.js 60)CSS & Accessibility
outline: nonewithfocus-visiblepattern on all inputsaria-labelto all toolbar buttons and minimap canvas<footer>to<section>for timeline<label>for timeline length input<style>to styles.css.btn[title]rule, unnecessary!important, duplicate selectors.btntransition to specific properties instead ofallStats