Commit Graph
150 Commits
Author SHA1 Message Date
AEmotionStudio 1a4b6b8a23 fix(widget-editors): update DragValueController logic and build 2026-01-17 17:59:00 -08:00
AEmotionStudio d1612d702b Merge branch 'main' of https://github.com/AEmotionStudio/ComfyUI-MagnifyGlass 2026-01-17 17:44:03 -08:00
AEmotionStudio 09ce2fb78a WIP: My local changes 2026-01-17 17:38:06 -08:00
Æmotion Studio cf2e97c725 Merge pull request #22 from AEmotionStudio/palette/dropdown-a11y-5973958733429481297
🎨 Palette: Add keyboard accessibility to node selector dropdown
2026-01-17 00:42:36 -08:00
google-labs-jules[bot] 717b823d20 fix(ui): prevent race conditions and focus hijacking in dropdown 2026-01-17 07:42:29 +00:00
google-labs-jules[bot] 3ab3e4a02e fix(ui): fix event listener leak on dropdown re-open 2026-01-17 06:31:06 +00:00
google-labs-jules[bot] 2786436e4a fix(ui): restrict keyboard handler to focused dropdown 2026-01-17 05:56:45 +00:00
Æmotion Studio c1adab023f Merge pull request #23 from AEmotionStudio/bolt-perf-batch-dom-reads-13434560877791740571
⚡ Bolt: Batch DOM reads/writes in renderHtmlOverlays
2026-01-16 21:52:04 -08:00
google-labs-jules[bot] d8ee89ca02 fix(ui): prevent event listener leak in dropdown selection 2026-01-17 05:25:38 +00:00
google-labs-jules[bot] c42b085473 ⚡ Bolt: Fix stale overlays on early return
Ensures `htmlOverlayContainer` is cleared when exiting `renderHtmlOverlays` early (e.g. no nodes or zero scale), preventing stale content from persisting.
2026-01-17 05:23:25 +00:00
google-labs-jules[bot] 5934fbe6b9 chore(security): use textContent for sidebar titles
- Replaced `innerHTML` with `textContent` for dynamic titles in `SidebarSettings.ts` to prevent potential XSS.
- Maintained `innerHTML` usage only for trusted static SVG icons.
- Added defense-in-depth against future changes that might introduce user-controlled titles.
2026-01-17 05:07:08 +00:00
google-labs-jules[bot] 962277c960 ⚡ Bolt: Batch DOM reads/writes in renderHtmlOverlays
Refactors `renderHtmlOverlays` to eliminate layout thrashing by separating DOM read operations (getBoundingClientRect, getComputedStyle) from DOM write operations.

- Creates a `RenderTask` interface to store read data.
- Implements a Read Phase to collect measurements and cull nodes.
- Implements a Write Phase to batch DOM updates using a DocumentFragment.
- Preserves video tracking logic to ensure animation loop continuity.
- Reduces browser reflows from O(n) to O(1) per frame.
2026-01-17 05:02:21 +00:00
google-labs-jules[bot] 55c7114fa0 feat(ui): add keyboard navigation and ARIA to node selector dropdown 2026-01-17 04:43:13 +00:00
AEmotionStudio 6ff4f2712c feat(ui): Implement custom dropdown system and High Contrast mode
- Replaced native select elements with a viewport-aware 'CustomDropdown' for better reliability and positioning.
- Added 'High Contrast Text' mode for improved legibility in inputs and values.
- Implemented parameter value deduplication in 'NodeDataExtractor' to reduce panel clutter.
- Expanded Google Font selection with 10+ new styles.
- Switched UI dimensions to relative units (em) for consistent scaling.
- Fixed layout 'bouncing' in sticky mode by removing hover transforms.
2026-01-16 16:13:35 -08:00
AEmotionStudio 1a5d7eab43 feat(ui): Add copy-to-clipboard functionality and improve dropdown stability
- Added a copy-to-clipboard button for 'Category' and 'Path' node details in the Inspector panel.
- Enhanced dropdown interaction stability by using 'mousedown' capture phase and broad event propagation prevention in 'InlineControlFactory'.
- Updated 'build' script to ensure CSS files are correctly synchronized from 'css/' to 'web/'.
- Standardized copy icon and styling, including a subtle checkmark feedback on success.
- Fixed an issue where the Inspector panel would 'bounce' due to hover transforms while in sticky mode.
- Improved dropdown closure logic to handle clicks both outside and within the panel content area.
2026-01-16 15:01:36 -08:00
AEmotionStudio dd6b787ad6 style(ui): Refine sticky mode layout and inline control interactions
- Optimized 'persist-active' mode to use viewport-based height limits and proper flex scrolling.
- Enhanced event propagation handling in 'InlineControlFactory' for better dropdown stability.
- Standardized panel font sizes and updated inline dropdowns to match the green theme.
- Added theme-specific CSS overrides for Light and GitHub themes in widget editors.
- Simplified copy-to-clipboard UI feedback.
2026-01-16 12:41:33 -08:00
AEmotionStudio d2ea6d965f feat(ui): Implement inline widget controls and drag value adjustments
- Added 'InlineControlFactory' to create inline toggle switches and combo boxes for supported widget types, replacing the click-to-edit modal for these types.
- Added 'DragValueController' to enable adjusting numeric values by dragging on the value display.
- Updated 'UIManager' to integrate these new controls, manage their lifecycle, and properly clean them up.
- Enhanced 'WidgetEditorFactory' to handle Enter key for confirming edits.
- Removed the copy button from string values to reduce clutter.
- Updated 'index.ts' to export the new components.
2026-01-16 04:19:29 -08:00
AEmotionStudio 51ad38bfb6 feat: Add video playback support and settings validation
- Implemented a continuous animation loop in 'MagnifyGlass' that activates automatically when video widgets are detected, ensuring smooth playback for standard videos and VHS previews.
- Added robust validation to 'StateManager' for loading settings, including bounds checking for dimensions/opacity and format verification for colors and enums.
- Updated widget detection logic to correctly identify and handle 'videopreview' and 'audiopreview' widgets.
- Ensured animation loops are properly stopped when the glass is hidden or destroyed to preserve resources.
2026-01-16 02:05:42 -08:00
Æmotion Studio 40c70bdba4 Merge pull request #21 from AEmotionStudio/bolt/optimize-render-overlays-1998194206652878890
⚡ Bolt: Optimize rendering loop by hoisting getBoundingClientRect
2026-01-15 22:28:43 -08:00
Æmotion Studio 9092cfd0ac Merge pull request #20 from AEmotionStudio/sentinel-validation-fix-2381716828487744723
🛡️ Sentinel: [MEDIUM] Add input validation for info panel settings
2026-01-15 22:28:27 -08:00
google-labs-jules[bot] 6d5791eb3c perf: hoist getBoundingClientRect out of render loop
- Moves `litegraphCanvas.getBoundingClientRect()` call outside the widget loop in `renderHtmlOverlays`.
- Reuses the `dpr` calculated at the top level.
- Adds regression test `tests/unit/MagnifyGlassRenderOptim.test.ts`.

