From b8b64393545ad636818fa5c19ee1d0c14f1cfede Mon Sep 17 00:00:00 2001 From: Dariusz L Date: Fri, 5 Jun 2026 04:32:56 +0200 Subject: [PATCH] refactor: move monolithic link dialog methods into domain-based modules --- web/linker/{ => actions}/queue_methods.js | 8 +++--- .../{ => actions}/resolve_download_methods.js | 8 +++--- web/linker/{ => actions}/selection_methods.js | 8 +++--- web/linker/linker_dialog.js | 28 +++++++++---------- .../{ => search}/download_target_methods.js | 8 +++--- web/linker/{ => search}/search_panel.js | 8 +++--- .../{ => shell}/dialog_shell_methods.js | 8 +++--- .../{ => shell}/lifecycle_graph_methods.js | 8 +++--- .../{ => shell}/workflow_state_methods.js | 8 +++--- .../{ => shell}/workflow_update_methods.js | 8 +++--- .../{ => utils}/render_format_methods.js | 8 +++--- .../{ => views}/missing_browser_methods.js | 8 +++--- web/linker/{ => views}/model_info_methods.js | 8 +++--- web/linker/{ => views}/options_methods.js | 8 +++--- web/linker/{ => views}/tabs_loaded_methods.js | 8 +++--- 15 files changed, 70 insertions(+), 70 deletions(-) rename web/linker/{ => actions}/queue_methods.js (99%) rename web/linker/{ => actions}/resolve_download_methods.js (99%) rename web/linker/{ => actions}/selection_methods.js (97%) rename web/linker/{ => search}/download_target_methods.js (98%) rename web/linker/{ => search}/search_panel.js (99%) rename web/linker/{ => shell}/dialog_shell_methods.js (99%) rename web/linker/{ => shell}/lifecycle_graph_methods.js (98%) rename web/linker/{ => shell}/workflow_state_methods.js (97%) rename web/linker/{ => shell}/workflow_update_methods.js (94%) rename web/linker/{ => utils}/render_format_methods.js (96%) rename web/linker/{ => views}/missing_browser_methods.js (99%) rename web/linker/{ => views}/model_info_methods.js (99%) rename web/linker/{ => views}/options_methods.js (99%) rename web/linker/{ => views}/tabs_loaded_methods.js (98%) diff --git a/web/linker/queue_methods.js b/web/linker/actions/queue_methods.js similarity index 99% rename from web/linker/queue_methods.js rename to web/linker/actions/queue_methods.js index 1b1c3ea..c92d79e 100644 --- a/web/linker/queue_methods.js +++ b/web/linker/actions/queue_methods.js @@ -1,7 +1,7 @@ -import { app } from "../../../../scripts/app.js"; -import { api } from "../../../../scripts/api.js"; -import { $el } from "../../../../scripts/ui.js"; -import { getSvgIcon } from "../utils/icon_utils.js"; +import { app } from "../../../../../scripts/app.js"; +import { api } from "../../../../../scripts/api.js"; +import { $el } from "../../../../../scripts/ui.js"; +import { getSvgIcon } from "../../utils/icon_utils.js"; export const queueMethods = { createContent() { // Wrap the body in a two-column layout: left = items, right = queued panel diff --git a/web/linker/resolve_download_methods.js b/web/linker/actions/resolve_download_methods.js similarity index 99% rename from web/linker/resolve_download_methods.js rename to web/linker/actions/resolve_download_methods.js index d4f392f..fade45b 100644 --- a/web/linker/resolve_download_methods.js +++ b/web/linker/actions/resolve_download_methods.js @@ -1,7 +1,7 @@ -import { app } from "../../../../scripts/app.js"; -import { api } from "../../../../scripts/api.js"; -import { $el } from "../../../../scripts/ui.js"; -import { getSvgIcon } from "../utils/icon_utils.js"; +import { app } from "../../../../../scripts/app.js"; +import { api } from "../../../../../scripts/api.js"; +import { $el } from "../../../../../scripts/ui.js"; +import { getSvgIcon } from "../../utils/icon_utils.js"; export const resolveDownloadMethods = { /** * Resolve a model - resolves ALL nodes that reference this model diff --git a/web/linker/selection_methods.js b/web/linker/actions/selection_methods.js similarity index 97% rename from web/linker/selection_methods.js rename to web/linker/actions/selection_methods.js index 6d19df6..6e9d4d4 100644 --- a/web/linker/selection_methods.js +++ b/web/linker/actions/selection_methods.js @@ -1,7 +1,7 @@ -import { app } from "../../../../scripts/app.js"; -import { api } from "../../../../scripts/api.js"; -import { $el } from "../../../../scripts/ui.js"; -import { getSvgIcon } from "../utils/icon_utils.js"; +import { app } from "../../../../../scripts/app.js"; +import { api } from "../../../../../scripts/api.js"; +import { $el } from "../../../../../scripts/ui.js"; +import { getSvgIcon } from "../../utils/icon_utils.js"; export const selectionMethods = { /** * Handle clicks outside the dialog diff --git a/web/linker/linker_dialog.js b/web/linker/linker_dialog.js index 5eab3d7..7bf9570 100644 --- a/web/linker/linker_dialog.js +++ b/web/linker/linker_dialog.js @@ -1,18 +1,18 @@ import { $el, ComfyDialog } from "../../../../scripts/ui.js"; -import { searchPanelMethods } from "./search_panel.js"; -import { modelInfoMethods } from "./model_info_methods.js"; -import { renderFormatMethods } from "./render_format_methods.js"; -import { workflowStateMethods } from "./workflow_state_methods.js"; -import { selectionMethods } from "./selection_methods.js"; -import { dialogShellMethods } from "./dialog_shell_methods.js"; -import { downloadTargetMethods } from "./download_target_methods.js"; -import { optionsMethods } from "./options_methods.js"; -import { tabsLoadedMethods } from "./tabs_loaded_methods.js"; -import { queueMethods } from "./queue_methods.js"; -import { lifecycleGraphMethods } from "./lifecycle_graph_methods.js"; -import { missingBrowserMethods } from "./missing_browser_methods.js"; -import { resolveDownloadMethods } from "./resolve_download_methods.js"; -import { workflowUpdateMethods } from "./workflow_update_methods.js"; +import { dialogShellMethods } from "./shell/dialog_shell_methods.js"; +import { lifecycleGraphMethods } from "./shell/lifecycle_graph_methods.js"; +import { workflowStateMethods } from "./shell/workflow_state_methods.js"; +import { workflowUpdateMethods } from "./shell/workflow_update_methods.js"; +import { modelInfoMethods } from "./views/model_info_methods.js"; +import { missingBrowserMethods } from "./views/missing_browser_methods.js"; +import { optionsMethods } from "./views/options_methods.js"; +import { tabsLoadedMethods } from "./views/tabs_loaded_methods.js"; +import { downloadTargetMethods } from "./search/download_target_methods.js"; +import { searchPanelMethods } from "./search/search_panel.js"; +import { queueMethods } from "./actions/queue_methods.js"; +import { resolveDownloadMethods } from "./actions/resolve_download_methods.js"; +import { selectionMethods } from "./actions/selection_methods.js"; +import { renderFormatMethods } from "./utils/render_format_methods.js"; export class LinkerManagerDialog extends ComfyDialog { constructor() { super(); diff --git a/web/linker/download_target_methods.js b/web/linker/search/download_target_methods.js similarity index 98% rename from web/linker/download_target_methods.js rename to web/linker/search/download_target_methods.js index 2e78f85..8d68b4a 100644 --- a/web/linker/download_target_methods.js +++ b/web/linker/search/download_target_methods.js @@ -1,7 +1,7 @@ -import { app } from "../../../../scripts/app.js"; -import { api } from "../../../../scripts/api.js"; -import { $el } from "../../../../scripts/ui.js"; -import { getSvgIcon } from "../utils/icon_utils.js"; +import { app } from "../../../../../scripts/app.js"; +import { api } from "../../../../../scripts/api.js"; +import { $el } from "../../../../../scripts/ui.js"; +import { getSvgIcon } from "../../utils/icon_utils.js"; export const downloadTargetMethods = { /** * Ensure all models are loaded for the dropdown. diff --git a/web/linker/search_panel.js b/web/linker/search/search_panel.js similarity index 99% rename from web/linker/search_panel.js rename to web/linker/search/search_panel.js index a14e7a0..504d0e2 100644 --- a/web/linker/search_panel.js +++ b/web/linker/search/search_panel.js @@ -1,7 +1,7 @@ -import { app } from "../../../../scripts/app.js"; -import { api } from "../../../../scripts/api.js"; -import { $el } from "../../../../scripts/ui.js"; -import { getSvgIcon } from "../utils/icon_utils.js"; +import { app } from "../../../../../scripts/app.js"; +import { api } from "../../../../../scripts/api.js"; +import { $el } from "../../../../../scripts/ui.js"; +import { getSvgIcon } from "../../utils/icon_utils.js"; export const searchPanelMethods = { /** * Build stable cache key for a missing model entry diff --git a/web/linker/dialog_shell_methods.js b/web/linker/shell/dialog_shell_methods.js similarity index 99% rename from web/linker/dialog_shell_methods.js rename to web/linker/shell/dialog_shell_methods.js index 6a161e1..553d01b 100644 --- a/web/linker/dialog_shell_methods.js +++ b/web/linker/shell/dialog_shell_methods.js @@ -1,7 +1,7 @@ -import { app } from "../../../../scripts/app.js"; -import { api } from "../../../../scripts/api.js"; -import { $el } from "../../../../scripts/ui.js"; -import { getSvgIcon } from "../utils/icon_utils.js"; +import { app } from "../../../../../scripts/app.js"; +import { api } from "../../../../../scripts/api.js"; +import { $el } from "../../../../../scripts/ui.js"; +import { getSvgIcon } from "../../utils/icon_utils.js"; export const dialogShellMethods = { createHeader() { // Create tabs diff --git a/web/linker/lifecycle_graph_methods.js b/web/linker/shell/lifecycle_graph_methods.js similarity index 98% rename from web/linker/lifecycle_graph_methods.js rename to web/linker/shell/lifecycle_graph_methods.js index 1552ee7..78fdc48 100644 --- a/web/linker/lifecycle_graph_methods.js +++ b/web/linker/shell/lifecycle_graph_methods.js @@ -1,7 +1,7 @@ -import { app } from "../../../../scripts/app.js"; -import { api } from "../../../../scripts/api.js"; -import { $el } from "../../../../scripts/ui.js"; -import { getSvgIcon } from "../utils/icon_utils.js"; +import { app } from "../../../../../scripts/app.js"; +import { api } from "../../../../../scripts/api.js"; +import { $el } from "../../../../../scripts/ui.js"; +import { getSvgIcon } from "../../utils/icon_utils.js"; export const lifecycleGraphMethods = { async show(workflow = null) { this.undockToFloating({ persist: false }); diff --git a/web/linker/workflow_state_methods.js b/web/linker/shell/workflow_state_methods.js similarity index 97% rename from web/linker/workflow_state_methods.js rename to web/linker/shell/workflow_state_methods.js index dcbd8e3..2bf9aab 100644 --- a/web/linker/workflow_state_methods.js +++ b/web/linker/shell/workflow_state_methods.js @@ -1,7 +1,7 @@ -import { app } from "../../../../scripts/app.js"; -import { api } from "../../../../scripts/api.js"; -import { $el } from "../../../../scripts/ui.js"; -import { getSvgIcon } from "../utils/icon_utils.js"; +import { app } from "../../../../../scripts/app.js"; +import { api } from "../../../../../scripts/api.js"; +import { $el } from "../../../../../scripts/ui.js"; +import { getSvgIcon } from "../../utils/icon_utils.js"; export const workflowStateMethods = { getWorkflowSignature(workflow) { if (!workflow) return null; diff --git a/web/linker/workflow_update_methods.js b/web/linker/shell/workflow_update_methods.js similarity index 94% rename from web/linker/workflow_update_methods.js rename to web/linker/shell/workflow_update_methods.js index 08cf84f..0e7e6f2 100644 --- a/web/linker/workflow_update_methods.js +++ b/web/linker/shell/workflow_update_methods.js @@ -1,7 +1,7 @@ -import { app } from "../../../../scripts/app.js"; -import { api } from "../../../../scripts/api.js"; -import { $el } from "../../../../scripts/ui.js"; -import { getSvgIcon } from "../utils/icon_utils.js"; +import { app } from "../../../../../scripts/app.js"; +import { api } from "../../../../../scripts/api.js"; +import { $el } from "../../../../../scripts/ui.js"; +import { getSvgIcon } from "../../utils/icon_utils.js"; export const workflowUpdateMethods = { /** * Extract model page URL from a download URL diff --git a/web/linker/render_format_methods.js b/web/linker/utils/render_format_methods.js similarity index 96% rename from web/linker/render_format_methods.js rename to web/linker/utils/render_format_methods.js index c4205b4..23926e3 100644 --- a/web/linker/render_format_methods.js +++ b/web/linker/utils/render_format_methods.js @@ -1,7 +1,7 @@ -import { app } from "../../../../scripts/app.js"; -import { api } from "../../../../scripts/api.js"; -import { $el } from "../../../../scripts/ui.js"; -import { getSvgIcon } from "../utils/icon_utils.js"; +import { app } from "../../../../../scripts/app.js"; +import { api } from "../../../../../scripts/api.js"; +import { $el } from "../../../../../scripts/ui.js"; +import { getSvgIcon } from "../../utils/icon_utils.js"; export const renderFormatMethods = { /** * Get a colored confidence badge HTML diff --git a/web/linker/missing_browser_methods.js b/web/linker/views/missing_browser_methods.js similarity index 99% rename from web/linker/missing_browser_methods.js rename to web/linker/views/missing_browser_methods.js index 3fca6dc..c67fdaa 100644 --- a/web/linker/missing_browser_methods.js +++ b/web/linker/views/missing_browser_methods.js @@ -1,7 +1,7 @@ -import { app } from "../../../../scripts/app.js"; -import { api } from "../../../../scripts/api.js"; -import { $el } from "../../../../scripts/ui.js"; -import { getSvgIcon } from "../utils/icon_utils.js"; +import { app } from "../../../../../scripts/app.js"; +import { api } from "../../../../../scripts/api.js"; +import { $el } from "../../../../../scripts/ui.js"; +import { getSvgIcon } from "../../utils/icon_utils.js"; export const missingBrowserMethods = { getMissingFilename(missing = {}) { return missing.original_path?.split('/').pop()?.split('\\').pop() || missing.name || 'Missing model'; diff --git a/web/linker/model_info_methods.js b/web/linker/views/model_info_methods.js similarity index 99% rename from web/linker/model_info_methods.js rename to web/linker/views/model_info_methods.js index bc3a2c1..763c4c8 100644 --- a/web/linker/model_info_methods.js +++ b/web/linker/views/model_info_methods.js @@ -1,7 +1,7 @@ -import { app } from "../../../../scripts/app.js"; -import { api } from "../../../../scripts/api.js"; -import { $el } from "../../../../scripts/ui.js"; -import { getSvgIcon } from "../utils/icon_utils.js"; +import { app } from "../../../../../scripts/app.js"; +import { api } from "../../../../../scripts/api.js"; +import { $el } from "../../../../../scripts/ui.js"; +import { getSvgIcon } from "../../utils/icon_utils.js"; export const modelInfoMethods = { /** * Handle click outside context menu to hide it diff --git a/web/linker/options_methods.js b/web/linker/views/options_methods.js similarity index 99% rename from web/linker/options_methods.js rename to web/linker/views/options_methods.js index a32eabd..ed46e19 100644 --- a/web/linker/options_methods.js +++ b/web/linker/views/options_methods.js @@ -1,7 +1,7 @@ -import { app } from "../../../../scripts/app.js"; -import { api } from "../../../../scripts/api.js"; -import { $el } from "../../../../scripts/ui.js"; -import { getSvgIcon } from "../utils/icon_utils.js"; +import { app } from "../../../../../scripts/app.js"; +import { api } from "../../../../../scripts/api.js"; +import { $el } from "../../../../../scripts/ui.js"; +import { getSvgIcon } from "../../utils/icon_utils.js"; export const optionsMethods = { displayOptions() { if (!this.contentElement) return; diff --git a/web/linker/tabs_loaded_methods.js b/web/linker/views/tabs_loaded_methods.js similarity index 98% rename from web/linker/tabs_loaded_methods.js rename to web/linker/views/tabs_loaded_methods.js index 5d7d40e..fd9ec86 100644 --- a/web/linker/tabs_loaded_methods.js +++ b/web/linker/views/tabs_loaded_methods.js @@ -1,7 +1,7 @@ -import { app } from "../../../../scripts/app.js"; -import { api } from "../../../../scripts/api.js"; -import { $el } from "../../../../scripts/ui.js"; -import { getSvgIcon } from "../utils/icon_utils.js"; +import { app } from "../../../../../scripts/app.js"; +import { api } from "../../../../../scripts/api.js"; +import { $el } from "../../../../../scripts/ui.js"; +import { getSvgIcon } from "../../utils/icon_utils.js"; export const tabsLoadedMethods = { getTabButton(tab) { return {