Skip to content

feat: add mutual exclusivity between ChatInput and Webhook components#12036

Merged
Jkavia merged 10 commits intorelease-1.8.0from
feat/chat-webhook-mutual-exclusivity
Mar 4, 2026
Merged

feat: add mutual exclusivity between ChatInput and Webhook components#12036
Jkavia merged 10 commits intorelease-1.8.0from
feat/chat-webhook-mutual-exclusivity

Conversation

@Jkavia
Copy link
Collaborator

@Jkavia Jkavia commented Mar 4, 2026

This PR addresses an issue where the canvas allows both a Chat Input and a Webhook component to coexist within the same flow, even though they are mutually exclusive entry points.

Currently, even when invoking the flow via the /run endpoint, the Webhook component is still initialized and executed if present. This behavior contributes to ambiguity and unintended execution paths. A deeper architectural fix will be addressed in a future release.

As an immediate safeguard, this PR introduces UI-level mutual exclusivity between Chat Input and Webhook components.

Related JIRA: https://datastax.jira.com/jira/software/projects/LE/boards/4573?jql=labels%20%3D%20release-v1.8.0&selectedIssue=LE-455

Screenshot 2026-03-04 at 11 38 10 PM Screenshot 2026-03-04 at 11 38 30 PM Screenshot 2026-03-05 at 12 42 14 AM

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 4, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 28295aba-421b-402c-abc6-d711af64d8a5

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/chat-webhook-mutual-exclusivity

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added the enhancement New feature or request label Mar 4, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

Frontend Unit Test Coverage Report

Coverage Summary

Lines Statements Branches Functions
Coverage: 23%
23.28% (8148/34985) 16% (4390/27436) 16.13% (1188/7363)

Unit Test Results

Tests Skipped Failures Errors Time
2653 0 💤 0 ❌ 0 🔥 45.85s ⏱️

@Jkavia Jkavia requested a review from Cristhianzl March 4, 2026 18:48
Copy link
Member

@Cristhianzl Cristhianzl left a comment

Choose a reason for hiding this comment

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

Missing test scenarios:

For disableItem:

Scenario Expected Priority
disableItem("ChatInput", { chatInput: false, webhookInput: false }) false 🔴 Must have — verifies item is enabled when neither exists
disableItem("ChatInput", { chatInput: true, webhookInput: false }) true 🔴 Must have — original "already added" behavior still works
disableItem("Webhook", { chatInput: false, webhookInput: true }) true 🔴 Must have — original "already added" behavior still works
disableItem("Webhook", { chatInput: false, webhookInput: false }) false 🔴 Must have — verifies item is enabled when neither exists
disableItem("SomeOtherComponent", { chatInput: true, webhookInput: true }) false 🟡 Should have — verifies non-input components aren't affected
disableItem("ChatInput", { chatInput: true, webhookInput: true }) true 🟡 Should have — both present edge case

For getDisabledTooltip:

Scenario Expected Priority
getDisabledTooltip("ChatInput", { chatInput: true, webhookInput: false }) "Chat input already added" 🔴 Must have — original behavior
getDisabledTooltip("Webhook", { chatInput: false, webhookInput: true }) "Webhook already added" 🔴 Must have — original behavior
getDisabledTooltip("ChatInput", { chatInput: false, webhookInput: false }) "" 🔴 Must have — no tooltip when enabled
getDisabledTooltip("SomeOther", { chatInput: true, webhookInput: true }) "" 🟡 Should have

Should fix:

  1. Tests — add regression coverage for the original "already added" behavior. Without these, a future refactor could break the original logic with no test catching it.
  2. Tests — add base case where neither component exists. These verify the "enabled" state works correctly.

Nice to have:
3. Consider a data-driven EXCLUSIVITY_RULES constant to reduce structural coupling between the two files
4. Extract "ChatInput" and "Webhook" string literals to shared constants
5. Add test for non-input components to ensure no false positives

@codecov
Copy link

codecov bot commented Mar 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (release-1.8.0@ba7982c). Learn more about missing BASE report.

Additional details and impacted files

Impacted file tree graph

@@               Coverage Diff                @@
##             release-1.8.0   #12036   +/-   ##
================================================
  Coverage                 ?   37.17%           
================================================
  Files                    ?     1591           
  Lines                    ?    78071           
  Branches                 ?    11833           
================================================
  Hits                     ?    29026           
  Misses                   ?    47390           
  Partials                 ?     1655           
Flag Coverage Δ
backend 57.31% <ø> (?)
frontend 20.84% <100.00%> (?)
lfx 41.49% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...mponents/flowSidebarComponent/helpers/constants.ts 100.00% <100.00%> (ø)
...nents/flowSidebarComponent/helpers/disable-item.ts 100.00% <100.00%> (ø)
...owSidebarComponent/helpers/get-disabled-tooltip.ts 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Mar 4, 2026
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Mar 4, 2026
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Mar 4, 2026
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Mar 4, 2026
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Mar 4, 2026
Copy link
Member

@Cristhianzl Cristhianzl left a comment

Choose a reason for hiding this comment

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

lgtm

@github-actions github-actions bot added the lgtm This PR has been approved by a maintainer label Mar 4, 2026
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Mar 4, 2026
@Jkavia Jkavia enabled auto-merge (squash) March 4, 2026 20:50
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Mar 4, 2026
@Jkavia Jkavia merged commit e848ff9 into release-1.8.0 Mar 4, 2026
93 checks passed
@Jkavia Jkavia deleted the feat/chat-webhook-mutual-exclusivity branch March 4, 2026 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request lgtm This PR has been approved by a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants