Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 28 additions & 26 deletions src/components/feed/feed-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<a
href={src}
target="_blank"
rel="noopener noreferrer"
onClick={(e) => e.stopPropagation()}
className="inline-flex items-center gap-1 text-[10px] font-mono text-muted-foreground hover:text-foreground transition-colors"
>
<ExternalLink className="h-3 w-3" />
{hostname}
</a>
)
hostname = new URL(src).hostname
} catch {
return null
}
return (
<a
href={src}
target="_blank"
rel="noopener noreferrer"
onClick={(e) => e.stopPropagation()}
className="inline-flex items-center gap-1 text-[10px] font-mono text-muted-foreground hover:text-foreground transition-colors"
>
<ExternalLink className="h-3 w-3" />
{hostname}
</a>
)
})()}
</div>
)
Expand All @@ -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 (
<a
href={src}
target="_blank"
rel="noopener noreferrer"
onClick={(e) => e.stopPropagation()}
className="inline-flex items-center gap-1 text-[10px] font-mono text-muted-foreground hover:text-foreground transition-colors"
>
<ExternalLink className="h-3 w-3" />
{hostname}
</a>
)
hostname = new URL(src).hostname
} catch {
return null
}
return (
<a
href={src}
target="_blank"
rel="noopener noreferrer"
onClick={(e) => e.stopPropagation()}
className="inline-flex items-center gap-1 text-[10px] font-mono text-muted-foreground hover:text-foreground transition-colors"
>
<ExternalLink className="h-3 w-3" />
{hostname}
</a>
)
})()}
</div>
)
Expand Down
5 changes: 3 additions & 2 deletions src/components/feed/hot-takes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
28 changes: 15 additions & 13 deletions src/components/layout/my-content-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -420,21 +420,23 @@ export function MyContentPanel({ onClose }: { onClose: () => void }) {

return (
<div key={node.ref_id}>
<div className="relative group">
<NodeRow
node={node}
schemas={schemas}
onClick={() => { setSelectedNode(node); setSidebarSelectedNode(node) }}
onMouseEnter={() => setHoveredNode(node)}
onMouseLeave={() => setHoveredNode(null)}
hideBoost={true}
isAdmin={isAdmin}
unlockCount={insight?.unlock_count}
growthBadge={nodeBadge}
/>
<div className="flex items-center group">
<div className="flex-1 min-w-0 overflow-hidden">
<NodeRow
node={node}
schemas={schemas}
onClick={() => { setSelectedNode(node); setSidebarSelectedNode(node) }}
onMouseEnter={() => setHoveredNode(node)}
onMouseLeave={() => setHoveredNode(null)}
hideBoost={true}
isAdmin={isAdmin}
unlockCount={insight?.unlock_count}
growthBadge={nodeBadge}
/>
</div>
{!isConfirming && (
<button
className="absolute right-2 top-1/2 -translate-y-1/2 opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-destructive"
className="shrink-0 pl-3 pr-3 opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-destructive"
onClick={(e) => { e.stopPropagation(); setDeletingId(node.ref_id); setDeleteError(null) }}
aria-label="Delete node"
>
Expand Down
2 changes: 1 addition & 1 deletion src/components/modals/budget-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1140,7 +1140,7 @@ export function BudgetModal() {
{reachedViaFirstPurchase && !isWithdrawSuccess && (
<div className="flex flex-col gap-2 rounded-md border border-border/50 bg-muted/30 p-3">
<p className="text-xs text-foreground/80">
This token is the key to your balance. Store it somewhere safe — you'll need it to restore access if you clear your cookies or switch devices.
This token is the key to your balance. Store it somewhere safe — you&apos;ll need it to restore access if you clear your cookies or switch devices.
</p>
<Button
variant="outline"
Expand Down
2 changes: 1 addition & 1 deletion src/lib/__tests__/withdraw.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { describe, it, expect, vi, beforeEach } from "vitest"
// vi.mock calls are hoisted — declare factory functions using vi.hoisted
const { mockApiPostHoisted, mockIsMocksEnabledHoisted, mockMockTransactionsHoisted, mockDecodeInvoiceAmountSatsHoisted } = vi.hoisted(() => {
const mockApiPost = vi.fn()
let isMocksEnabled = false
const isMocksEnabled = false
const mockTransactions: { transactions: Array<{ action: string; type: string; amount: number; created_at: string }> } = { transactions: [] }
const mockDecodeInvoiceAmountSats = vi.fn().mockReturnValue(500)
return {
Expand Down
Loading