From 7d27f5d6c4d992319265989e36b15e7dcc8a51ca Mon Sep 17 00:00:00 2001 From: yyh Date: Sat, 9 May 2026 12:25:33 +0800 Subject: [PATCH] docs(web): align tooltip migration guidance --- packages/dify-ui/README.md | 7 +++++++ web/docs/overlay-migration.md | 8 ++++++++ web/eslint.constants.mjs | 3 ++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/packages/dify-ui/README.md b/packages/dify-ui/README.md index 2915fe5db7..fd75042d76 100644 --- a/packages/dify-ui/README.md +++ b/packages/dify-ui/README.md @@ -99,6 +99,13 @@ See `[web/docs/overlay-migration.md](../../web/docs/overlay-migration.md)` for t - Never create an extra manual portal on top of our primitives — use the exported content / portal parts such as `DialogContent`, `PopoverContent`, and `DrawerPortal`. Base UI handles focus management, scroll-locking, and dismissal. - When a primitive needs additional presentation chrome (e.g. a custom backdrop), add it **inside** the exported component, not at call sites. +### Tooltip, infotip, and popover semantics + +- Use `Tooltip` only for short, non-interactive visual labels. The trigger must already have visible text or an `aria-label`; the tooltip is not the accessible name and must not contain links, buttons, forms, or structured prose. +- Use `Popover` for explanatory content, long text, rich layout, or anything users may need to reach on touch or with assistive technology. In `web/`, the `Infotip` wrapper is the preferred pattern for a `?` help glyph backed by `Popover`. +- Do not copy legacy tooltip offsets into migrated call sites. Pick a `placement` and let the primitive own spacing. +- When passing a Base UI trigger `render` prop, render a real `