Commit Graph
63 Commits
Author SHA1 Message Date
Dariusz L 726c3a9e02 Preserve missing model selection across workflow model changes
Add workflow slot key helpers and remap selected and batch-selected keys
when the underlying missing model list changes after a workflow update.
2026-07-27 18:12:34 +02:00
Dariusz L 486ff262f1 fix: normalize Windows backslash paths consistently in frontend path joins 2026-07-24 21:35:38 +02:00
Dariusz L 6ff9db2af6 normalize subfolder paths to forward slashes across backend and frontend 2026-07-24 21:22:31 +02:00
Dariusz L 668cecea2d Make resolver workflow model selection survive analysis timing
Queue workflow model reference selection requests in the dialog, wait for
workflow analysis to complete before attempting selection, and handle
superseded or timed-out requests gracefully.

- Track pending selection requests on the dialog with status fields
- Apply queued selections from lifecycle graph methods after analysis
- Await loadWorkflowData/loadLoadedModels so the caller can proceed
  after tab content is actually ready
- Add timeout handling with user-visible warnings when selection cannot
  complete
- Cover queueing, superseding, waiting, and completion in JS tests
2026-07-24 16:00:10 +02:00
Dariusz L d368a6dffc frontend: add Model Resolver node context menu action and workflow selection support 2026-07-24 15:49:52 +02:00
Dariusz L 854cb2c08c track explicit search sources and gate local database download visibility 2026-07-22 13:25:33 +02:00
Dariusz L a822ef09c3 feat(missing models): add type filter dropdown to missing models browser 2026-07-22 13:09:14 +02:00
Dariusz L c5215c2d3f Stabilize download workflow scope during missing-model render 2026-07-22 12:48:05 +02:00
Dariusz L d293b0aaf8 Treat model_gguf as diffusion_models and render accepted file formats in missing-model UI 2026-07-20 16:54:28 +02:00
Dariusz L 5362cb17a3 refactor: remove dead code and add isAutoOpenEnabled helper 2026-07-18 14:01:05 +02:00
Dariusz L be12494953 refactor: centralize shared utilities across backend and frontend
Backend:
- Move SHA256 normalization logic from path_utils._normalize_header_sha256
  into core/type_utils.normalize_sha256, adding support for 0x-prefixed
  hashes and unifying the normalization path used by
  extract_safetensors_header_sha256.
- Add tests for the 0x prefix normalization cases.

Frontend:
- Introduce copyTextWithFeedback in web/resolver/utils/html_utils.js
  as a shared clipboard helper with configurable feedback text, CSS class,
  and duration, replacing repeated inline clipboard copy logic in
  globals.js, model_info_methods.js, and the notification utility.
- Centralize showNotification on ResolverManagerDialog and remove the
  duplicate implementation from missingBrowserMethods.
- Replace local const localStorage = safeStorage aliases in
  model_info_methods.js, missing_browser_methods.js, and
  options_methods.js with direct safeStorage usage.
2026-07-17 18:06:22 +02:00
Dariusz L 04c3de9533 refactor: reuse shared path and URL normalization utilities
Replace inline regex path/URL normalization in resolver.py and
missing_browser_methods.js with the existing shared helpers:

- core/resolver.py: normalize_workflow_download_url now uses
  prepare_remote_size_probe_url from type_utils instead of a local
  huggingface-specific regex substitution.
- web/resolver/views/missing_browser_methods.js: path identity
  generation now uses normalizePathIdentity from html_utils.js rather
  than ad hoc replace/trim/lowercase logic.

This keeps normalization behavior consistent across the codebase and
removes duplicated regex patterns.
2026-07-16 10:27:06 +02:00
Dariusz L 8823049f9e refactor: centralize filename extraction, remote URL normalization, and storage abstractions 2026-07-16 10:13:38 +02:00
Dariusz L 6ed34b6a92 Preserve active download local matches and clean up cancelled downloads
Keep path-specific Local Matches for active downloads during refreshes,
URN search, and missing-model display so late hash-only lookups do not
overwrite them.

