-
Notifications
You must be signed in to change notification settings - Fork 407
Allow Vue nodes to have their colors changed from selection toolbox #5720
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
10 commits
Select commit
Hold shift + click to select a range
7414b94
fix vue node color change
christian-byrne 022e069
[test] add DOM property assertions for Vue node colors - addresses re…
christian-byrne 0491007
[refactor] use LGraphNodeProperties for color property tracking - add…
christian-byrne f0c3f63
[fix] restore headerStyle binding in NodeHeader template
christian-byrne e83ffad
set w-full on node header
christian-byrne 42c130d
[feat] fully replicate LiteGraph drawNode color logic in Vue nodes
christian-byrne 481aa82
handle opacity setting
christian-byrne 8603941
Update test expectations [skip ci]
invalid-email-address 543c656
refactor
christian-byrne de497da
change tests from `fail` to normal (should work now)
christian-byrne 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| import { | ||
| comfyExpect as expect, | ||
| comfyPageFixture as test | ||
| } from '../../../fixtures/ComfyPage' | ||
|
|
||
| test.describe('Vue Node Custom Colors', () => { | ||
| test.beforeEach(async ({ comfyPage }) => { | ||
| await comfyPage.setSetting('Comfy.UseNewMenu', 'Top') | ||
| await comfyPage.setSetting('Comfy.Canvas.SelectionToolbox', true) | ||
| await comfyPage.setSetting('Comfy.VueNodes.Enabled', true) | ||
| await comfyPage.vueNodes.waitForNodes() | ||
| }) | ||
|
|
||
| test('displays color picker button and allows color selection', async ({ | ||
| comfyPage | ||
| }) => { | ||
| const loadCheckpointNode = comfyPage.page.locator('[data-node-id]').filter({ | ||
| hasText: 'Load Checkpoint' | ||
| }) | ||
| await loadCheckpointNode.getByText('Load Checkpoint').click() | ||
|
|
||
| await comfyPage.page.locator('.selection-toolbox .pi-circle-fill').click() | ||
| await comfyPage.page | ||
| .locator('.color-picker-container') | ||
| .locator('i[data-testid="blue"]') | ||
| .click() | ||
|
|
||
| await expect(comfyPage.canvas).toHaveScreenshot( | ||
| 'vue-node-custom-color-blue.png' | ||
| ) | ||
| }) | ||
|
|
||
| test('should load node colors from workflow', async ({ comfyPage }) => { | ||
| await comfyPage.loadWorkflow('nodes/every_node_color') | ||
| await expect(comfyPage.canvas).toHaveScreenshot( | ||
| 'vue-node-custom-colors-dark-all-colors.png' | ||
| ) | ||
| }) | ||
|
|
||
| test('should show brightened node colors on light theme', async ({ | ||
| comfyPage | ||
| }) => { | ||
| await comfyPage.setSetting('Comfy.ColorPalette', 'light') | ||
| await comfyPage.loadWorkflow('nodes/every_node_color') | ||
| await expect(comfyPage.canvas).toHaveScreenshot( | ||
| 'vue-node-custom-colors-light-all-colors.png' | ||
| ) | ||
| }) | ||
| }) | ||
Binary file added
BIN
+91.6 KB
...deStates/colors.spec.ts-snapshots/vue-node-custom-color-blue-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+90.1 KB
...ors.spec.ts-snapshots/vue-node-custom-colors-dark-all-colors-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+90.4 KB
...rs.spec.ts-snapshots/vue-node-custom-colors-light-all-colors-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| import { adjustColor } from '@/utils/colorUtil' | ||
|
|
||
| /** | ||
| * Applies light theme color adjustments to a color | ||
| */ | ||
| export function applyLightThemeColor( | ||
| color: string, | ||
| isLightTheme: boolean | ||
| ): string { | ||
| if (!color || !isLightTheme) { | ||
| return color | ||
| } | ||
| return adjustColor(color, { lightness: 0.5 }) | ||
| } |
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.
Aside from the screenshot, can we have another test that reads the color or backgroundColor prop from the node?
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.
What additional signal would that provide?