From 9e51e95f9ec32b168f25dc69ee90f069a490c727 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Thu, 24 Sep 2026 15:40:58 -0700 Subject: [PATCH] Polish the import source list The URL link and menu item stay enabled and focus the field on repeat clicks, waiting out the menu's focus return. Larger empty-state icon, inline links inherit the text color with a translucent underline, and card rows use a muted trash icon for removal. --- .../components/ImportSourceList.tsx | 24 +++++++++---------- apps/yaak-client/components/core/PathList.tsx | 3 ++- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/apps/yaak-client/components/ImportSourceList.tsx b/apps/yaak-client/components/ImportSourceList.tsx index 9e8b7f02d..82db4745b 100644 --- a/apps/yaak-client/components/ImportSourceList.tsx +++ b/apps/yaak-client/components/ImportSourceList.tsx @@ -55,8 +55,15 @@ export function ImportSourceList({ const [isHovering, setIsHovering] = useState(false); const [pathInput, setPathInput] = useState(""); const [showPathInput, setShowPathInput] = useState(false); + const pathInputRef = useRef<{ focus: () => void }>(null); const trimmedPath = pathInput.trim(); + const openPathInput = () => { + setShowPathInput(true); + // The add-row menu hands focus back to its trigger as it closes, on a timer, so focus after it + setTimeout(() => pathInputRef.current?.focus(), 50); + }; + const closePathInput = () => { setPathInput(""); setShowPathInput(false); @@ -114,6 +121,7 @@ export function ImportSourceList({ const pathInputEl = ( - + {isHovering ? ( Drop to add ) : ( @@ -159,10 +167,7 @@ export function ImportSourceList({ folder , or a{" "} - setShowPathInput(true)} - > + URL , or drag them here @@ -188,12 +193,7 @@ export function ImportSourceList({ addItems={[ { label: "Files", icon: "file", onSelect: () => pick(false) }, { label: "Folder", icon: "folder", onSelect: () => pick(true) }, - { - label: "URL or file path", - icon: "globe", - disabled: showPathInput, - onSelect: () => setShowPathInput(true), - }, + { label: "URL or file path", icon: "globe", onSelect: openPathInput }, ]} items={sources.map((source) => { const detection = detections[source.path]; @@ -262,7 +262,7 @@ export function InlineButton({