From 9305bd1cff30d6574868f9bafc527497f540ccdf Mon Sep 17 00:00:00 2001 From: YOMXXX Date: Sat, 30 May 2026 12:42:21 +0800 Subject: [PATCH] fix(web): truncate long project names in the automation project picker (#3274) (#3317) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Long project names in the "Existing projects" section of the automation project picker rendered verbatim with no truncate styling, so a single name like "A very long project name that would otherwise wrap onto several lines" blew up the row height and made the dropdown messy to scan. The expected behavior is a single-line label with ellipsis, with the full name still discoverable on hover. Add the standard truncate triad (`white-space: nowrap`, `overflow: hidden`, `text-overflow: ellipsis`) to `.automation-popover__label`. The parent `.automation-popover__body` already sets `min-width: 0`, so the ellipsis renders cleanly. Thread an optional `title` prop through `PopoverItem` and pass each project's full name from the picker call site, so the native hover tooltip carries the unclipped name. Other PopoverItems with fixed in-product copy (e.g. "New project each run") deliberately omit the title — they never exceed the row width and the redundant tooltip would be noise. Regression test covers the DOM contract (every project row has `title=`, fixed rows do not); the CSS half is verified by code review since jsdom does not apply stylesheets. --- .../web/src/components/NewAutomationModal.tsx | 8 ++ apps/web/src/styles/home/tasks.css | 14 ++++ ...NewAutomationModal.project-picker.test.tsx | 80 +++++++++++++++++++ 3 files changed, 102 insertions(+) create mode 100644 apps/web/tests/components/NewAutomationModal.project-picker.test.tsx diff --git a/apps/web/src/components/NewAutomationModal.tsx b/apps/web/src/components/NewAutomationModal.tsx index 0f345319c..4e52e2d12 100644 --- a/apps/web/src/components/NewAutomationModal.tsx +++ b/apps/web/src/components/NewAutomationModal.tsx @@ -818,6 +818,7 @@ export function NewAutomationModal({ setPopover(null); }} label={p.name} + title={p.name} /> ))} @@ -1018,17 +1019,24 @@ function PopoverItem({ label, hint, onClick, + title, }: { selected?: boolean; label: string; hint?: string; onClick: () => void; + // Native hover tooltip surfaced when the visible label is truncated to + // ellipsis (e.g. long project names in the picker, #3274). Optional so + // unchanged call sites with short fixed labels don't grow a noisy + // duplicate tooltip. + title?: string; }) { return (