Commit Graph
267 Commits
Author SHA1 Message Date
MajoorWaldiandMajoorWaldi 2bd4f4b788 fix: resolve 6 failing Vitest tests across 4 files
Agent-Logs-Url: https://github.com/MajoorWaldi/ComfyUI-Majoor-AssetsManager/sessions/5e8a712f-b151-4133-9af9-c098c54c2506

Co-authored-by: MajoorWaldi <129623145+MajoorWaldi@users.noreply.github.com>
2026-04-25 00:25:34 +00:00
Ewald 70a1a87c94 fix(security,arch): route WorkflowNodesTab through hostAdapter and reset prefs snapshot in tests
- Replace direct comfyApiBridge import in WorkflowNodesTab with getRawHostApp (ADR 0007).
- Reset security prefs snapshot in _reset_security_state_for_tests so tests that toggle MAJOOR_REQUIRE_AUTH are not influenced by an earlier ensure_security_bootstrap publishing require_auth=False.
- Call _reset_security_state_for_tests from _clear_write_auth_env helper for proper isolation.
- Rebuild frontend bundle.
2026-04-25 01:35:29 +02:00
Ewald 2b10814b2e feat(mfv): ImageOps live preview crop + node panel selection sync
- ImageOps preview bridge: stream cropped contain-fit rect of __imageops_state.canvas (removes square scope/letterbox); fall back to full canvas when user pan/zoom is active. Signature-cached encode (WeakMap) avoids re-encoding on every poll tick.
- Floating viewer: skip metadata enrichment for imageops-live-preview source; preserve user pan/zoom across stream frames of the same node; remove inline CSS overrides that blocked the MFV transform.
- Workflow Nodes panel: graph-selected node is auto-expanded, promoted to first position in its container, scrolled into view, and gets a subtle blue highlight (is-selected-from-graph).
2026-04-24 23:47:27 +02:00
Ewald 0894657274 security: honor UI prefs at runtime + LAN-friendly defaults
The Settings -> Security toggles (Allow Remote Full Access, Allow HTTP Token Transport, Require Token For All Writes) were persisted in the DB but ignored by _check_write_access() and the bootstrap-token endpoint, which only read MAJOOR_* env vars. Remote LAN clients hit 'Write access is blocked' even with all toggles enabled.

- New security_prefs_snapshot module: thread-safe in-memory snapshot of persisted prefs, hydrated at ensure_security_bootstrap() and republished on every set_security_prefs(). Read synchronously by guards.

- security.py::_resolve_security_flag(pref_key, env_var, default): single read site, snapshot-first / env-fallback. Used for allow_remote_write, require_auth, allow_insecure_token_transport.

- _bootstrap_enabled() also returns True when allow_remote_write is set in the snapshot (UI consent for remote bootstrap).

- bootstrap-token / rotate-token accept plain HTTP transport when allow_insecure_token_transport is on.

- Friendlier defaults so first install works zero-config on LAN: allow_remote_write=True, allow_insecure_token_transport=True. Auto-generated API token still gates writes.

- Error messages updated to point users to Settings -> Security instead of only env vars.

- README rewritten to put the UI flow first; env vars as headless fallback.

- pyproject.toml: per-file ignore F401 for routes/core/security.py since it is the single import point that re-exports from sub-modules.
2026-04-24 15:33:15 +02:00
Ewald b87da7b67f perf(grid): cold-start fast-load + stale-snapshot head refresh + race guards
- Early-fetch immediate (no setTimeout 800ms), persisted scope/sort key, includeTotal=false.

- Snapshot persisted in localStorage (was sessionStorage), with legacy migration.

- MIN_LOADING_SKELETON_MS=0; skeleton hides as soon as assets are present.

- New scheduleSnapshotHeadRefresh: re-fetch page 0 after fast-path cached:true and upsert new items at correct sort position. Fixes recent assets disappearing on scope switch (custom->output).

- offset=max(offset, assets.length) in didHydrate branch so prefetch loads next page, not page 0 again.

- refreshDuplicateAlerts non-blocking (fire-and-forget).

