Commit Graph
31 Commits
Author SHA1 Message Date
Dariusz L f8a6e8b626 feat: add HuggingFace model details, variant table, and download context 2026-07-28 17:20:36 +02:00
Dariusz L 8b2f9e81cb refactor: improve missing browser splitter drag with compositor preview and threshold
- Add drag threshold and layout frame stride to splitter drag utility
- Use onPreview callback to animate splitter offset via translate3d during drag
- Simplify resize class and cleanup logic in missing browser methods
- Replace deferred release UI cleanup with direct activation/cleanup calls
- Update CSS to add resizing overlay and remove transition during resize
- Add test covering compositor preview behavior and CSS constraints
2026-07-28 01:25:07 +02:00
Dariusz L e1c4359dc3 Serve adjacent model previews in tooltips via /model_resolver/model-preview 2026-07-26 21:13:11 +02:00
Dariusz L 2d6be246b4 Extract and display copyable CivitAI ComfyUI workflow metadata in model previews
- Preserve existing image metadata when re-normalizing CivitAI model images
- Add extractComfyWorkflow helper to recover pasteable editor workflows from image metadata, including nested/double-encoded JSON and non-finite number tolerance
- Surface recovered workflows as a copyable button in the model info image preview under Other metadata
- Add focused tests for workflow extraction, metadata preservation, and edge cases
2026-07-26 20:40:41 +02:00
Dariusz L 097be623f4 feat: preserve CivArchive page URLs separate from HuggingFace mirrors, fix HTML array escaping, and accept provider array payloads
Backend:
- Keep CivArchive source page URL distinct from HuggingFace download mirrors in download metadata
- Handle CivitAI hash lookup HTTP errors and unexpected JSON shapes without caching failures
- Allow network JSON requests to return arrays as well as objects

Frontend:
- Escape each item individually when interpolating arrays into HTML templates
- Prefer the selected provider's page URL over cross-provider mirrors in context menus and download targets
- Reuse source link resolution for model info display

Tests:
- Add coverage for CivArchive metadata URL isolation, HTML array escaping, provider array responses, and CivitAI hash lookup caching behavior
2026-07-20 16:16:09 +02:00
Dariusz L 16a69f6c47 refactor: unify provider JSON requests, catalog sync, and normalization across backend; add frontend HTML escaping helpers 2026-07-20 15:13:57 +02:00
Dariusz L 8cc02010b0 Remove unused backend and frontend code 2026-07-18 14:47:05 +02:00
Dariusz L 5362cb17a3 refactor: remove dead code and add isAutoOpenEnabled helper 2026-07-18 14:01:05 +02:00
Dariusz L 0b53fca8c6 refactor: unify category resolution, network requests, sidecar lookup, and progress tracking
Consolidate provider-specific category mapping into resolve_model_category(),
shared JSON request handling into execute_provider_json_request(), sidecar
path resolution into get_or_build_model_sidecar_info(), and progress
reporting into ProgressTracker. Update civitai/civarchive/common sources to
use the unified helpers. Add tests for the new utilities. Remove redundant
frontend wrapper methods from render_format_methods.js.
2026-07-18 12:48:11 +02:00
Dariusz L 759aef99f1 Unify model result building and progress payload updates 2026-07-18 12:26:17 +02:00
Dariusz L 719b3b3f43 Refactor: centralize metadata sidecar helpers and custom-result builders 2026-07-18 09:43:27 +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 8823049f9e refactor: centralize filename extraction, remote URL normalization, and storage abstractions 2026-07-16 10:13:38 +02:00
Dariusz L 8cf688eba6 refactor: centralize source API requests, polling, and path parsing
- Add request_source_response and request_source_json helpers with 429 retry logic
- Introduce shared split_path_segments and parse_provider_model_url utilities
- Migrate CivitAI, CivArchive, HuggingFace, and ModelList sources to centralized helpers
- Add generic pollBackgroundTask utility for frontend progress polling
- Add tests for request_source_json, split_path_segments, parse_provider_model_url
- Add huggingface-hub to requirements
2026-07-14 12:03:35 +02:00
Dariusz L 280ca2e6de Improve HuggingFace Xet downloads with native progress snapshots, transfer metrics, cancellation, and finalizing UI state 2026-07-14 11:02:57 +02:00
Dariusz L 9c0ec8b26b Add progress reporting for loaded model and workflow analysis
- Add server-side loaded models progress tracking in __init__.py
- Report workflow node analysis progress from workflow_analyzer.py
- Add frontend polling, rendering, and UI flow for loaded models progress
2026-07-03 00:06:04 +02:00
Dariusz L 56ec5c3083 refactor: consolidate shared helpers and deduplicate HTML escaping/URL collection 2026-07-02 23:35:40 +02:00
Dariusz L e0a765af61 Translate url_utils.js comments to English
Translate JSDoc comments for the getModelCardUrl function from Polish to English for better accessibility and consistency across the codebase.
2026-07-02 04:24:11 +02:00
Dariusz L b7e7b1b295 refactor: centralize getModelCardUrl and HTML/URL utilities in resolver/utils 2026-07-02 04:18:04 +02:00
Dariusz L 86bd6c04fc refactor: centralize model-extension handling and search-cache clearing
- Add clear_all_search_caches() in core/sources/__init__.py and replace 4
  individual cache-clearing call sites in __init__.py with the new helper.
- Add shared parse_civitai_model_path() in core/type_utils.py and use it
  from both CivitAI and CivArchive URL parsers to remove duplicated regex logic.
- Rename parse_huggingface_url() to get_huggingface_repo_and_file_from_url()
  in core/resolver.py for clarity.
- Add stripModelExtension() and hasModelExtension() utilities (with a single
  MODEL_EXTENSIONS_REGEX) in web/resolver/utils/render_format_methods.js
  and replace repeated inline regex patterns across search_panel.js,
  model_info_methods.js, tabs_loaded_methods.js, and queue_methods.js.
2026-07-02 03:57:43 +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 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 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 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 bbfd50a075 feat: expose download folder context through status indicators and notifications
Propagate the resolved download directory and file path from the backend
download flow into frontend progress UI: add \path\ and \directory\ fields
to download progress state, render right-clickable context menu entries on
progress bars and status messages, and allow opening the download folder
directly from completion or error notifications. Also update the HuggingFace
author index.
2026-06-12 16:32:48 +02:00
Dariusz L e61c868038 fix: prevent stale tab renders by scoping workflow and loaded models data loading to their respective tokens 2026-06-07 18:37:00 +02:00
Dariusz L 5a8e68655f refactor: rename Model Linker to Model Resolver
Replace all link dialog terminology with resolver terminology
throughout the codebase, including module names, CSS classes,
IDs, JS variables, SVG gradient IDs, and log module names.
Remove the old web/linker/ tree and introduce the new web/resolver/
tree with parallel structure. Also replace core/linker.py with
core/resolver.py.
2026-06-05 05:53:39 +02:00