Remove cancelled download matches from missing-model UI and cached
analysis when a download is cancelled.
2026-07-12 22:04:53 +02:00
Dariusz L 245bf79800 fix: deduplicate missing models by category+filename and expand per-node resolutions
Previously, identify_missing_models grouped missing entries only by filename,
which could merge unrelated models from different categories that happen to
share a filename. This change deduplicates by (category, filename) and tracks
all_node_refs with a reference_count so the frontend can preserve one
resolution per node reference instead of collapsing duplicates.

Frontend changes in resolve_download_methods.js iterate over all_node_refs,
and missing_browser_methods.js now shows '+ N refs' in the missing-model
label and clarifies the locate tooltip when multiple workflow references
share the same missing model.
2026-07-04 17:26:35 +02:00
Dariusz L 4c065818e3 feat: add custom URL resolution to missing browser 2026-07-04 00:45:13 +02:00
Dariusz L ce29f88c6d refactor: centralize repeated filename/search/URL/HTTP helpers
Replace duplicated filename-to-query logic with a single
\uild_filename_search_queries\ helper in matcher/civarchive/huggingface,
standardize Civitai URL generation in the frontend via \getCivitaiModelUrl\,
unify browser user-agent and response file-size extraction in the downloader
path, and derive workflow node-type category hints from widget categories
rather than maintaining a large static mapping.
2026-07-02 22:56:21 +02:00
Dariusz L 11ec45526c refactor: consolidate duplicated path and size utilities
Extract MODEL_EXTENSIONS and format_size_bytes into core/type_utils, removing duplicates from workflow_analyzer and downloader. Add getFilenameFromPath to render_format_methods and replace inline path-splitting logic across JS resolver actions, search, and views.
2026-07-02 02:27:53 +02:00
Dariusz L 2078d870b3 refactor: centralize path normalization and extract common options task handler
- Introduce normalizePathToForward/normalizePathToBackward helpers in render_format_methods.js
- Replace inline path normalization regex across 6 files with shared helpers
- Extract executeOptionsTask helper in options_methods.js to deduplicate repeated async loading/error/success handling and add missing error notifications
2026-07-02 02:12:40 +02:00
Dariusz L d97450f119 refactor: extract splitter drag logic into shared utility
Replace duplicated inline drag handlers in queue_methods.js and
missing_browser_methods.js with a new startSplitterDrag() helper in
web/resolver/utils/splitter_drag.js.

The utility centralizes pointer/mouse event binding, RAF throttling,
and touch-cancellation cleanup, cutting net code across the two
callers while preserving existing behaviour (bounds, edge-open
threshold, collapse preview, and settle/cleanup timing).
2026-07-02 01:57:37 +02:00
Dariusz L 88cf8580f7 feat: add local model hash calculation with manual-progress notifications 2026-07-02 00:41:40 +02:00
Dariusz L ea97e36532 fix: guard renderModelTreeNodes calls behind expand state to avoid unnecessary rendering 2026-07-01 23:07:32 +02:00
Dariusz L 113c20c566 perf: optimize missing models browser selection updates
Avoid full list re-render on row selection by passing selectionOnly flag
to displayMissingModels, which now selectively updates row classes and
detail pane instead of rebuilding the entire DOM. Also removed an eager
ensureLocalModelsThenPopulate('') call on combo list presence, and added
a click listener alongside focus so the combo list reliably populates on
both interaction types.
2026-07-01 23:00:37 +02:00
Dariusz L d95c099f5a Improve rendering performance and split drag behavior
- Added CSS content-visibility and contain-intrinsic-size to list row
  containers in resolver-main.css and resolver-shell.css for off-main-thread
  rendering optimization.
- Deferred queue list panel split drag updates to requestAnimationFrame in
  web/resolver/actions/queue_methods.js, reducing redundant DOM writes and
  guarding against duplicate frames during split dragging.
