Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

Fix: File Management - Move - Folder name is too long, causing visual clipping (clipping through UI elements) (#21962)

balibabufa2fee65a74e
diff --git a/web/AGENTS.md b/web/AGENTS.md
index 3813f2c2c4..96fd91595b 100644
--- a/web/AGENTS.md
+++ b/web/AGENTS.md
@@ -54,13 +54,22 @@ Do not reintroduce backend-variant primitives or detection helpers (e.g. a `useI
- The edition is chosen by the file's content, never at runtime: no `import.meta.env` switch that selects enterprise code and no `isEnterprise` branch in shared modules.
- Adding a new overlay means adding the empty file here and the implementation downstream in the same change.
-### CSS and Layout Debugging
### CSS and Layout Debugging
When fixing CSS/layout issues (especially flex truncation, ellipsis, or element sizing), **always inspect the full parent hierarchy** for `flex-shrink`, `min-width`, and `overflow` constraints before applying fixes like `min-w-0`. Do not repeatedly apply the same fix without verifying the root cause.
- Before editing, explain: (1) the full flex/container hierarchy from the target element up to the nearest non-flex ancestor, (2) what constraint is actually causing the bug, and (3) how the proposed fix addresses that root cause.
+### Text Overflow
+
+Any element rendering **user-generated or server-returned text** (names, titles, descriptions, file names, messages) inside a bounded container (card, table cell, dialog title, list item, badge, select trigger, button) must have an explicit overflow strategy. Never assume real data is short.
+
+- Choose deliberately: single-line `truncate`, multi-line `line-clamp-N`, or intentional wrapping with `break-words`. Rendering with no strategy is a defect — long real-world data always finds it.
+- `truncate` needs a width constraint to bite: add `min-w-0` on every flex ancestor between the text and the element that actually constrains the width (flex children default to `min-width: auto` and won't shrink below content size).
+- Keep truncated text revealable: prefer the shared `TruncatedText` component (`src/components/truncated-text.tsx`), which shows a tooltip only when truncation actually occurs.
+- Long i18n strings count as long text — a label that fits in Chinese may overflow in English.
+- Before finishing a display-component change, verify with extreme input (100+ characters, an unbroken no-space string, a CJK/Latin mix) using the `overflow-check` skill (`.claude/skills/overflow-check`), which scans the rendered page in a real browser. jsdom and lint cannot measure layout.
+
### Color Tokens
When writing or modifying styles, **use the project-defined color tokens from `src/tailwind.css`** (e.g., `bg-bg-base`, `text-text-primary`, `text-text-secondary`, `text-text-disabled`, `border-border-button`, `bg-bg-card`). Do not use arbitrary hex/RGB values or Tailwind's default palette colors (e.g., `emerald-500`, `blue-400`) directly in component class names. These tokens are defined for both light and dark modes and keep the UI consistent with the design system.
diff --git a/web/src/components/ui/async-tree-select.tsx b/web/src/components/ui/async-tree-select.tsx
index 97d3b0a7a7..d74ece6d25 100644
--- a/web/src/components/ui/async-tree-select.tsx
+++ b/web/src/components/ui/async-tree-select.tsx
@@ -252,7 +252,7 @@ export function AsyncTreeSelect({
return (
<Popover open={open} onOpenChange={handleOpenChange}>
<PopoverTrigger asChild>
- <div className="flex justify-between border px-2 py-1.5 rounded-md gap-2 items-center w-full">
+ <div className="flex justify-between border px-2 py-1.5 rounded-md gap-2 items-center w-full break-all">
{selectedTitle || (
<span className="text-slate-400">{t('common.pleaseSelect')}</span>
)}