From 7b485bfca3bb7752cb12819291a7f539e97f4f9a Mon Sep 17 00:00:00 2001 From: pitoi Date: Wed, 17 Jun 2026 16:13:54 +0000 Subject: [PATCH] Generated with Hive: Refactor node row layout to prevent trash and ExternalLink icon overlap in My Content sidebar --- src/components/feed/feed-card.tsx | 54 +++++++++++----------- src/components/feed/hot-takes.tsx | 5 +- src/components/layout/my-content-panel.tsx | 28 +++++------ src/components/modals/budget-modal.tsx | 2 +- src/lib/__tests__/withdraw.test.ts | 2 +- 5 files changed, 48 insertions(+), 43 deletions(-) diff --git a/src/components/feed/feed-card.tsx b/src/components/feed/feed-card.tsx index 6e7e753..3eda70d 100644 --- a/src/components/feed/feed-card.tsx +++ b/src/components/feed/feed-card.tsx @@ -177,23 +177,24 @@ function CardBody({ {(() => { const src = pickString(p, "source_link") if (!src) return null + let hostname: string | null = null try { - const hostname = new URL(src).hostname - return ( - e.stopPropagation()} - className="inline-flex items-center gap-1 text-[10px] font-mono text-muted-foreground hover:text-foreground transition-colors" - > - - {hostname} - - ) + hostname = new URL(src).hostname } catch { return null } + return ( + e.stopPropagation()} + className="inline-flex items-center gap-1 text-[10px] font-mono text-muted-foreground hover:text-foreground transition-colors" + > + + {hostname} + + ) })()} ) @@ -206,23 +207,24 @@ function CardBody({ {(() => { const src = pickString(p, "source_link") if (!src) return null + let hostname: string | null = null try { - const hostname = new URL(src).hostname - return ( - e.stopPropagation()} - className="inline-flex items-center gap-1 text-[10px] font-mono text-muted-foreground hover:text-foreground transition-colors" - > - - {hostname} - - ) + hostname = new URL(src).hostname } catch { return null } + return ( + e.stopPropagation()} + className="inline-flex items-center gap-1 text-[10px] font-mono text-muted-foreground hover:text-foreground transition-colors" + > + + {hostname} + + ) })()} ) diff --git a/src/components/feed/hot-takes.tsx b/src/components/feed/hot-takes.tsx index 8931553..c9f8f09 100644 --- a/src/components/feed/hot-takes.tsx +++ b/src/components/feed/hot-takes.tsx @@ -42,10 +42,11 @@ export function HotTakes() { const candidates = MOCK_NODES .filter((n) => n.node_type === "Clip" && clipQuote(n)) .sort((a, b) => (b.date_added_to_graph ?? 0) - (a.date_added_to_graph ?? 0)) - setClips(diversifyClipsByParent(candidates, MOCK_EDGES, { + const result = diversifyClipsByParent(candidates, MOCK_EDGES, { maxPerSource: MAX_PER_SOURCE, finalLimit: FINAL_LIMIT, - })) + }) + Promise.resolve().then(() => setClips(result)) return } const controller = new AbortController() diff --git a/src/components/layout/my-content-panel.tsx b/src/components/layout/my-content-panel.tsx index 2087959..fa55abb 100644 --- a/src/components/layout/my-content-panel.tsx +++ b/src/components/layout/my-content-panel.tsx @@ -420,21 +420,23 @@ export function MyContentPanel({ onClose }: { onClose: () => void }) { return (
-
- { setSelectedNode(node); setSidebarSelectedNode(node) }} - onMouseEnter={() => setHoveredNode(node)} - onMouseLeave={() => setHoveredNode(null)} - hideBoost={true} - isAdmin={isAdmin} - unlockCount={insight?.unlock_count} - growthBadge={nodeBadge} - /> +
+
+ { setSelectedNode(node); setSidebarSelectedNode(node) }} + onMouseEnter={() => setHoveredNode(node)} + onMouseLeave={() => setHoveredNode(null)} + hideBoost={true} + isAdmin={isAdmin} + unlockCount={insight?.unlock_count} + growthBadge={nodeBadge} + /> +
{!isConfirming && (