Commit Graph
292 Commits
Author SHA1 Message Date
Dariusz L d49ae0becc refactor: centralize API calls through ResolverManagerDialog.fetchJson
Replace scattered api.fetchApi(...) + response.ok + response.json() boilerplate
across all web/modules with a unified this.fetchJson() helper defined on the
base dialog class.

Changes:
- dialog.fetchJson(url, options, context) handles headers, status checks, and
  JSON parsing in one place
- Extracts server-side error messages (errData.error) for better UX
- Optional silent flag suppresses notifications for background/refresh requests
- All callers simplified: async return, shorter bodies, consistent error handling
- BOM removed from workflow_update_methods.js and tabs_loaded_methods.js
2026-06-25 02:01:18 +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 91549dbc9b refactor: delegate download cancellation, reorder workflowId, remove unused copy/filter helpers 2026-06-25 00:39:23 +02:00
Dariusz L c0a4398911 refactor: deduplicate download logic into executeDownloadRequest
Extract shared download orchestration from downloadModel and downloadFromSearch
into a single executeDownloadRequest method to eliminate ~125 lines of duplication.
2026-06-25 00:30:25 +02:00
Dariusz L 0b98054536 refactor: consolidate duplicated credential checks and local match fetch logic 2026-06-24 23:54:18 +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 46b1e155b6 feat: remember and normalize downloaded subfolder paths for reuse in download targets 2026-06-24 22:12:06 +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 8867058312 feat: improve download folder selection UX with category tooltips and dynamic widget category hints
- core/workflow_analyzer.py: add dynamic widget category hint extraction via threaded cache and sentinel-prefix matching; get_model_widget_category_hints now returns all inferred categories including dynamic ones, improving model folder detection for workflows with encoded category metadata.
- web: add ? help icon with context-aware tooltip to download folder selector explaining why a category was auto-selected (preserved manual choice, node type hint, workflow-detected category, default fallback, or best available). Tooltip refreshes live as the user changes the folder selection.
- web/css/resolver-main.css: style the new category help badge.
- metadata/huggingface-author-index.json: update index entry.
2026-06-24 21:01:21 +02:00
Dariusz L c5c3490210 feat: add auto-refresh of ComfyUI model catalog after Apply 2026-06-24 19:22:55 +02:00
Dariusz L 8c0168ab76 feat: skip model analysis for empty or non-model workflows
Add early-return optimizations so both backend and frontend avoid unnecessary
URL extraction and disk scanning when a workflow has no nodes or contains
no potential model references.

