Commit Graph

6432 Commits

Author SHA1 Message Date
Johnpaul
a6af53ff29 refactor: remove any types from SubgraphNode.titleButton.test.ts
- Define MockPointerEvent interface for canvas events
- Import CanvasPointerEvent type from events module
- Replace 3 'as any' casts with proper typed interface and double-cast
2026-01-21 21:08:59 +01:00
Johnpaul
7d16f0c9f6 refactor: remove any types from LinkConnectorSubgraphInputValidation.test.ts
- Define MockPointerEvent interface for canvas pointer events
- Define MockRenderLink interface for partial render link mocks
- Import CanvasPointerEvent type from events module
- Replace 3 'as any' casts with proper typed interfaces and double-cast
2026-01-21 21:07:00 +01:00
Johnpaul
72ed73dead refactor: remove any types from LGraphNode.test.ts
- Define NodeConstructorWithSlotOffset interface for constructor with optional slot_start_y
- Replace 3 'as any' casts with proper double-cast pattern
- All instances related to dynamic slot_start_y property on node constructor
2026-01-21 21:03:29 +01:00
Johnpaul
6219bb54af test: remove any from useNodePricing.test.ts (3 instances)
- Define MockNodeInput interface for test inputs
- Replace widgets value: any with unknown
- Replace const node: any with proper object and double-cast to LGraphNode
- Add explicit return type boolean to isInputConnected
2026-01-21 20:53:00 +01:00
GitHub Action
2381cb9810 [automated] Apply ESLint and Oxfmt fixes 2026-01-21 19:01:16 +00:00
Johnpaul
ce3985fb11 test: remove any from ColorPickerButton.test.ts (3 instances)
- Replace activeWorkflow mock with LoadedComfyWorkflow type and double-cast
- Replace selectedItems mocks with Positionable type and double-cast
- Import Mock type from vitest for checkState mock
2026-01-21 19:58:49 +01:00
Johnpaul
8574af95ea test: remove any from litegraphUtil.test.ts
- Replace widgetValues: any[] with unknown[]
2026-01-21 19:14:55 +01:00
Johnpaul
092e08df26 test: remove any from newUserService.test.ts
- Define MockSettingStore interface with proper Mock types
- Create mockSettingStoreTyped with double-cast to useSettingStore return type
- Replace all mockSettingStore usages in initializeIfNewUser calls
- Import useSettingStore type from correct path
2026-01-21 18:55:07 +01:00
Johnpaul
1e2aac04e1 test: remove any from nodeOrganizationService.test.ts
- Replace overrides: any with Record<string, unknown> in createMockNodeDef
- Replace 'unknown' as any with double-cast to NodeSourceType
2026-01-21 18:49:10 +01:00
Johnpaul
f4934bf127 test: remove mockSearchClient any from algoliaSearchProvider.test.ts
- Define MockSearchClient interface with search: Mock property
- Replace mockSearchClient: any with MockSearchClient type
- Apply double-cast when setting up mock return value
- Note: File still has other any instances for global properties and test casts
2026-01-21 18:47:50 +01:00
Johnpaul
08fc8131f6 test: remove any from textUtils.test.ts
- Replace (ctx.measureText as any) with (ctx.measureText as Mock)
- Import Mock type from vitest
2026-01-21 14:00:56 +01:00
Johnpaul
e340f028f0 test: remove any from SubgraphWidgetPromotion.test.ts
- Replace widgetValue: any with unknown in createNodeWithWidget helper
2026-01-21 12:48:07 +01:00
Johnpaul
b7f2359097 test: remove any from SubgraphSlotVisualFeedback.test.ts
- Replace mockColorContext: any with proper MockColorContext interface
- Apply double-cast at draw() call sites to satisfy DefaultConnectionColors type
- Pattern: colorContext: mockColorContext as unknown as DefaultConnectionColors
2026-01-21 03:04:43 +01:00
Johnpaul
ad52e29562 test: Remove unnecessary assertion from shared.test.ts. 2026-01-21 02:55:19 +01:00
Johnpaul
f570b397a5 test: remove any type from BaseThumbnail test component instance
- Replace `wrapper.vm as any` with properly typed ComponentInstance
- Define ComponentInstance type with error property
- Improve type safety for internal state access in tests

Part of Phase 2 - Quick wins (1 instance removed)
2026-01-21 02:50:24 +01:00
Johnpaul
ca4fe3fd69 test: remove any type from UsageLogsTable test ComponentInstance
- Replace `events: any[]` with properly typed `MockEvent[]`
- Define MockEvent interface matching the test data structure
- Improve type safety for event testing

