Fix L26: consolidate drag-drop URL extraction into shared urlHelpers
firstUrl() in DownloadBar was a local duplicate of looksLikeUrl iteration (scanning multi-line text for the first valid URL). Promoted to firstUrlInText() in src/renderer/src/lib/urlHelpers.ts alongside the other URL utilities, re-exported from useClipboardLink.ts. DownloadBar now imports firstUrlInText from there instead of maintaining a local copy. typecheck + 242 tests green. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -3,7 +3,7 @@ import { useSettings } from './store/settings'
|
||||
// Pure URL helpers extracted to a standalone module so they can be tested
|
||||
// without pulling in the Zustand store (L40). Re-exported here for existing
|
||||
// consumers (DownloadBar, LibraryView) without an import-path change.
|
||||
export { looksLikeUrl, looksLikeSingleVideo } from './lib/urlHelpers'
|
||||
export { looksLikeUrl, looksLikeSingleVideo, firstUrlInText } from './lib/urlHelpers'
|
||||
import { looksLikeUrl } from './lib/urlHelpers'
|
||||
|
||||
/** Where an offered link came from — drives the banner's wording. */
|
||||
|
||||
Reference in New Issue
Block a user