Also tighten API input validation by rejecting non-object workflow_json.
2026-06-24 03:46:50 +02:00
Dariusz L a01be11e27 feat(info-dialog): improve model info dialog layout and UX
- Add Escape key handler to close the info dialog, with proper cleanup
- Extract reusable renderInfoFieldLabel() helper to reduce code duplication
- Add dedicated SVG icons (file, fileText, hash, box, hardDrive, bookType) for field labels
- Adjust dialog sizing to calc(100vh - 16px) with 92vw max width
- Refactor CSS into .mr-info-field-label / .mr-info-label-icon / .mr-info-label-text
- Improve trained-words row layout with flex styling
2026-06-23 21:15:22 +02:00
Dariusz L b292411b93 feat: enhance model info image preview with CivitAI badge, metadata fields, and linked resources
- Add CivitAI badge overlay on example images with icon and direct link
- Extract denoise, scheduler, and cfgScale from metadata in civitai.py
- Support additionalResources alongside resources in both parser paths
- Redesign resource display with clickable links, version badges, and type/weight pills
- Drop prompt tags section and getInfoImagePromptTags; focus preview on generation data and resources
- Include full metadata rows and resources in copy-to-clipboard output
- Add matching CSS for badge, resource layout, and interactive states
2026-06-23 20:48:08 +02:00
Dariusz L 16a32de8de feat: improve model info dialog with clickable location, wider layout, and refined styling 2026-06-23 20:28:48 +02:00
Dariusz L 093b6d33a7 feat: enrich model info dialog with location, size, tags, and trained words from metadata 2026-06-23 19:47:49 +02:00
Dariusz L ee7d59546c feat(folder-browser): show create path message and update model index
- Update HuggingFace author index metadata (file count, repo entries)
- Style empty folder browser state with grid layout and monospace path display
- When a non-existent subfolder is typed, inform user the path will be created during download
2026-06-23 19:01:35 +02:00
Dariusz L 1cfc0beeb6 refactor: replace inline dropdown display toggling with reusable floating positioning helpers
Switch download target dropdowns from absolute-positioned elements clipped by
scroll containers to body-ported fixed-position lists managed by
downloadTargetMethods. Adds showDropdownList, hideDropdownList,
portalDropdownList, positionFloatingDropdownList, and related helpers so the
UI can keep dropdowns visible and correctly placed near their anchors.
2026-06-23 06:22:57 +02:00
Dariusz L 762363d7ef refactor: replace inline dropdown hide logic with reusable outside-dismiss helpers
Add bindDropdownOutsideDismiss and pointer-guard utilities to downloadTargetMethods,
then use them in resolveDownloadMethods to remove duplicated hide-on-blur and
setTimeout-based hide patterns. This centralizes dropdown dismissal behavior and
handles pointer/mouse/touch events consistently across dropdown lists.
2026-06-23 05:02:59 +02:00
Dariusz L f94abe1489 feat(folder-browser): improve expand/collapse interaction and row styling
Make expandable folder rows clearly distinguishable and allow clicking the
left-side toggle zone to expand/collapse folders instead of selecting them.

- Add is-expandable class and data-state-key to expandable rows
- Extract toggleFolderBrowserState helper for reuse
- Extract isFolderBrowserToggleZoneClick to detect toggle-zone clicks
- Adjust toggle button width/positioning via CSS for expandable rows
- Apply box-sizing: border-box to folder browser toggle
2026-06-23 04:48:05 +02:00
Dariusz L baa8849fa4 fix: improve floating subfolder list positioning and scroll behavior
- Remove fixed max-height constraints from folder browser scroll container
- Calculate available height dynamically based on viewport space
- Account for container chrome (borders, padding) and child elements when setting scroll max-height
- Use clampNumber for popup positioning to keep it within viewport bounds
- Ignore scroll events originating from within the list to prevent jittery repositioning
- Add box-sizing: border-box to folder browser for consistent sizing
2026-06-23 04:42:00 +02:00
Dariusz L c08eabc465 Simplify download folder browser by removing manual path rows and preserving scroll position
- Remove 'Use model root' and 'Use typed folder' manual rows from the folder browser
- Remove category badge and folder browser header elements
- Add nested scroll element detection for scroll delta handling
- Preserve scroll position when re-rendering the folder browser on toggle
2026-06-23 04:28:41 +02:00
Dariusz L f2cd4cde30 feat: replace flat subfolder list with floating folder browser for download targets
Refactor populateSubfolderOptions into renderDownloadFolderBrowser to show a
persistent floating panel with an expandable folder tree grouped by base
directory. Includes live preview of the selected target path, manual
typed-folder rows, and window/viewport-aware positioning. Prevents duplicate
portal mounts and cleans up resize/scroll bindings on hide.
2026-06-23 04:16:38 +02:00
Dariusz L d8124d03da feat: add live backend search progress tracking
Frontend now polls a new backend endpoint (/model_resolver/search-progress/{progress_id})
to display real-time, per-source progress messages and percentages during model searches,
replacing static 'Searching...' indicators with granular status updates.
2026-06-23 02:23:45 +02:00
Dariusz L 3e631b14c0 resolve_download_methods: preserve search completion state and prevent stale UI updates
- Track selected base model at search start to detect user changes and surface stale results correctly
- Skip settleInactiveSearchProgress on successful search completion so the UI does not show 'Search interrupted'
- Clear pending/running source progress with 'No match' after a completed search run so stale progress indicators are removed
2026-06-22 03:53:40 +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 4cefb35b71 Persist local match alternatives collapsed state
Store the expanded/collapsed state of local match alternative sections in localStorage so the UI preference is remembered across sessions.
2026-06-22 02:52:34 +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 ff95a2bd1e Make node locate race-safe and graph-switch-aware 2026-06-22 00:18:41 +02:00
Dariusz L 8d63fb8f2a feat(search): sync and settle search progress on visibility change and job cleanup
- Add settleInactiveSearchProgress to properly finalize pending/running
  sources when background jobs are interrupted or removed
