From 188fafa89a610d2d4c42276ff7d45cb252f032c3 Mon Sep 17 00:00:00 2001 From: Johnpaul Chiwetelu <49923152+Myestery@users.noreply.github.com> Date: Thu, 26 Feb 2026 09:43:14 +0100 Subject: [PATCH] fix: address trivial CodeRabbit issues (#9196) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary Address several trivial CodeRabbit-filed issues: type guard extraction, ESLint globals, curve editor optimizations, and type relocation. ## Changes - **What**: Extract `isSingleImage()` type guard in WidgetImageCompare; add `__DISTRIBUTION__`/`__IS_NIGHTLY__` to ESLint globals and remove stale disable comments; remove unnecessary `toFixed(4)` from curve path generation; optimize `histogramToPath` with array join; move `CurvePoint` type to curve domain - Fixes #9175 - Fixes #8281 - Fixes #9116 - Fixes #9145 - Fixes #9147 ## Review Focus All changes are mechanical/trivial. Curve path output changes from fixed-precision to raw floats — SVG handles both fine. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-9196-fix-address-trivial-CodeRabbit-issues-3126d73d365081f19a5ce20305403098) by [Unito](https://www.unito.io) --- eslint.config.ts | 4 +++- src/App.vue | 1 - src/components/curve/CurveEditor.test.ts | 2 +- src/components/curve/CurveEditor.vue | 3 ++- src/components/curve/WidgetCurve.vue | 2 +- src/components/curve/curveUtils.test.ts | 2 +- src/components/curve/curveUtils.ts | 16 ++++++++-------- src/components/curve/types.ts | 1 + .../widget/WorkflowTemplateSelectorDialog.vue | 1 - src/composables/useCurveEditor.ts | 7 ++++--- src/lib/litegraph/src/types/widgets.ts | 3 +-- .../subscription/components/PricingTable.vue | 1 - .../widgets/components/WidgetImageCompare.vue | 16 +++++++++++----- 13 files changed, 33 insertions(+), 26 deletions(-) create mode 100644 src/components/curve/types.ts diff --git a/eslint.config.ts b/eslint.config.ts index 13068d621d..9f4b83281b 100644 --- a/eslint.config.ts +++ b/eslint.config.ts @@ -22,7 +22,9 @@ const extraFileExtensions = ['.vue'] const commonGlobals = { ...globals.browser, - __COMFYUI_FRONTEND_VERSION__: 'readonly' + __COMFYUI_FRONTEND_VERSION__: 'readonly', + __DISTRIBUTION__: 'readonly', + __IS_NIGHTLY__: 'readonly' } as const const settings = { diff --git a/src/App.vue b/src/App.vue index f9e34fc683..0a7ace0181 100644 --- a/src/App.vue +++ b/src/App.vue @@ -51,7 +51,6 @@ onMounted(() => { // See: https://vite.dev/guide/build#load-error-handling window.addEventListener('vite:preloadError', (event) => { event.preventDefault() - // eslint-disable-next-line no-undef if (__DISTRIBUTION__ === 'cloud') { captureException(event.payload, { tags: { error_type: 'vite_preload_error' } diff --git a/src/components/curve/CurveEditor.test.ts b/src/components/curve/CurveEditor.test.ts index f1cd2462b5..e04eae8329 100644 --- a/src/components/curve/CurveEditor.test.ts +++ b/src/components/curve/CurveEditor.test.ts @@ -1,7 +1,7 @@ import { mount } from '@vue/test-utils' import { describe, expect, it } from 'vitest' -import type { CurvePoint } from '@/lib/litegraph/src/types/widgets' +import type { CurvePoint } from './types' import CurveEditor from './CurveEditor.vue' diff --git a/src/components/curve/CurveEditor.vue b/src/components/curve/CurveEditor.vue index 751d814b4e..85a64bc5b2 100644 --- a/src/components/curve/CurveEditor.vue +++ b/src/components/curve/CurveEditor.vue @@ -77,7 +77,8 @@ import { computed, useTemplateRef } from 'vue' import { useCurveEditor } from '@/composables/useCurveEditor' -import type { CurvePoint } from '@/lib/litegraph/src/types/widgets' + +import type { CurvePoint } from './types' import { histogramToPath } from './curveUtils' diff --git a/src/components/curve/WidgetCurve.vue b/src/components/curve/WidgetCurve.vue index 1617a44b0c..85a16adc64 100644 --- a/src/components/curve/WidgetCurve.vue +++ b/src/components/curve/WidgetCurve.vue @@ -3,7 +3,7 @@