Improves rendering performance by reducing forced reflows during magnification.
2026-01-16 04:57:01 +00:00
google-labs-jules[bot] fe771ef87e feat(security): implement strict input validation for InfoPanel settings
Add validation for all InfoPanel settings loaded in StateManager to prevent
injection of invalid values (e.g. out-of-bounds numbers, invalid colors).
This mitigates risks of degraded stability or potential injection via
manipulated settings storage.

- Add validateNumber, validateColor, validateStringOption helpers
- Update StateManager.loadSettings to validate all keys
- Add unit tests for validation logic
2026-01-16 04:45:01 +00:00
google-labs-jules[bot] d7f6b99051 feat(a11y): associate labels with form controls in sidebar
- Export form creation helpers for testing
- Add unique ID generation for sliders, selects, and color pickers
- Associate labels with inputs using `htmlFor`
- Add unit tests to verify accessibility attributes
2026-01-16 04:37:17 +00:00
AEmotionStudio 0cf992d528 fix: address final PR review issues 2026-01-15 17:38:38 -08:00
AEmotionStudio 837fe7da87 fix: address additional PR review issues 2026-01-15 17:24:05 -08:00
AEmotionStudio 3c17fc34ff fix: address PR review - add constraints to data attrs and fix boolean coercion 2026-01-15 17:12:48 -08:00
AEmotionStudio 1434e703e0 feat: add Inspector Value Editing - inline widget editing from Inspector Panel 2026-01-15 17:01:58 -08:00
Æmotion Studio 6ce27c62a3 Merge pull request #17 from AEmotionStudio/palette/accessible-toggles-10339516210084959098
feat: make sidebar toggle switches accessible
2026-01-14 21:41:39 -08:00
google-labs-jules[bot] bc872f58f6 fix: ensure keyboard events stop propagation in toggles
- Pass event object to handleToggle from keydown listener
- Ensure stopPropagation() is called for keyboard events
- Maintain consistency between mouse and keyboard interaction behavior
2026-01-15 05:33:39 +00:00
Æmotion Studio a8b6877ef7 Merge pull request #16 from AEmotionStudio/bolt/spatial-culling-optimization-6920908164080507849
⚡ Bolt: Implement spatial culling for magnified overlays
2026-01-14 21:24:55 -08:00
google-labs-jules[bot] b73705a106 fix: synchronize aria-checked state in settings panel
- Update Require Alt Key toggle sync to include aria-checked attribute
- Update Reset Position button to clear aria-checked on Follow Cursor toggle
- Add regression tests for sidebar interaction state synchronization
2026-01-15 05:19:31 +00:00
google-labs-jules[bot] b488e89379 fix: add division-by-zero guard for canvasScale in culling logic
Prevents Infinity values and potential culling errors when canvasScale is 0.
2026-01-15 05:16:30 +00:00
google-labs-jules[bot] 1109ca9f06 feat: make sidebar toggle switches accessible
- Add `role="switch"` and `aria-checked` to toggle elements
- Add `tabIndex="0"` for keyboard focus
- Add keyboard event listeners for Enter and Space keys
- Add `aria-labelledby` to associate toggles with their labels
- Enable toggling by clicking the label text
- Export `createToggle` for testing
- Add unit tests for accessibility and interaction logic
2026-01-15 04:59:19 +00:00
google-labs-jules[bot] 8dc8f2449e perf: implement spatial culling for magnified overlays
Reduces layout thrashing by filtering nodes based on their graph position before accessing their DOM widgets. This significantly improves performance on large graphs when using the magnifying glass.