- Deferred missing browser split drag updates to requestAnimationFrame in
  web/resolver/views/missing_browser_methods.js with optional chaining on
  split start values, preventing layout thrashing while dragging.
2026-07-01 22:52:17 +02:00
Dariusz L 3c4dfc72e4 feat: refactor queue panel and split layout with deferred reveal and pointer events
- Add PointerEvent support for queue toggle, edge drag, and splitter interactions
- Implement deferred queue panel reveal animation (mr-queue-opening class)
- Make queue panel updates demand-driven; skip refresh when panel is hidden
- Replace per-item remove listeners with event delegation on queue list
- Track queue split container width via ResizeObserver with safe fallbacks
- Centralize split flex application and persist queue width/collapsed state with debounce
- Fix missing browser split pane styles to use helper-track CSS variables
- Add deferred UI cleanup for missing browser split drag end
- Add prewarm frame fallback when ResizeObserver is unavailable
2026-07-01 17:58:05 +02:00
Dariusz L c2b074ce12 fix: improve missing browser split pane resize behavior 2026-07-01 01:23:24 +02:00
Dariusz L 24db5ed54c refactor: centralize notification handling into shared utility 2026-06-30 01:08:11 +02:00
Dariusz L 5f1b53e41c Add option to show/hide auto-download capable models in missing browser 2026-06-29 20:54:54 +02:00
Dariusz L 378f82cb25 feat: identify auto-download-capable missing models; add workflow schema inference and badge UI
- Extend dynamic widget category hints to capture choice source (static/hybrid/folder_paths)
- Infer workflow schema model candidates from output category hints when widget values match known presets
- Surface auto_download_capable and auto_download_candidate flags in missing model data
- Merge these flags on duplicate missing model entries
- Add cloud-download badge UI with tooltip explaining auto-download context
- Update huggingface author index metadata timestamp
2026-06-29 20:34:03 +02:00
Dariusz L 5571035e23 Replace resolved badge with check icon in missing model rows
- Switch missing model row layout from grid to flex
- Add circleCheckBig SVG icon to icon_utils
- Replace green 'Resolved' text pill with inline checkmark icon
- Update CSS with resolved icon and model details wrapper styles
2026-06-27 22:21:21 +02:00
Dariusz L 4ac05c0228 Make missing-model list header sticky during scroll
Move the .mr-missing-list-head element inside the scrollable .mr-missing-list
container and apply position: sticky so the column headers remain visible when
the list overflows. Adjust grid layout and row alignment rules to support the
new structure.
2026-06-27 20:52:45 +02:00
Dariusz L b73cdb0f40 feat: improve category resolution and missing models browser
- Expand preferred categories to include clip_vision, ipadapter, sams, ultralytics
- Add clip_gguf alias for text_encoders in both backend and frontend
- Add explicit diffusion_models/text_encoders mappings in CATEGORY_MAP
- Refactor get_model_roots to skip custom_nodes/configs, use template key
  aliases, accept new folder keys from known categories, and normalize
  ultralytics paths (yolo/bbox, yolo/segm, yolo -> parent)
- Pass missing object through resolve_download_methods and search_panel
  so category selection can use widget hints
- Refactor frontend download target resolution:
  - getMissingSupportedDownloadCategories respects widget/type hints
  - getNodeTypeDownloadCategory splits exact-node map and adds
    normalizeNodeCategoryToken / getNodeTypeDownloadCategoryFromTokens
    for GGUF and future node families
  - getSourceResultDownloadCategory and _sourceSupportLevel accept
    missing for unified logic
- Prioritize dynamic widget category hints in workflow analyzer and
  include category_hints/folder_key_hints on all model refs
- Add folder count badges and path normalization in missing browser
  (normalizeMissingFolderRootPath handles category suffixes / bbox/segm)