Part of Phase 2 - Quick wins (1 instance removed)
2026-01-21 02:45:44 +01:00
Johnpaul
ab1a19bcee test: remove any type from ApiKeyForm test mountComponent helper
- Replace `props: any` with ComponentProps<typeof ApiKeyForm>
- Import ComponentProps from vue-component-type-helpers
- Linter optimized to direct ComponentProps usage

Part of Phase 2 - Quick wins (1 instance removed)
2026-01-21 02:43:54 +01:00
Johnpaul
88fb21194f test: remove any type from SettingItem test mountComponent helper
- Replace `props: any` and return type with proper types
- Use Record<string, unknown> with ComponentProps cast
- Refactor tests to check FormItem component props instead of internal state
- Import ComponentProps from vue-component-type-helpers

Part of Phase 2 - Quick wins (1 instance removed)
2026-01-21 02:41:31 +01:00
Johnpaul
892b29b694 Merge remote-tracking branch 'origin/main' into fix/remove-any-types-part8 2026-01-21 02:25:22 +01:00
Johnpaul
4200c36a26 test: remove any type from UserAvatar test mountComponent helper
- Replace `props: any` with `Record<string, unknown>`
- Use ComponentProps type assertion for type safety
- Import ComponentProps from vue-component-type-helpers

Part of Phase 2 - Quick wins (1 instance removed)
2026-01-21 02:24:44 +01:00
Johnpaul
f31ca7932a test: remove any type from BaseTerminal test mock access
- Replace `as any` with proper `Mock` type from vitest
- Import Mock type and access mock.calls with type safety
- Explicitly type selectionCallback as `() => void`
- Break down mock access into steps for clarity

Part of Phase 2 - Quick wins (1 instance removed)
2026-01-21 02:21:13 +01:00
Johnpaul
96aa53e5a6 test: remove any type from UrlInput test mountComponent helper
- Replace `props: any` with `Record<string, unknown>`
- Use ComponentProps type assertion for type safety
- Refactor tests to check input.element.value instead of internal state
- This tests actual DOM behavior rather than implementation details

Part of Phase 2 - Quick wins (1 instance removed)
2026-01-21 02:02:27 +01:00
Johnpaul
755ad206df test: remove explicit any type from FormRadioGroup.test.ts
Replaced any with Record<string, unknown> for mountComponent props parameter.
Uses as unknown as cast to allow testing edge cases with invalid prop types.

All tests passing (11/11), 0 typecheck errors.

Part of #8092
2026-01-21 01:55:29 +01:00
Johnpaul
c72e6ce520 test: remove explicit any types from useSelectionState.test.ts
Removed all 14 any types from Pinia store mocks.

Changes:
- Replaced as any with as unknown as ReturnType<typeof store> pattern
- Removed as any from $state and _p properties (empty objects)

All tests passing (6/6), 0 typecheck errors.