- Race guards: scheduleDeferredExecutionReload skips reload if scope/filter changed during prompt execution; scheduleSnapshotHeadRefresh aborts if context changes mid-fetch.

- Includes other staged misc edits (config, scanner, watcher, components).
2026-04-23 17:49:20 +02:00
Ewald dbf05a8c0e test: fix floating_viewer_toolbar_overlay_controls for popover-based toolbar
The toolbar was redesigned from inline <select> to icon buttons + popovers.
Update the test to match the new structure:
- check for .mjr-mfv-guides-trigger and .mjr-mfv-ch-trigger in bar
- expect formatSelect.value to be 'off' when _overlayMaskEnabled is false
- add viewer.element to the mock so the popover appendChilds don't throw
2026-04-22 10:22:08 +02:00
Ewald 6cfcc84c1a fix: MFV seed randomize + subgraph widget live sync
- sidebarRunButton: add _walkAllNodes() to mirror ComfyUI's native
  beforeQueued/afterQueued widget cycle on all nodes incl. inner subgraph
  nodes so control_after_generate (randomize/increment/decrement) is
  applied correctly on each MFV run
- widgetAdapters: _syncWidgetDomElement falls back to
  cachedDeepestByFrame.widget.inputEl for PromotedWidgetView so typing
  in the sidebar updates the canvas textarea of subgraph outer widgets
  in real time
- widgetAdapters: spinner step forced to 1 for integer widgets;
  widget.value restored after callback to bypass step2 snapping
2026-04-22 10:19:53 +02:00
Ewald 79ccbe0da1 fix(hot-reload): address potential issues during Vite hot-reload
- Remove stale storage event listener in SettingsPanel.js
- Add checks for window object in LiveStreamTracker.js, floatingViewerManager.js
- Implement onScopeDispose for storage event listener in usePanelStore.js
- Add check for window object in MajoorPanel.svelte
2026-04-21 11:35:04 +02:00
MajoorWaldiandMajoorWaldi c9459db0fd fix: change MFV_LIVE_DEFAULT from false to true to fix floatingViewerManager test failures
Agent-Logs-Url: https://github.com/MajoorWaldi/ComfyUI-Majoor-AssetsManager/sessions/32c3a21b-8cd3-47b5-8392-fb959c7c0531

Co-authored-by: MajoorWaldi <129623145+MajoorWaldi@users.noreply.github.com>
2026-04-20 21:21:10 +00:00
Ewald b2ef3d0f80 fix(assets): improve grid reload and scroll behavior
- Adjusting the infinite scroll loading point to 4 card rows from the bottom
- Improving grid state restoration after reloads
- Enhancing the early fetch mechanism for faster initial loads
- Optimizing execution runtime to handle large numbers of assets efficiently
- Updating viewer and run button behavior for better integration with ComfyUI
- Fix various bugs and edge cases
2026-04-20 23:10:42 +02:00
MajoorWaldi 1c6653a21d refactor(i18n): remove unused db reset notice and related code
- Remove hardcoded DB reset notice from i18n dictionary
- Remove DB reset notice version check from versionCheck.js
- Delete unused imports and variables related to DB reset notice
2026-04-16 13:55:54 +02:00
EwaldandClaude Sonnet 4.6 81ff7d1fb5 Grid audit fixes: unified filename key, adaptive overscan, selection anchor
- Unify filename key normalization: VirtualAssetGridHost and useVirtualGrid
  now import and call getFilenameKey() from AssetCardRenderer instead of
  duplicating the String().trim().toLowerCase() inline expression.
- Make virtualizer overscan adaptive: compute ceil(scrollHeight / rowHeight)
  clamped to [3, 20] so tall viewports buffer more rows without wasting
  memory on small ones; falls back to 6 when no scroll element is present.
- Preserve Shift+Click anchor on reconcileSelection: add preserveAnchor
  option to setSelection (default false, no behaviour change for existing
  callers) and pass it as true from reconcileSelection so pruning invisible
  assets out of the selection no longer resets the range anchor.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-15 15:07:52 +02:00
