feat(web): show the User Input default value beneath the field name with a working tooltip - #39564
Open
dparkmit24 wants to merge 2 commits into
Open
feat(web): show the User Input default value beneath the field name with a working tooltip#39564dparkmit24 wants to merge 2 commits into
dparkmit24 wants to merge 2 commits into
Conversation
The User Input (Start) node's input-field list shows each field's variable name, label and required flag, but not whether a Default Value is set. Verifying or editing a workflow with many inputs meant opening every field's editor one by one. Render the default inline in each row next to the required flag, matching its muted style. Long values are truncated with an ellipsis to keep the row height fixed, and the full value is shown in a native title tooltip on hover (the same mechanism the variable and label already use). Rows without a default render nothing extra. Presentational only: reads the existing InputVar.default that already applies at run time; storage and run-time behaviour are unchanged. This row component is shared only with the snippets sidebar, where the same input-field defaults are equally correct to show. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…orking tooltip
The default-value indicator previously rendered inline in the row's right-hand
metadata zone next to `required`, and its native `title` tooltip disappeared on
hover: that zone only renders while the row is not hovered, so hovering to read
the tooltip flipped the row's hover state and unmounted the indicator (the same
re-render class as the row's edit/remove swap).
Move the indicator onto its own line beneath the `{icon} name · label` identity
line, left-aligned, in the persistent left column so hover no longer unmounts it.
`required` stays top-right; single-line (no-default) rows keep their height and do
not shift on hover.
Replace the native `title` with the house `@langgenius/dify-ui/tooltip`
(portal-based Base UI tooltip), which survives the row re-render and shows the
full value on hover. Truncation and the nullish/empty guard (false/0 shown, unset
or empty hidden) are unchanged.
Tests assert position (beneath the name, not in the required zone) and tooltip
content (full value on hover, trigger stays mounted), not just presence.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Important
Fixes #<issue number>.Summary
Fixes #39563.
In the User Input (Start) node field list, a field's default value is now shown beneath the field name when one is set, so you can see at a glance which fields will fall back to a default at run time instead of opening each field's edit panel one at a time. This is a display-only change — defaults already apply correctly at run time; this just surfaces an existing property in the list.
Two problems with a first pass at this (found by browser-testing, not visible in unit tests) motivated the final shape:
Layout — the indicator first rendered inline in the row's right-hand metadata zone next to
required. It now sits on its own line beneath the{icon} name · labelidentity line, left-aligned, in the row's persistent left column.requiredstays top-right. Single-line rows with no default keep their original height and don't shift on hover.Tooltip — the value is truncated when long, with the full value on hover. The first pass used the native
titleattribute, which disappeared on hover: the metadata zone only renders while the row is not hovered, so hovering to read the tooltip flipped the row's hover state and unmounted the indicator. Moving the indicator into the persistent column fixes the unmount, and the tooltip now uses the house@langgenius/dify-ui/tooltip(portal-based), which survives the row re-render.The nullish/empty guard is unchanged:
falseand0are shown; an unset or empty-string default shows nothing.Tests assert position (beneath the name, not in the
requiredzone) and tooltip content (full value on hover, trigger stays mounted) — not just presence, since presence-only tests missed both problems above.From Claude CodeScreenshots
Before

After

Checklist
make lint && make type-check(backend) andcd web && pnpm exec vp staged(frontend) to appease the lint gods