From 15fd236ad0b35ec235b0e3f8d691d8f0d860378b Mon Sep 17 00:00:00 2001 From: Thomas Trompette Date: Fri, 19 Jun 2026 16:37:07 +0200 Subject: [PATCH] fix(workflow): add tooltip explaining why the variable picker is disabled (#21862) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Context Closes #21773 Capture d’écran 2026-06-19 à 16 33
56 When a workflow's variable picker (the `+` button next to a field) is disabled — e.g. on a step whose only trigger is a global manual trigger that produces no record variables — the button just shows a `not-allowed` cursor with no explanation of *why*. ## Change Add an `AppTooltip` to the disabled state of `WorkflowVariablesDropdown` explaining the reason: > No variables are available yet. Variables come from the workflow trigger and previous steps. The disabled state is reached via `disabled === true || noAvailableVariables`. In practice the callers hide the picker entirely in read-only mode (it's rendered only when `!disabled`/`!readonly`), so the meaningful trigger is **no available variables** — hence a single message rather than separate copy per reason. The tooltip is anchored with a `data-*` attribute selector instead of an `#id`, because the picker's `instanceId` comes from React's `useId()` (values like `:r1:`) which are invalid in a CSS `#id` selector that `AppTooltip` runs through `querySelectorAll`. ## Testing - `nx lint:diff-with-main twenty-front` — passes (lint + format). - Verified the component resolves/renders on a local instance running this branch. Review in cubic --- .../components/WorkflowVariablesDropdown.tsx | 25 +++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdown.tsx b/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdown.tsx index 3c4f218b58..42a17a8cc0 100644 --- a/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdown.tsx +++ b/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdown.tsx @@ -7,10 +7,12 @@ import { type InputSchemaPropertyType } from 'twenty-shared/workflow'; import { useAvailableVariablesInWorkflowStep } from '@/workflow/workflow-variables/hooks/useAvailableVariablesInWorkflowStep'; import { type StepOutputSchemaV2 } from '@/workflow/workflow-variables/types/StepOutputSchemaV2'; +import { t } from '@lingui/core/macro'; import { styled } from '@linaria/react'; import { useContext, useState } from 'react'; import { isDefined } from 'twenty-shared/utils'; import { IconVariablePlus } from 'twenty-ui/icon'; +import { AppTooltip, TooltipDelay, TooltipPosition } from 'twenty-ui/surfaces'; import { ThemeContext, themeCssVariables } from 'twenty-ui/theme-constants'; const StyledDropdownVariableButtonContainer = styled.div<{ @@ -85,12 +87,25 @@ export const WorkflowVariablesDropdown = ({ if (disabled === true || noAvailableVariables) { return ( - - + + + + - + ); }