2026-06-27 19:36:47 +02:00
Dariusz L c7d6b27fb0 feat: add search cancellation API and harden CivArchive source resolution
Add a /model_resolver/search-cancel/{progress_id} endpoint with a
SearchCancelled exception so in-flight source searches abort cleanly on
batch cancel. Track sourceProgressIds alongside sourceControllers so the
frontend can cancel backend progress polls. Rework CivArchive extraction
with robust __NEXT_DATA__ parsing, hash-page file resolution, model-link
scraping, confidence-based candidate filtering, and expanded type maps.
Add conftest.py for pytest path setup, update .gitignore for scratch/,
and refresh huggingface-author-index.json.
2026-06-26 00:55:38 +02:00
Dariusz L 8f890f6992 refactor: centralize path utilities in core/path_utils
Extract repeated path normalization and identity logic from __init__.py,
core/resolver.py, core/downloader.py, and core/scanner.py into a shared
core/path_utils module. Also add a loading state to the local model picker
so it waits for models to load before rendering options.
2026-06-25 01:23:20 +02:00
Dariusz L 2fe2092dfc refactor: centralize API helpers, extract shared UI utilities, simplify dropdown positioning 2026-06-25 00:59:06 +02:00
Dariusz L dcac1b7c8a refactor: consolidate shared utilities and relocate view-specific settings logic
- Moved formatting helpers (formatBytes, formatDuration, getDownloadEtaText,
  formatDownloadProgressMeta) and getLocalMatchDisplayInfo from
  resolve_download_methods.js and missing_browser_methods.js into
  render_format_methods.js for shared reuse.
- Relocated settings-related methods (getStoredTokens,
  applyFrontendLoggingPreference, loadSettingsFromServer) and their
  log_system imports from download_target_methods.js into
  options_methods.js, where they are actually consumed by the options UI.
- Simplified missing_browser_methods.js to use
  getLocalMatchDisplayInfo instead of inline local-match code.
2026-06-24 23:42:34 +02:00
Dariusz L 9d3f18f288 refactor: consolidate refreshMissingListRow into shared method
Remove duplicated refreshMissingListRowForMissing and
refreshMissingListRowLocalMatch implementations, replacing them
with a single refreshMissingListRow method in missingBrowserMethods.
Also strip unnecessary BOM from imports.
2026-06-24 23:34:33 +02:00
Dariusz L fb8a65758b refactor: centralize context-menu attribute and element helpers
Replace scattered inline encodeURIComponent(JSON.stringify(...)) and
manual oncontextmenu/dataset assignments with unified helpers added to
renderFormatMethods:

  - encodeContextMenuModel(context): safe JSON serialization for data-model
  - getContextMenuAttrs(context, tooltip): HTML attribute string for
    template literals (used in 5 files)
  - getContextMenuProps(context, tooltip): props object for imperative
    element assignment (used in missingBrowserMethods)
  - setContextMenuElement(element, context, tooltip): sets or clears
    data-model, data-tooltip, and oncontextmenu on a DOM element

Reduces duplication across 5 modules, adds try/catch around JSON
serialization, and removes 14 lines of repeated oncontextmenu wiring.
2026-06-24 23:19:02 +02:00
Dariusz L b5d10fa5cc refactor: extract floating tree picker positioning into shared tree_picker.js
Create createFloatingTreePicker() utility to replace duplicated inline
floating positioning logic in download_target_methods.js and
missing_browser_methods.js. The factory handles portalization, duplicate
removal, viewport-aware positioning (open above/below), scroll container
height calculation, and scroll/resize listener lifecycle management,
reducing ~175 lines of duplicated code.
2026-06-24 23:04:50 +02:00
Dariusz L d3c7ace464 feat: add folder browser context menu and local model deduplication
- Add right-click 'Open Folder' context menu to folder browser rows and
  root group headers, with left-click guards to prevent context actions on
  non-primary clicks
- Deduplicate local model entries before filtering using path-based identity
  and category ranking to prefer the active download category