Ewald 89119b777f Fix floating viewer defaults and button regressions 2026-04-15 13:38:32 +02:00
Ewald 85aca69bc8 Default floating viewer streaming controls on 2026-04-15 12:31:49 +02:00
Ewald d72a31f4e3 Fix Florence vector health regression and sync backfill polling exports 2026-04-15 10:22:27 +02:00
Ewald 7b00cd9e50 Fix Florence-2 startup and refresh UI bundle 2026-04-15 09:44:21 +02:00
MajoorWaldiandMajoorWaldi 31e7e89376 fix: only forward opts to loadPreviewBlob when non-empty
Agent-Logs-Url: https://github.com/MajoorWaldi/ComfyUI-Majoor-AssetsManager/sessions/5601e848-036c-4cd0-adf1-b974e4bd50c9

Co-authored-by: MajoorWaldi <129623145+MajoorWaldi@users.noreply.github.com>
2026-04-14 15:42:11 +00:00
Ewald 1493e76254 Fix viewer stepping and geninfo regressions 2026-04-14 17:19:13 +02:00
Ewald 8ae71eb31e Fix floating viewer playback and search responsiveness 2026-04-14 15:23:35 +02:00
Ewald 6222b3d225 Optimize search queries and sync viewer updates 2026-04-14 11:38:25 +02:00
Ewald 7d1dd830b9 Add MFV player shortcuts and docs 2026-04-14 10:15:42 +02:00
Ewald 9b8b9f9a12 Improve MFV player UX and regression coverage 2026-04-14 09:00:43 +02:00
Ewald f448faaca3 Auto-open message history for reset/backfill; show ComfyUI run errors in MFV overlay 2026-04-13 14:34:20 +02:00
Ewald 7a18c8f4d9 Remove latent preview fallback and sync settings/UI artifacts 2026-04-13 13:40:26 +02:00
Ewald db88ad982a feat: add MajoorSaveImage & MajoorSaveVideo nodes, generation_time_ms extraction, topbar MFV button announcement
- nodes.py: MajoorSaveImage (PNG with generation_time_ms in text chunks) and MajoorSaveVideo (MP4 via PyAV, GIF, WebP with metadata persistence)
- extractors_png.py: read generation_time_ms from PNG text chunks
- extractors.py: extract generation_time_ms from merged EXIF data into metadata dict
- extractors_video.py: extract generation_time_ms from ffprobe format tags
- messageCenter.js: add generation-time-persistence tip and topbar MFV button announcement
- CHANGELOG.md: document topbar MFV button and custom nodes
- README.md: add Custom Nodes section with input tables
- docs/CUSTOM_NODES.md: full node reference and extraction pipeline docs
- docs/DOCUMENTATION_INDEX.md: add CUSTOM_NODES.md entry
2026-04-12 19:16:07 +02:00
Ewald 0b39bb91d5 feat: improve drag-and-drop & runtime listeners 2026-04-12 17:50:48 +02:00
Ewald c6ffdf3dcb Add top bar Viewer button for MFV 2026-04-11 22:53:08 +02:00
Ewald d7014bc942 fix: re-export registry internals + force-upsert on ASSET_INDEXED + fix test mocks
- registry.py: re-export PromptServer, _request_path_and_method, _requires_auth,
  _extract_app_paths, _extract_table_paths so tests and mypy can import them
- registerRealtimeListeners: add force option to upsertLiveAssetIntoGrid;
  _mjrAssetIndexedHandler passes force:true to bypass query filter
- grid_loader_adaptive_paging test: add APP_DEFAULTS to config.js mock
- register_realtime_listeners test: use expect.objectContaining for upsertAsset
  assertions to tolerate mtime injection
2026-04-11 20:31:47 +02:00
Ewald 7fb30f4c2d feat: realtime upsert immediate flush + pending-blue dot + feed card-size slider
- useGridLoader: add upsertAssetNow() — bypasses 200ms debounce via flushUpsertBatch()
- VirtualAssetGridHost: expose _mjrUpsertAssetNow on grid container
- gridApi: export upsertAssetNow(gridContainer, asset)
- entry: wire upsertAssetNow into registerRealtimeListeners
- registerRealtimeListeners: immediate:true on asset-added/asset-indexed handlers;
  pending-blue dot (has_workflow/has_generation_data=null) for unenriched new assets