- Calculates visible graph area based on cursor position and zoom.
- Checks intersection of node bounding box with visible area.
- Skips widget processing for off-screen nodes.
2026-01-15 04:58:23 +00:00
google-labs-jules[bot] f928f848e5 feat(security): add input validation for configuration settings
- Implement `validateNumber` and `validateColor` in `ConfigManager`.
- Clamp numeric settings (zoom, size, borders) to safe ranges.
- Validate color settings against hex regex.
- Update `ConfigManager` unit tests to cover validation logic.

This enhancement prevents invalid configuration states and potential stability issues caused by malformed or extreme setting values.
2026-01-15 04:56:22 +00:00
AEmotionStudio 3f2abfdc42 fix: ensure updatePreviews is restored in finally blocks (PR review) 2026-01-14 13:28:14 -08:00
AEmotionStudio 978b3d0521 fix: resolve cloned video play abort errors and other console noise 2026-01-14 13:19:48 -08:00
AEmotionStudio 83a2b3f7ea Fix Reset All Settings and console deprecation warnings 2026-01-13 23:54:15 -08:00
AEmotionStudio 65aa46a862 Fix Reset All Settings to include accessibility options and refresh UI 2026-01-13 23:43:27 -08:00
AEmotionStudio df89ecace2 Fix Position tooltip and Reset All Settings behavior for hover controls 2026-01-13 23:30:44 -08:00
AEmotionStudio e0471b716a Merge branch 'pr/11'
# Conflicts:
#	src/info-panel/UIManager.ts
2026-01-13 22:14:27 -08:00
Æmotion Studio 811e34b85a Merge pull request #10 from AEmotionStudio/bolt/optimize-mousemove-handler-11564229325542646943
⚡ Bolt: Optimize mousemove handler with requestAnimationFrame
2026-01-13 21:59:13 -08:00
google-labs-jules[bot] 5e5c49a99c fix(security): handle non-string inputs in escapeHtml to prevent crashes
- Update `escapeHtml` to explicitly coerce input to string
- Handle null/undefined values safely
- Add unit tests for non-string input types (numbers, booleans, objects)
2026-01-14 05:56:33 +00:00
AEmotionStudio 9f16a72420 Merge PR #9: Accessibility improvements and rebuild artifacts 2026-01-13 21:32:37 -08:00
AEmotionStudio 608904d1a7 refactor: improve component visibility management and styling 2026-01-13 21:23:10 -08:00
google-labs-jules[bot] 4cf3e9f50b fix(security): allow trusted html in info panel while sanitizing user input
- Add `isHtml` flag to `Focus Node` button to bypass escaping
- Update `UIManager` to check for `isHtml` flag before formatting/escaping
- Add regression tests for trusted HTML rendering logic
2026-01-14 04:56:25 +00:00
google-labs-jules[bot] 7bef79daa1 perf: throttle mousemove events with requestAnimationFrame
Prevents excessive layout thrashing and calculations by syncing
updates to the browser's refresh rate.

- Wraps update logic in `EventHandler.ts` with `requestAnimationFrame`.
- Updates `lastKnownMousePosition` synchronously to ensure accuracy.
- Reduces CPU usage during rapid mouse movement.
- Properly cancels animation frame on cleanup.
2026-01-14 04:49:58 +00:00
google-labs-jules[bot] 11062e4748 fix: ensure aria-expanded is correct on init
- Updated `UIManager.createPanel` to call `updateMinimizedState()` if the panel is initialized in a minimized state.
- This ensures the `aria-expanded` attribute on the minimize button correctly reflects the initial state (false) instead of defaulting to true.
2026-01-14 04:47:35 +00:00
google-labs-jules[bot] 416090376e feat(security): sanitize user input in info panel to prevent XSS
- Add `escapeHtml` utility to `src/shared/utils.ts`
- Sanitize rendered values in `src/info-panel/ValueFormatter.ts`
- Sanitize node titles, types, and labels in `src/info-panel/UIManager.ts`
- Add unit tests verifying XSS prevention in `tests/unit/Security.test.ts`
2026-01-14 04:38:38 +00:00
google-labs-jules[bot] 80e98a9391 perf: throttle mousemove events with requestAnimationFrame
Prevents excessive layout thrashing and calculations by syncing
updates to the browser's refresh rate.

- Wraps update logic in `EventHandler.ts` with `requestAnimationFrame`.
- Updates `lastKnownMousePosition` synchronously to ensure accuracy.
- Reduces CPU usage during rapid mouse movement.
2026-01-14 04:37:48 +00:00