diff --git a/src/lib/components/AddFeedModal.svelte b/src/lib/components/AddFeedModal.svelte index 2a159cd..f72f91d 100644 --- a/src/lib/components/AddFeedModal.svelte +++ b/src/lib/components/AddFeedModal.svelte @@ -8,6 +8,7 @@ import { fetchSingleFeed } from '$lib/services/feedFetcher'; import { searchBlueskyActors, type BlueskySearchResult } from '$lib/services/blueskySearch'; import { api } from '$lib/services/api'; + import { profileService } from '$lib/services/profiles'; import Modal from '$lib/components/common/Modal.svelte'; interface Publication { @@ -449,6 +450,28 @@ $effect(() => { if (open) { loadStandardSubscriptions(); + // If opened with a specific DID, skip straight to content detection + const initialDid = sidebarStore.addFeedModalInitialDid; + if (initialDid) { + // Start content detection immediately with DID as placeholder handle + selectAccount({ + did: initialDid, + handle: initialDid, + displayName: undefined, + avatar: undefined, + }); + // Resolve profile in background to update display name/avatar + profileService.getProfile(initialDid).then((profile) => { + if (profile && selectedAccount?.did === initialDid) { + selectedAccount = { + ...selectedAccount, + handle: profile.handle || selectedAccount.handle, + displayName: profile.displayName, + avatar: profile.avatar, + }; + } + }); + } } }); diff --git a/src/lib/components/ArticleCard.svelte b/src/lib/components/ArticleCard.svelte index 04b039b..dec4543 100644 --- a/src/lib/components/ArticleCard.svelte +++ b/src/lib/components/ArticleCard.svelte @@ -25,6 +25,7 @@ import LinkContextMenu from '$lib/components/feed/LinkContextMenu.svelte'; import { itemLabelsStore } from '$lib/stores/itemLabels.svelte'; import { feedViewStore } from '$lib/stores/feedView.svelte'; + import { sidebarStore } from '$lib/stores/sidebar.svelte'; import { useParagraphTracking } from '$lib/hooks/useParagraphTracking.svelte'; import { useLinkInterception } from '$lib/hooks/useLinkInterception.svelte'; import { useHighlights } from '$lib/hooks/useHighlights.svelte'; @@ -107,6 +108,34 @@ let itemGuid = $derived(article?.guid || share?.itemGuid || document?.recordUri || itemUrl); let displaySiteUrl = $derived(siteUrl || share?.feedUrl || document?.siteUri || itemUrl); + // Derive a publication name for shares/documents when feedTitle isn't provided + let displayFeedTitle = $derived.by(() => { + if (feedTitle) return feedTitle; + // For shares, extract hostname from feedUrl or itemUrl + if (isShareMode) { + const url = share?.feedUrl || share?.itemUrl; + if (url) { + try { + return new URL(url).hostname.replace(/^www\./, ''); + } catch { + return undefined; + } + } + } + // For documents, extract hostname from canonicalUrl + if (isDocumentMode) { + const url = document?.canonicalUrl; + if (url) { + try { + return new URL(url).hostname.replace(/^www\./, ''); + } catch { + return undefined; + } + } + } + return undefined; + }); + // Content handling - article has priority, then share content, then localArticle, then document let displayContent = $derived.by(() => { // For articles and shares, use existing logic @@ -458,10 +487,12 @@
{/if} @@ -497,10 +530,14 @@ {itemTitle} {/if} - {#if feedTitle} - e.stopPropagation()} - >{feedTitle} + {#if displayFeedTitle} + {#if feedId} + e.stopPropagation()} + >{displayFeedTitle} + {:else} + {displayFeedTitle} + {/if} {/if} {formatRelativeDate(itemPublishedAt)} @@ -788,6 +825,12 @@ .share-author-link { color: var(--color-text-secondary); text-decoration: none; + background: none; + border: none; + padding: 0; + font: inherit; + font-size: inherit; + cursor: pointer; } .share-author-link:hover { @@ -853,7 +896,8 @@ color: var(--color-text-secondary); } - .feed-title-link { + .feed-title-link, + .feed-title-label { flex-shrink: 0; max-width: 12rem; overflow: hidden; diff --git a/src/lib/stores/sidebar.svelte.ts b/src/lib/stores/sidebar.svelte.ts index 3de44be..eff2169 100644 --- a/src/lib/stores/sidebar.svelte.ts +++ b/src/lib/stores/sidebar.svelte.ts @@ -82,12 +82,20 @@ function createSidebarStore() { persist(); } + let addFeedModalInitialDid = $state