2026-06-24 22:57:56 +02:00
Dariusz L 26cca55fee feat: add right-click context menu to local model folder browser
- Introduce --mr-z-context-menu-popup z-index variable and shift existing
  z-indices up by one so context menu popups layer correctly above
  other UI elements.
- Update resolver-main.css and resolver-shell.css context-menu rules to
  use the new popup z-index with a fallback.
- Add joinLocalModelPath, buildLocalFolderContext, buildLocalModelContext,
  and getLocalPathContextAttrs helpers to missing_browser_methods.js.
- Wire folder and model entries in the local browser to include encoded
  JSON context attributes so right-click opens the model/folder context
  menu with the correct open-folder and model actions.
2026-06-24 22:44:51 +02:00
Dariusz L f4f07ccb0a completion: add local model browser with category-aware filtering and download target synchronization 2026-06-24 22:30:31 +02:00
Dariusz L 5445dd4ac0 feat: implement local hash matching via metadata sidecar files
Backend adds SHA256 normalization, metadata sidecar lookup, and hash fields across source modules. Frontend handles local_hash_matches in search responses and missing browser.
2026-06-24 21:59:10 +02:00
Dariusz L 34049c5ea6 Add LTX-2.3 models and resolved selection alias matching 2026-06-22 03:40:37 +02:00
Dariusz L b4cd98e1ca Refactor missing model key generation and DOM ID generation
- Centralize model key logic: replaced inline key construction across 5 files with
  getMissingModelKey() and new getMissingModelDomKey() helpers in lifecycle_graph_methods.

- Extend getMissingModelKey(): now incorporates nested_key, category, and an identity
  field (original_lora_name, original_path, expected_filename, name, filename, urn_string)
  so that distinct models within the same subgraph produce unique keys.

- Fix duplicate DOM ID collisions: getMissingModelDomKey() encodes the full key as a
  URL-safe base64 string for all element IDs (local-matches-body, selected-bar, combo,
  locate, local-matches-refresh, selected-apply, selected-remove), preventing collisions
  between subgraph instances that share a node_id/widget_index.

- Store missing_key on resolution objects in queue_methods to keep the canonical key in
  sync between queue and browser views.
2026-06-22 03:27:22 +02:00
Dariusz L a499af3345 Enable local model matching for resolved models and prevent symlink/junction scan loops 2026-06-22 02:21:24 +02:00
Dariusz L 74a696a4bc Add manual refresh button for local model matches in missing browser
When a model is missing, users can now click a refresh button in the
'Local Matches' header to rescan local folders and refresh matches
for that specific model. The button requests POST /model_resolver/local-matches
with force_rescan=true, shows loading state, and updates the UI on
completion or error. CSS was added for the new button element.
2026-06-22 02:00:40 +02:00
Dariusz L 590b4a4969 feat(missing-browser): add toggle to show resolved models
Report resolved (already-existing) models alongside missing ones in the
missing-browser view. Resolved models are hidden by default; a new
'Show resolved' toggle in the toolbar reveals them with a badge and
reduced-opacity row styling. The toggle state is persisted in
localStorage.

Backend: include resolved_models and total_resolved in the analysis
payload so the frontend can merge them into the display list.

Frontend: normalize resolved workflow models into the missing-models
display shape, compute visibility-aware counts, and refresh the
missing-browser view on queue mutating actions.
2026-06-22 01:34:55 +02:00
Dariusz L d88b3b6c6c feat: guard missing-browser split drag and register CSS track property 2026-06-21 21:12:28 +02:00
Dariusz L 9cfa50e406 perf(missing-browser): optimize resize and rendering performance
- Disable CSS transitions during splitter drag to prevent jank
- Apply content-visibility: auto to off-screen missing list and match rows
- Suppress redundant style.setProperty calls when split width is unchanged
- Reset applied split width state on cleanup
2026-06-21 20:04:52 +02:00