Skip to content

Conversation

arjansingh
Copy link
Contributor

@arjansingh arjansingh commented Sep 27, 2025

Summary

Error states were not getting propagated down to the InputSlots from the API Repsonse

I created a provider and injected error state. It seemed like a way better idea than prop drilling or building a composable that only two nodes (InputSlot and OutputSlot) would need.

Changes

The follow are now error code red when an input node has errors:

  1. There's a error round border around the dot.
  2. The dot is error colored.
  3. The input text is error colored.

This treatment was okay after feedback from design.

Screenshots - Error State

Screenshot 2025-09-26 at 9 02 58 PM

┆Issue is synchronized with this Notion page by Unito

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Sep 27, 2025
Copy link

github-actions bot commented Sep 27, 2025

🎭 Playwright Test Results

Some tests failed

⏰ Completed at: 09/28/2025, 12:01:22 AM UTC

📈 Summary

  • Total Tests: 475
  • Passed: 444 ✅
  • Failed: 1 ❌
  • Flaky: 1 ⚠️
  • Skipped: 29 ⏭️

📊 Test Reports by Browser

  • chromium: View Report • ✅ 437 / ❌ 1 / ⚠️ 1 / ⏭️ 29
  • chromium-2x: View Report • ✅ 2 / ❌ 0 / ⚠️ 0 / ⏭️ 0
  • chromium-0.5x: View Report • ✅ 1 / ❌ 0 / ⚠️ 0 / ⏭️ 0
  • mobile-chrome: View Report • ✅ 4 / ❌ 0 / ⚠️ 0 / ⏭️ 0

🎉 Click on the links above to view detailed test results for each browser configuration.

Comment on lines 217 to 227
const hasInputSlotError = (inputName: string): boolean => {
const nodeValidationErrors = executionStore.lastNodeErrors?.[nodeData.id]
if (!nodeValidationErrors?.errors) return false
return nodeValidationErrors.errors.some(
(err) =>
err.type === 'required_input_missing' &&
err.extra_info?.input_name === inputName
)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error state is set on the NodeInputSlot, it should be much simpler to get it that way

Image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this be something we could query a store for, if we set it up?

@arjansingh arjansingh force-pushed the fix/input-slot-error-states branch from af441c7 to eac6b80 Compare September 27, 2025 21:20
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Sep 27, 2025
@arjansingh arjansingh force-pushed the fix/input-slot-error-states branch 3 times, most recently from 49d8c21 to 5c21b1f Compare September 27, 2025 21:34
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:XL This PR changes 500-999 lines, ignoring generated files. labels Sep 27, 2025
@arjansingh arjansingh force-pushed the fix/input-slot-error-states branch from 652d136 to cf01d9f Compare September 27, 2025 22:27
DrJKL
DrJKL previously approved these changes Sep 27, 2025
Copy link
Contributor

@DrJKL DrJKL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is much cleaner, yes.

Comment on lines +76 to +78
return hasSlotError.value
? 'ring-2 ring-error dark-theme:ring-error ring-offset-0 rounded-full'
: ''
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: cn handles boolean/undefined/string, so it's pretty common to do condition && 'class list' which is simpler than a ternary with an empty string branch.

Comment on lines +104 to +108
v-memo="[
nodeData.inputs?.length,
nodeData.outputs?.length,
executionStore.lastNodeErrors
]"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's pretty rare that you actually need v-memo. Could you see if it's necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i actually removed it during debugging but put it back because i figured i'd get chastised for removing it :Joy:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can remove it, happy to follow on

const slotColor = computed(() => getSlotColor(props.slotData.type))
const slotColor = computed(() => {
if (hasSlotError.value) {
return 'var(--color-error)'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this would do anything.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's how the dot turns red.

@arjansingh arjansingh added the New Browser Test Expectations New browser test screenshot should be set by github action label Sep 27, 2025
@arjansingh arjansingh force-pushed the fix/input-slot-error-states branch from cf01d9f to 79125a5 Compare September 27, 2025 22:58
@arjansingh arjansingh force-pushed the fix/input-slot-error-states branch from 9bd814c to eb08928 Compare September 27, 2025 23:34
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Sep 27, 2025
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Sep 27, 2025
@arjansingh arjansingh added New Browser Test Expectations New browser test screenshot should be set by github action and removed New Browser Test Expectations New browser test screenshot should be set by github action labels Sep 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New Browser Test Expectations New browser test screenshot should be set by github action size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants