-
Notifications
You must be signed in to change notification settings - Fork 490
Road to No Explicit Any Part 6: Composables and Extensions #8083
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
9ce1a60
fix(saveMesh): type onExecuted callback with NodeExecutionOutput
Myestery d332695
fix(uploadAudio): type onExecuted and onNodeOutputsUpdated with prope…
Myestery ac6e51f
fix(composables): type config casts in useLoad3dViewer.ts
Myestery 752d33a
fix(composables): type node param as LGraphNode in useImageMenuOption…
Myestery a30d809
fix(composables): type messages array in useJobMenu.ts
Myestery a71fda2
fix(composables): type useResultGallery with generics
Myestery b7db9da
fix(composables): type extraInfo in useContextMenuTranslation.ts
Myestery 9f7da8d
fix(composables): type taskRef as TaskItemImpl and update test mocks
Myestery f58d9c5
fix(composables): type error catch and index signature without any
Myestery 8c3e80c
feat(api): add NodeOutputWith generic helper for typed passthrough pr…
Myestery 217b679
fix(tests): simplify mock types in JobGroupsList.test.ts
Myestery a11e026
Refactor: refine `taskRef` type assertion in job menu test helper.
Myestery File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -117,13 +117,24 @@ vi.mock('@/utils/formatUtil', () => ({ | |||||||||||||||||||||||
| })) | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| import { useJobMenu } from '@/composables/queue/useJobMenu' | ||||||||||||||||||||||||
| import type { TaskItemImpl } from '@/stores/queueStore' | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| const createJobItem = (overrides: Partial<JobListItem> = {}): JobListItem => ({ | ||||||||||||||||||||||||
| type MockTaskRef = Record<string, unknown> | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| type TestJobListItem = Omit<JobListItem, 'taskRef'> & { | ||||||||||||||||||||||||
| taskRef?: MockTaskRef | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| const createJobItem = ( | ||||||||||||||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
This one is a good big gnarlier and potentially out of scope for |
||||||||||||||||||||||||
| overrides: Partial<TestJobListItem> = {} | ||||||||||||||||||||||||
| ): JobListItem => ({ | ||||||||||||||||||||||||
| id: overrides.id ?? 'job-1', | ||||||||||||||||||||||||
| title: overrides.title ?? 'Test job', | ||||||||||||||||||||||||
| meta: overrides.meta ?? 'meta', | ||||||||||||||||||||||||
| state: overrides.state ?? 'completed', | ||||||||||||||||||||||||
| taskRef: overrides.taskRef, | ||||||||||||||||||||||||
| taskRef: overrides.taskRef as Partial<TaskItemImpl> | undefined as | ||||||||||||||||||||||||
| | TaskItemImpl | ||||||||||||||||||||||||
| | undefined, | ||||||||||||||||||||||||
| iconName: overrides.iconName, | ||||||||||||||||||||||||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||
| iconImageUrl: overrides.iconImageUrl, | ||||||||||||||||||||||||
| showClear: overrides.showClear, | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick | 🔵 Trivial
Consider explicit partial type acknowledgment for the mock.
The minimal mock object
{ workflow: { id: 'workflow-id' } }only implements a subset ofTaskItemImpl. Per repository learnings, usingas Partial<TaskItemImpl> as TaskItemImplmakes the incomplete implementation explicit while maintaining type safety.🔧 Suggested improvement
Based on learnings, this pattern explicitly acknowledges that the mock doesn't fully implement the interface.
📝 Committable suggestion
🤖 Prompt for AI Agents