Part of #8092
2026-01-21 01:50:48 +01:00
Alexander Brown
b1dfbfaa09 chore: Replace prettier with oxfmt (#8177)
Configure oxfmt ignorePatterns to exclude non-JS/TS files (md, json,
css, yaml, etc.) to match previous Prettier behavior.

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-8177-chore-configure-oxfmt-to-format-only-JS-TS-Vue-files-2ee6d73d3650815080f3cc8a4a932109)
by [Unito](https://www.unito.io)

---------

Co-authored-by: Amp <amp@ampcode.com>
2026-01-20 16:44:08 -08:00
Johnpaul
3a0ee293ea test: remove explicit any type from useSelectedLiteGraphItems.test.ts
Replaced any with proper type for mockCanvas.

Changes:
- Typed mockCanvas as { selectedItems: Set<Positionable> }
- Added as unknown as Positionable casts for MockNode instances
- Added as unknown as cast for getCanvas mock return value

All tests passing (18/18), 0 typecheck errors.

Part of #8092
2026-01-21 01:40:39 +01:00
Johnpaul
2bd5dea728 test: remove explicit any types from useGraphHierarchy.test.ts
Removed all 3 any types and replaced with proper TypeScript types.

Changes:
- Replaced as any with as unknown as for partial mockCanvasStore
- Removed as any from null assignments (TypeScript infers correctly)

All tests passing (7/7), 0 typecheck errors.

Part of #8092
2026-01-21 01:21:05 +01:00
Johnpaul
0fb836b294 test: remove explicit any types from useFeatureFlags.test.ts
Removed all 7 any types by removing unnecessary type assertions.

TypeScript can infer return types correctly for mockImplementation
callbacks returning literal values.

All tests passing (8/8), 0 typecheck errors.

Part of #8092
2026-01-21 01:18:04 +01:00
Johnpaul
86cf60cb6c test: remove explicit any types from useCoreCommands.test.ts
Removed all 3 any types and replaced with proper TypeScript types.

Changes:
- Replaced as any with Partial<ReturnType<typeof useSettingStore>>
- Used as unknown as for partial mock subgraph (114+ missing properties)

All tests passing (3/3), 0 typecheck errors.

Part of #8092
2026-01-21 01:15:34 +01:00
Simula_r
e6ef99e92c feat: add isCloud guard to team workspaces feature flag (#8192)
Ensures the team_workspaces_enabled feature flag only returns true when
running in cloud environment, preventing the feature from activating in
local/desktop installations.

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-8192-feat-add-isCloud-guard-to-team-workspaces-feature-flag-2ee6d73d3650810bb1d7c1721ebcdd44)
by [Unito](https://www.unito.io)

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: GitHub Action <action@github.com>
2026-01-20 16:13:54 -08:00
Christian Byrne
f5a784e561 fix: add plurilization to node pack count in custom node manager dialog (#8191) 2026-01-21 08:52:40 +09:00
Christian Byrne
e8b45204f2 feat(panel): add collapsible Advanced Inputs section for widgets marked advanced (#8146)
Adds a collapsible 'Advanced Inputs' section to the right-side panel
that displays widgets marked with `options.advanced = true`.

<img width="1903" height="875" alt="image"
src="https://github.com/user-attachments/assets/5f76e680-7904-4c43-b42b-1b98f8f78458"
/>


## Changes
- Filters normal widgets to exclude advanced ones
- Adds new `advancedWidgetsSectionDataList` computed for advanced
widgets
- Renders a collapsible section (collapsed by default) for advanced
widgets

## Related
- Backend PR that adds `advanced` flag: comfyanonymous/ComfyUI#11939

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-8146-feat-panel-add-collapsible-Advanced-Inputs-section-for-widgets-marked-advanced-2ec6d73d36508120af1af27110a6fb96)
by [Unito](https://www.unito.io)

---------

Co-authored-by: GitHub Action <action@github.com>
Co-authored-by: Rizumu Ayaka <rizumu@ayaka.moe>
2026-01-20 15:22:25 -07:00
Christian Byrne
5df793b721 feat: add feature usage tracker for nightly surveys (#8175)
Introduces `useFeatureUsageTracker` composable that tracks how many
times a user has used a specific feature, along with first and last
usage timestamps. Data persists to localStorage using `@vueuse/core`'s
`useStorage`. This composable provides the foundation for triggering
surveys after a configurable number of feature uses. Includes
comprehensive unit tests.

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-8175-feat-add-feature-usage-tracker-for-nightly-surveys-2ee6d73d36508118859ece6fcf17561d)
by [Unito](https://www.unito.io)
2026-01-20 14:35:54 -07:00
AustinMroz
79d3b2c291 Fix properties context menu (#8188)
A tiny fix for a regression introduced in #7817 that prevented changing
a node's properties through the litegraph context menu.
<img width="838" height="568" alt="image"
src="https://github.com/user-attachments/assets/a73e8da4-f5ff-4e65-8003-55883f8d08be"
/>

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-8188-Fix-properties-context-menu-2ee6d73d365081ba8844dd3c8d74432d)
by [Unito](https://www.unito.io)
2026-01-20 13:31:56 -08:00
Jin Yi
916c1248e3 [bugfix] Fix search bar height alignment in MediaAssetFilterBar (#8171) 2026-01-21 06:10:31 +09:00
Johnpaul
17bab4d413 test: remove explicit any types from useBrowserTabTitle.test.ts
Removed all 11 any types and replaced with proper TypeScript types.

Changes:
- Typed executionStore mock with proper structure
- Typed workflowStore.activeWorkflow based on actual usage
- Replaced (settingStore.get as any) with vi.mocked(settingStore.get)
- Fixed vi.fn() signature to accept key parameter

All tests passing (8/9, 1 skipped), 0 typecheck errors.

Part of #8092
2026-01-20 21:00:21 +01:00
Jin Yi
b5f91977c8 [bugfix] Add spacing between action buttons in node library sidebar (#8172) 2026-01-20 14:48:44 +09:00
Christian Byrne
a8b4928acc feat(canvas): show 'Show Advanced' button on nodes with advanced widgets (#8148)
Extends the existing 'Show Advanced' button (previously subgraph-only)
to also appear on regular nodes that have widgets marked with
`options.advanced = true`.

## Changes
- Updates `showAdvancedInputsButton` computed to check for advanced
widgets on regular nodes
- Updates `handleShowAdvancedInputs` to set `node.showAdvanced = true`
and trigger canvas redraw for regular nodes

## Related
- Backend PR that adds `advanced` flag: comfyanonymous/ComfyUI#11939
- Canvas hide PR: feat/advanced-widgets-canvas-hide (this PR provides
the toggle for that)

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-8148-feat-canvas-show-Show-Advanced-button-on-nodes-with-advanced-widgets-2ec6d73d36508155a8adfa0a8ec84d46)
by [Unito](https://www.unito.io)
2026-01-19 21:57:08 -07:00
AustinMroz
7f25280da4 Fix padding, color, and move to reka-ui popover (#8164)
- Fixes some options, like decrement, being off center
- Fixes button being very hard to see on light themes
- Moves the popover to use our fancy new reka-ui Popover component
instead of primvue
- Since the display control is no longer in the ValueControlPopover,
loading is now actually async
 
Most changed lines in `ValueControlPopover` are just indentation.

| Before | After |
| ------ | ----- |
| <img width="360" alt="before"
src="https://github.com/user-attachments/assets/5867d70c-a606-4092-a5f8-dd18ecda5b6f"
/> | <img width="360" alt="after"
src="https://github.com/user-attachments/assets/7bbaf036-77da-4c98-acb0-4b142e4a4761"
/>|

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-8164-Fix-padding-color-and-move-to-reka-ui-popover-2ed6d73d3650817ea314f04699f1387f)
by [Unito](https://www.unito.io)

---------

Co-authored-by: github-actions <github-actions@github.com>
2026-01-19 19:32:40 -08:00
Christian Byrne
4bf9b94cd4 feat: add isNightly build flag for nightly-only features (#8149)
## Summary

Adds a compile-time `__IS_NIGHTLY__` constant that detects whether the
build is from the main branch (nightly) or a core/* branch (RC/stable).
The detection logic in vite.config.mts auto-detects based on
`GITHUB_REF_NAME === 'main'` in CI, with explicit override support via
`IS_NIGHTLY` environment variable. Exports `isNightly` from
`src/platform/distribution/types.ts` for use throughout the codebase.
Includes unit tests for the detection logic.

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-8149-feat-add-isNightly-build-flag-for-nightly-only-features-2ec6d73d365081c09930edec1c6644f5)
by [Unito](https://www.unito.io)
2026-01-19 20:22:46 -07:00
Terry Jia
a2246cce7a remove mouse event (#8162)
## Summary

replace https://github.com/Comfy-Org/ComfyUI_frontend/pull/7963, fix on
kjnodes instead https://github.com/kijai/ComfyUI-KJNodes/pull/514

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-8162-remove-mouse-event-2ed6d73d365081999a5df76eabdfb89f)
by [Unito](https://www.unito.io)

Co-authored-by: Alexander Brown <drjkl@comfy.org>
2026-01-19 20:11:56 -07:00
Comfy Org PR Bot
d73e8e4aa3 1.38.7 (#8167)
Patch version increment to 1.38.7

**Base branch:** `main`

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-8167-1-38-7-2ee6d73d36508115b97ac02d77c8646d)
by [Unito](https://www.unito.io)

Co-authored-by: christian-byrne <72887196+christian-byrne@users.noreply.github.com>
Co-authored-by: Alexander Brown <drjkl@comfy.org>
v1.38.7
2026-01-19 17:26:03 -08:00
Johnpaul
738b86ef16 Merge origin/main into fix/remove-any-types-part8 2026-01-20 02:12:08 +01:00
Johnpaul
4ca076fdf7 test: remove explicit any types from useCachedRequest.test.ts
Replaced all 3 any types with unknown for generic request parameters.

All tests passing (11/11), 0 typecheck errors.

Part of #8092
2026-01-20 02:07:22 +01:00
Johnpaul
720069f146 test: remove explicit any type from useLoad3dDrag.test.ts
Replaced any with ReturnType<typeof useToastStore> for mockToastStore.

All tests passing (13/13), 0 typecheck errors.

Part of #8092
2026-01-20 02:03:18 +01:00
Johnpaul
b4870c13f9 test: remove explicit any types from useLoad3dViewer.test.ts
Removed all 5 any types and replaced with proper TypeScript types.

Changes:
- Replaced any with Partial<Load3d> for mock objects
- Used ReturnType<typeof useLoad3dService> for service mocks
- Used ReturnType<typeof useToastStore> for store mocks
- Used Load3d['sceneManager'] etc. for nested manager types
- Minimized type assertions to 2 necessary as unknown casts

Remaining type assertions:
- mockNode: Partial LGraphNode mock (constructor incompatible)
- sceneManager: Simplified gridHelper mock (vs 82+ Three.js properties)

Both mocks accurately reflect implementation usage patterns.

All tests passing (33/33), 0 typecheck errors.

Part of #8092
2026-01-20 02:01:41 +01:00
Johnpaul
b4c4ea103a test: remove any types from useJobMenu.test.ts
Replace all 8 `any` types with proper TypeScript types:
- Use proper function signatures in mock definitions
- Use JobListItem['state'] for state type assertion
- Use Partial<TaskItemImpl> for partial task mocks
- Use typed parameters for all mock functions (downloadFile, copyToClipboard, interrupt, deleteItem, etc.)
- Use Record<string, { id: string }> for nodeDefsByName
- Handle optional parameters correctly in downloadFile mock

All 36 tests passing, 0 typecheck errors.
2026-01-20 01:46:46 +01:00
Johnpaul Chiwetelu
7ef4ea6f25 Road to No Explicit Any Part 7: Scripts and Dialog Cleanup (#8092)
## Summary

Continues the TypeScript strict typing improvements by removing `any`
types from core scripts and dialog components.

### Changes

**api.ts (6 instances)**
- Define `V1RawPrompt` and `CloudRawPrompt` tuple types for queue prompt
formats
- Export `QueueIndex`, `PromptInputs`, `ExtraData`, `OutputsToExecute`
from apiSchema
- Type `#postItem` body, `storeUserData` data, and `getCustomNodesI18n`
return

**groupNodeManage.ts (all @ts-expect-error removed)**
- Add `GroupNodeConfigEntry` interface to LGraph.ts
- Extend `GroupNodeWorkflowData` with `title`, `widgets_values`, and
typed `config`
- Type all class properties with definite assignment assertions
- Type all method parameters and event handlers
- Fix save button callback with proper generic types for node ordering

**changeTracker.ts (4 instances)**
- Type `nodeOutputs` as `Record<string, ExecutedWsMessage['output']>`
- Type prompt callback with `CanvasPointerEvent` and proper value types

**asyncDialog.ts and dialog.ts**
- Make `ComfyAsyncDialog` generic with `DialogAction<T>` type
- Type `ComfyDialog` constructor and show method parameters
- Update `ManageGroupDialog.show` signature to match base class

## Test plan
- [x] `pnpm typecheck` passes
- [x] `pnpm lint` passes
- [x] Sourcegraph checks for external usage

---
Related: Continues from #8083

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-8092-Road-to-No-Explicit-Any-Part-7-Scripts-and-Dialog-Cleanup-2ea6d73d365081fbb890e73646a6ad16)
by [Unito](https://www.unito.io)
2026-01-20 00:41:40 +00:00
Johnpaul
3cde17587a test: remove any types from useLoad3d.test.ts
Replace all 10 `any` types with proper TypeScript types:
- Use IWidget for widget mocks with correct type properties
- Use Size for onResize handler parameter
- Use CanvasRenderingContext2D for onDrawBackground
- Use CanvasPointerEvent for mouse event handlers
- Use Partial<T> for partial mock objects (Load3d, LGraph, ToastStore)
- Use shallowRef for LGraphNode ref typing
- Replace type hacks (as unknown as never) with proper types

All tests passing, 0 typecheck errors.
2026-01-20 01:40:16 +01:00
Alexander Brown
d5f17f7d9f chore: migrate Vite config to Vite 8 beta (Rolldown) (#8152)
Prepares Vite config for Vite 8 by migrating from esbuild/Rollup to
Rolldown/Oxc.

## Changes
- Migrate `build.rollupOptions` → `build.rolldownOptions`
- Replace `manualChunks` with `codeSplitting.groups`
- Update Storybook config with `strictExecutionOrder` for module loading
compatibility

## Testing
- [x] `pnpm typecheck` passes
- [x] `pnpm build` succeeds
- [x] `pnpm test:unit` passes

---------

Co-authored-by: Amp <amp@ampcode.com>
2026-01-19 16:36:16 -08:00