From b24ada9b77d40d563a83237dbacd1af4e0db8470 Mon Sep 17 00:00:00 2001 From: Pas <74743263+Pasithea0@users.noreply.github.com> Date: Sat, 6 Dec 2025 21:48:28 -0700 Subject: [PATCH] Handle 'not found' state in embed source selection Adds a 'notFound' state to useEmbedScraping and updates SourceSelectingView, SourceSelectPart, and SelectableLink to display a distinct UI when an embed source is not found. This improves user feedback for unavailable sources and refines error handling logic. --- .../atoms/settings/SourceSelectingView.tsx | 18 ++++++++-- .../player/hooks/useSourceSelection.ts | 1 + .../player/internals/ContextMenu/Links.tsx | 33 ++++++++++--------- src/pages/parts/player/SourceSelectPart.tsx | 22 +++++++++++-- 4 files changed, 55 insertions(+), 19 deletions(-) diff --git a/src/components/player/atoms/settings/SourceSelectingView.tsx b/src/components/player/atoms/settings/SourceSelectingView.tsx index e20bc6b2..6d15677b 100644 --- a/src/components/player/atoms/settings/SourceSelectingView.tsx +++ b/src/components/player/atoms/settings/SourceSelectingView.tsx @@ -39,19 +39,33 @@ export function EmbedOption(props: { return sourceMeta?.name ?? unknownEmbedName; }, [props.embedId, unknownEmbedName]); - const { run, errored, loading } = useEmbedScraping( + const { run, errored, loading, notFound } = useEmbedScraping( props.routerId, props.sourceId, props.url, props.embedId, ); + let rightSide; + if (loading) { + rightSide = undefined; // Let SelectableLink handle loading + } else if (notFound) { + rightSide = ( +