- feedHost: add card-size toolbar (slider + -/+ buttons) in Generated Feed header;
  persists to settings.feed.minSize and dispatches mjr-settings-changed live
- theme: fix feed card meta-row layout (flex + gap) so items no longer collide
2026-04-11 20:17:15 +02:00
Ewald f56d6284da fix: MFV popup dark theme, gen info panel, reset zoom + popout polish
- FloatingViewer.impl.js: add missing _resetMfvZoom() method (was called
  from floatingViewerLoader/Mode but never defined on the class)
- viewerShell.js: return genInfoTitle + genInfoTitleLeft from createViewerStageShell
- ViewerRuntime.js: destructure genInfoTitle + genInfoTitleLeft (were undefined
  => gen info body was never populated)
- floatingViewerPopout.js: inject document.documentElement.style.cssText as
  :root{...} in popup head so ComfyUI CSS vars are available; set body
  background to #0d0d0d; remove broken history.replaceState (Chrome blocks
  it from about:blank)
- __init__.py: remove unused FailureSeverity/StageStatus imports
2026-04-11 19:06:23 +02:00
Ewald ec7ffdea3c fix(mfv-sidebar): node parameters auto-sync with graph nodes
- Hook canvas.onNodeDeselected (was missing) so sidebar clears when
  deselecting all nodes (click on empty canvas)
- Add DOM-level pointerup listener on canvas.canvas as fallback for
  ComfyUI selection paths that bypass LiteGraph callbacks
- Add requestAnimationFrame retry in open() if canvas is null at call time
- Write widget values in real-time on input event (number + textarea)
  instead of only on change/blur; partial states (-/./empty) are skipped
  for number inputs; blur still clamps and syncs displayed value
2026-04-11 12:41:19 +02:00
Ewald 97649c9887 perf/test: audit backlog — lazy viewer imports, structured logging, perf budget + unit tests
- ViewerRuntime.js: convert 6 heavy static imports (abCompare, sideBySide,
  model3d, scopes, genInfo, frameExport) to dynamic lazy imports with
  _prewarmViewerModules(); all 8 call sites updated with optional chaining
- logging.js: add mjrDbg() export (gated by APP_CONFIG.DEBUG_VERBOSE_ERRORS);
  replace labeled console.debug() calls in bootstrap.js, useGridLoader.js,
  entry.js
- ttlCache.vitest.mjs: add 4 LRU edge-case tests (10k flood, re-set order,
  post-expiry pruning)
- grid_perf_budget.vitest.mjs: new CI perf-budget suite — 5 tests at 10k+
  assets (budget 400ms, actual ~40ms)
- backfill_jobs.py: new route module extracted from db_maintenance handler
- test_backfill_jobs.py: 61 direct unit tests covering all public functions
- test_db_corruption_recovery.py: new recovery scenario tests
- auth/fetch test suites: auth_refresh_race, client_auth_token, fetch_utils
- js_dist rebuilt

Tests: 393 JS passed, 1428 Python passed, 2 skipped
2026-04-11 11:56:01 +02:00
Ewald a2053d0cba refactor(v2): plan V2 complet — splits JS, tests frontend, durcissement securite
Chantier F - Typage Python
- ruff S101 déplacé en per-file-ignores (pyproject.toml)
- pyrightconfig.json : mode standard confirmé

Chantier G - Assertions & bare-except
- 16 blocs except documentés dans config.py
- --cov-branch activé, seuil coverage 60→68%

Chantier H - Cache settings
- Stratégie documentée dans settings.py
- _resolve_index_dir() logguée dans config.py

Chantier I - Split gros fichiers JS
- client.js 1509L → client.js 406L + clientAuth.js + clientOps.js + fetchUtils.js
- toolbar.js 927L → toolbar.js 458L + toolbarActions.js + toolbarControls.js
- FloatingViewer.js → FloatingViewer.impl.js + floatingViewer*(8 modules)
- Viewer_impl.js → ViewerRuntime.js + viewerShell.js + viewerThemeStyles.js + viewerOverlayDismiss.js
- model3dRenderer.js → model3dRenderer.impl.js + model3dCore.js + model3dLoaders.js + model3dSupport.js
- dialogs.js → dialogs.js + DialogTemplates.js

