Commit Graph

6446 Commits

Author SHA1 Message Date
Johnpaul
06dbb0fd32 refactor: remove any types from test files (batch 3)
Remove explicit any types from 2 test files:
- firebaseAuthStore.test.ts (10 instances)
- useMinimapSettings.test.ts (10 instances)

Changes:
- Created MockAuth type for firebase auth mocks
- Used UserCredential type for firebase user credential mocks
- Used `ReturnType<typeof func>` to derive proper store types
- Changed Record<string, any> to Record<string, unknown>

All changes pass typecheck and tests.
2026-01-22 00:16:15 +01:00
Johnpaul
94fc1f6e30 refactor: remove any types from test files (batch 2)
Remove explicit any types from 3 test files:
- SubgraphMemory.test.ts (10 instances)
- minimapCanvasRenderer.test.ts (8 instances)
- useImageLoader.test.ts (8 instances)

Changes:
- Created InputWithWidget type for test-specific widget properties
- Used `unknown` type with proper type annotations for mock store properties
- Used `as unknown as T` pattern for mock objects
- Used `ReturnType<typeof func>` for store mock return types

All changes pass typecheck and tests.
2026-01-22 00:08:42 +01:00
Johnpaul
27359f945b refactor: remove any types from test files (batch 1)
Remove explicit any types from 7 test files:
- useWatchWidget.test.ts (3 instances)
- LGraphNodeProperties.test.ts (2 instances)
- versionCompatibilityStore.test.ts (2 instances)
- workflowStore.test.ts (2 instances)
- useRemoteWidget.test.ts (2 instances)
- registrySearchGateway.test.ts (2 instances)
- colorUtil.test.ts (2 instances)

Changes:
- Used `unknown` for truly unknown values instead of `any`
- Used `Partial<T>` with type assertions for mock objects
- Used `ReturnType<typeof func>` to derive proper types
- Used proper typing for promise resolvers and spy mocks
- Used `this: unknown` with proper casting for function contexts

All changes pass typecheck and tests.
2026-01-22 00:02:14 +01:00
Johnpaul
dc9f75c011 refactor: remove any types from useMinimap and firebaseAuthStore tests
- useMinimap.test.ts: Created comprehensive mock interfaces for Node, Graph, Canvas, CanvasElement, ContainerElement, and Context2D
- firebaseAuthStore.test.ts: Imported User type from firebase/auth and created MockUser type for mocking

Part 8 - Phase 5 complete: 2 files fixed, 14 any instances removed (9 + 5)
2026-01-21 23:46:43 +01:00
Johnpaul
20a0ae04cf refactor: remove any types from releaseStore, ExecuteButton, and useManagerQueue tests
- releaseStore.test.ts: Created mock interfaces for ReleaseService, SettingStore, and SystemStatsStore with proper typing
- ExecuteButton.test.ts: Added Mock type interfaces for Canvas, CanvasStore, and CommandStore
- useManagerQueue.test.ts: Fixed Ref types and used correct ManagerPackInstalled schema types

Part 8 - Phase 4 complete: 8 files fixed, 32 any instances removed
2026-01-21 22:40:55 +01:00
Johnpaul
415845a325 refactor: fix normalizeIndustry and normalizeUseCase to accept unknown
- Change parameter types from string to unknown in both functions
- Functions already have type guards (typeof check) to handle invalid inputs
- Remove all 'as any' casts from tests - no longer needed
- Better type safety: functions now properly express they can handle any input
2026-01-21 22:11:11 +01:00
Johnpaul
4014984300 refactor: remove any types from useSettingSearch.test.ts
- Import SettingParams, SettingTreeNode types from settingStore
- Replace mockSettingStore: any with ReturnType<typeof useSettingStore>
- Replace mockSettings: any with properly typed Record<string, SettingParams> with double-cast
- Replace setting: any parameter with SettingParams in getSettingInfo mock
- Replace activeCategory as any with Partial<SettingTreeNode> and proper cast
- Add casts for dynamically assigned mock settings
2026-01-21 21:59:26 +01:00
Johnpaul
d4af46327b refactor: remove any types from algoliaSearchProvider.test.ts
- Define RegistryNodePack type from comfyRegistryTypes
- Create GlobalWithAlgolia interface for global properties
- Replace (global as any) with properly typed (globalThis as unknown as GlobalWithAlgolia)
- Type testPack and incompletePack as Partial<RegistryNodePack>
- Replace as any casts with as RegistryNodePack
2026-01-21 21:55:29 +01:00
Johnpaul
acccd6c3a7 refactor: remove any types from contextMenuCompat.test.ts
- Replace ...args: any[] with proper return type annotations
- Replace (original as any).apply() with original.call()
- Replace (originalGetCanvasMenuOptions as any).apply() with .call()
- Add explicit return type (IContextMenuValue | null)[] to functions
2026-01-21 21:48:30 +01:00
Johnpaul
489af6df76 refactor: remove any types from contextMenuFilter.name.test.ts
- Import IContextMenuValue and LGraphNode types
- Replace ...args: any[] with proper parameter types (none for getCanvasMenuOptions, node: LGraphNode for getNodeMenuOptions)
- Replace (original as any).apply() with original.call() with proper typing
- Add explicit return type annotation for monkey-patched methods
2026-01-21 21:41:03 +01:00
Johnpaul
692528cd12 refactor: remove any types from systemStatsStore.test.ts
- Import SystemStats type from apiSchema
- Replace null as any with proper SystemStats type
- Replace Promise<any> with Promise<SystemStats>
- Replace partial system object cast with SystemStats['system']
- Add necessary cast for empty object in test
2026-01-21 21:24:37 +01:00
Johnpaul
9c3a94ba1a refactor: remove any types from keybindingService.forwarding.test.ts
- Replace dialogStack mock 'as any' with ReturnType<typeof useDialogStore>
- Replace undefined/null assignments with double-cast using typeof saved variables
- All 3 instances now properly typed
2026-01-21 21:20:05 +01:00
Johnpaul
ea52855142 refactor: remove any types from api.featureFlags.test.ts
- Define MockWebSocket interface with proper Mock types
- Replace mockWebSocket: any with MockWebSocket type
- Replace event: any with unknown in event handlers
- Import Mock type from vitest
2026-01-21 21:12:55 +01:00
Johnpaul
c1137c6c8f refactor: remove any types from useTemplateUrlLoader.test.ts
- Update mockQueryParams type to include string[] for Vue Router query params
- Replace params?: any with unknown and inline type assertion
- Remove unnecessary 'as any' casts from array assignments
2026-01-21 21:11:02 +01:00
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