- Hook window focus and visibilitychange in ResolverManagerDialog to
  trigger syncSearchProgressAfterResume so UI recovers after tab hide
- Refactor reconnectActiveSearchProgress to reuse sync logic and pass
  workflowKey through startEstimatedSearchProgress and refreshSearchUiForMissing
2026-06-21 21:46:45 +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
Dariusz L baabbb6027 Center-align text and increase badge font size in resolver UI
- Increase badge font size from 10px to 13px and add line-height: 1
- Center-align search results table column 3
- Change justify-self/self-align from start/right to center for consistent centered layout
- Remove right padding on element that now uses text-align: center
2026-06-21 19:54:49 +02:00
Dariusz L 0a98c9e44f feat: add suggest download subfolder button with lightbulb animation; normalize search button labels based on UI state
- Add grid layout and CSS for a new 'Suggest' column in the download target
  panel, including a lightbulb SVG icon button with a flash animation
- Update download_target_methods.js to render the suggest button in the
  dedicated grid area and apply a ‘mr-is-suggesting’ animation on click
- Adjust search button label logic so it shows 'Search Again' when there is
  a renderable search state in the panel, otherwise show 'Search Online'
2026-06-21 03:51:24 +02:00
Dariusz L 24fed2302f feat: support multi-line search button labels 2026-06-21 03:16:20 +02:00
Dariusz L bb927b3cc4 fix: align search source picker UI to layout spec
- change .mr-search-source-bar to align-items: end
- simplify .mr-search-source-picker to single-column grid with align-items: start
- fix gap, remove unused margin-left auto, set width 100%
- add flex display to .mr-search-source-picker-label with consistent vertical alignment
2026-06-21 02:56:02 +02:00
Dariusz L 8ab567238e feat(web): add search/filter input support for base model and download target dropdowns
- Remove readonly from base model and download target category inputs to allow typing
- Add input event listeners that filter dropdown options in real-time
- Normalize base model tokens for fuzzy search matching
- Introduce getSearchBaseModelInputValue to resolve typed input to known options
- Add optional { sync } parameter to setSearchBaseModel to avoid redundant UI sync during input
- Show/hide dropdown lists based on filtered result count
2026-06-21 02:50:58 +02:00
Dariusz L 92be0d6213 Improve base model alias resolution and update model metadata
- Add version-trimmed alias generation to handle trailing version zeros (e.g. '4.0' -> '4')
- Track newly added base model names in 'new_models_added_list' field
- Include Ideogram 4.0, Boogu, and PolyGen in base-models registry
- Update web resolver to match aliases using both original and version-trimmed tokens
- Enhance base models update UI to show which new models were added
2026-06-21 02:29:42 +02:00
Dariusz L 4b6161b267 Add source tracking and tooltips for auto-selected base models in search panel 2026-06-21 02:12:11 +02:00
Dariusz L 593e200cd1 feat: improve auto base model detection per missing model
Make the Auto base model label context-aware by resolving the correct base
model for each individual missing/search entry instead of relying solely on
the dominant workflow base model. Search metadata, saved download targets,
local file matches, and path hints are now consulted before falling back
to the workflow-wide default.
2026-06-21 01:56:43 +02:00
Dariusz L 7a670e3b71 feat: improve download category inference and auto-fill for download targets 2026-06-20 01:40:17 +02:00