Chantier J - Tests frontend (Phases 1-2)
- use_drag_drop.vitest.mjs : 5 tests
- use_grid_state.vitest.mjs : 18 tests
- security_client_headers, security_deep_merge, security_runtime_state, runtime_store, dialog_templates
- Total: 80 fichiers test / 350 tests vitest

Chantier K - Pinia migration
- runtimeState.js entièrement migré vers Pinia
- getOptionalRuntimeStore.js + runtimeEnrichmentState.js ajoutés

Chantier L - Durcissement sécurité
- tests/security/test_rate_limit.py : 8 tests rate-limit (state machine complète)
- clientAuth.js : docstring sessionStorage security boundary
- three.js 0.183.2 audité : 0 CVE (Snyk)

Chantier M - Simplification config
- deps.py, tool_detect.py, utils.py nettoyés

docs: PLAN_REFACTO_V2_LONG_TERME.md ajouté et clôturé
.gitignore: coverage/ ajouté
2026-04-11 09:38:41 +02:00
Ewald 7e985b8e6d feat(mfv): multi-pin A/B/C/D, node parameters sidebar, sidebar position setting
- Multi-Pin references: toggle buttons A/B/C/D to pin up to 4 images
- Node Parameters sidebar: view/edit workflow node widgets inside MFV
- Run button in viewer toolbar for immediate re-queue
- Expandable text areas for long prompts
- Sidebar position setting (right/left/bottom) via Settings
- Toolbar layout: Run and Node Parameters pushed to far right
- Message Center: 2 new announcements for the features
- Docs: VIEWER_FEATURE_TUTORIAL, FLOATING_VIEWER_WORKFLOW_SIDEBAR
- CHANGELOG v2.4.5, README aligned
2026-04-10 21:47:01 +02:00
Ewald e11d417310 fix: viewer header symmetric layout in compare mode
- Remove absolute positioning from rightArea, use flex:1 1 0 flow layout
- Move titleLine (filename+badges) to leftArea in compare mode for 3-column layout
- Mirror paddingLeft=84px to match paddingRight in compare mode for symmetry
- centerArea flex:0 0 auto in compare so mode buttons stay centered
- Export leftArea, centerArea, titleLine, titleWrap, modeButtons from toolbar
- Add overflow:hidden to left/right meta and areas for text truncation
2026-04-10 15:42:53 +02:00
Ewald 13a69c1237 fix: wire video autoplay mode setting to grid cards
- Import APP_CONFIG in AssetCardInner.vue and read GRID_VIDEO_AUTOPLAY_MODE
- Add reactive videoMode ref updated via mjr-settings-changed listener
- Add bindVideoAutoplay() with IntersectionObserver for 'always' mode
- Add cleanupVideoBehaviors()/applyVideoMode() to switch between off/hover/always
- watch(videoMode) re-applies behavior on runtime setting change
- Fix rating reset bug: mark_recent_generated before ExifTool write (sync.py/watcher.py)
- Add scope-switch cache, exit-similar-scope, and rating/tags ID tests
2026-04-10 15:18:53 +02:00
Ewald 1982b3ab3c Add local and CI quality gates 2026-04-10 11:05:27 +02:00
Ewald a767295896 refactor(assets): improve structure and modularity of asset handling
- Split asset_path_service into smaller, more focused modules
- Introduce new protocols for asset context preparation
- Reorganize import statements for better clarity
- Extract helper functions to improve code readability and reusability
- Update type annotations to use Protocol for better type checking
2026-04-10 10:41:41 +02:00
Ewald 88a672132a docs(refactor): update MAJOR ASSETS_MANAGER refactor plan
- Mark "Frontend Consolidation post-Vue" as completed
- Update status of various refactoring tasks
- Add completion date (2025-06-11)
- Clarify checklist usage for individual PRs
- Update TODOs and criteria for acceptance
2026-04-10 09:46:27 +02:00
Ewald f5917eef6e feat(execution): implement idle grace period and enhance asset handling
- Add EXECUTION_IDLE_GRACE_MS config to control post-execution delay
- Implement post-execution work scheduling to optimize resource handling
- Enhance asset upsert logic for live assets during stack finalization
- Add runtime status synchronization to backend
- Improve execution start/end handling with new job ID tracking
- Refactor live asset event processing to reduce complexity
- Optimize imports and event handling in various modules
2026-04-09 01:55:32 +02:00
Ewald b8d166fe71 feat(viewer): modernize viewer overlay UI
- Add dynamic theming with radial gradients and blurred effects
- Refine layout and spacing for various components
- Enhance filmstrip appearance and behavior
- Improve info panel styling and positioning
- Update general styling for buttons, tooltips, and other elements
2026-04-09 00:24:55 +02:00
Ewald 79f98217c5 feat(viewer): enhance video controls and asset navigation
- Add keyboard shortcuts for video in-point (I), out-point (O), and navigation (Home/End)
- Implement swipe gesture for navigating between assets in the viewer
- Add option to copy prompt to clipboard (Ctrl/Cmd+C)
- Improve stack group card functionality and representative selection
- Optimize image preloading for smoother navigation
- Enhance audio visualizer with WebGL support and mode switching
- Refine feed card appearance and interaction
2026-04-08 20:50:26 +02:00
Ewald 1ab690bb98 fix(grid): enhance AssetCardInner reactivity for AI processing updates
- Explicitly track AI-related properties for Vue reactivity
- Ensure updates after backfill operations are detected
- Improve tracking for workflow, generation data, AI info, auto tags, caption, and vector
2026-04-08 17:46:10 +02:00
Ewald 7070e8d1e9 Refactor code structure for improved readability and maintainability 2026-04-08 17:07:52 +02:00
Ewald ALOEBOETOE 879e31ed78 Merge pull request #59 from MajoorWaldi/codex/viewer-resource-forbidden-relpath
feat(assets): implement grid snapshot caching
2026-04-08 13:53:46 +02:00
MajoorWaldi 8b0b77051b feat(assets): implement grid snapshot caching
- Add grid snapshot caching to improve performance and reduce server requests
- Implement sessionStorage-based cache storage with size and TTL limitations
- Update grid loader to interact with the snapshot cache
- Modify asset upsert logic to work with cached snapshots
- Add functions to remember and retrieve snapshots
- Update CSS class names for grid skeleton layout
2026-04-08 13:48:20 +02:00
Ewald 39b55380db feat(output): support path strings in extractOutputFiles
- Add support for string paths in addition to object arrays
- Implement new buildKey function for generating unique keys
- Introduce SUPPORTED_PATH_EXT_RE regex for valid file extensions
- Update pushItem and addItems functions to handle string inputs
- Add new pushPathString function for processing string paths
2026-04-08 09:45:50 +02:00
Ewald 4e8fa8ab8d feat(minimap): enhance minimap functionality with zoom and navigation features
feat(extractors): add path prompt detection and improve workflow parameter handling

test(extractors): add tests for skipping filepath-like prompts and ensuring overrides
2026-04-08 09:42:39 +02:00
MajoorWaldi edd2186f4e fix(api): improve authentication token handling and refresh logic
- Add session storage for temporary token storage
- Implement logic to clear local storage token after bootstrap refresh
- Refactor token refresh process to handle remote cookie refresh without exposing token
- Update fetchAPI function to use new token refresh logic
- Add tests for new token handling behavior
2026-04-08 09:07:59 +02:00
MajoorWaldi 654bed1b7b feat: add LiveStreamTracker for enhanced video and image handling
- Implemented LiveStreamTracker to manage live streaming of images and videos.
- Introduced functions for loading and saving images and videos, including handling of various formats.
- Added event listeners for new generation outputs and preview streaming integration with ComfyUI API.
- Established hooks for node selection changes to track and manage content updates.
- Created utility functions for parsing URLs and file paths to streamline input handling.
2026-04-07 23:12:37 +02:00