From 488a381aed964788ec780075f64c42b2703e24b4 Mon Sep 17 00:00:00 2001 From: Ryan Salazar Date: Mon, 18 May 2026 23:47:00 +0000 Subject: [PATCH] home: hide dates on Featured posts site-wide; remove BB-AI trends sidebar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Dates - FeaturedBentoFromDb hero + 4-up rail no longer render `ago(wp_published_at)`. The whole component renders only Featured-category posts (filter is category ILIKE 'featured'), so dropping the date display globally inside it satisfies the "Featured posts have no date" requirement. - /gear and /technology category cards: wrap the existing `{article.date}` output in `{article.category !== "Featured" && ...}` so only non-Featured posts continue to show their publish date. - All other category landing pages, /news/ detail, ArticleFeed, and LiveWireTicker either don't render a visible article date or only use it for SEO/structured-data fields (kept). Trends sidebar - Remove `BB AI · detected trends` block from the homepage (between ArticleFeed and NewsletterSignup). Drop the unused import and delete the orphaned TrendsSidebar.tsx component file. The detect-trends data fetch and `bb_pulse_dot` mini-widget are gone from the page; nothing else referenced them. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/app/gear/page.tsx | 8 +- src/app/home-page/page.tsx | 2 - src/app/technology/page.tsx | 4 +- src/components/FeaturedBentoFromDb.tsx | 5 -- src/components/TrendsSidebar.tsx | 109 ------------------------- 5 files changed, 9 insertions(+), 119 deletions(-) delete mode 100644 src/components/TrendsSidebar.tsx diff --git a/src/app/gear/page.tsx b/src/app/gear/page.tsx index f515c5f..bcb7892 100644 --- a/src/app/gear/page.tsx +++ b/src/app/gear/page.tsx @@ -62,8 +62,12 @@ export default async function GearPage() {
- {article.date} - · + {article.category !== "Featured" && ( + <> + {article.date} + · + + )} {article.readTime}

diff --git a/src/app/home-page/page.tsx b/src/app/home-page/page.tsx index 8a7d84b..b179687 100644 --- a/src/app/home-page/page.tsx +++ b/src/app/home-page/page.tsx @@ -4,7 +4,6 @@ import Header from "@/components/Header"; import Footer from "@/components/Footer"; import FeaturedBentoFromDb from '@/components/FeaturedBentoFromDb'; import FeaturedCarouselServer from '@/components/FeaturedCarouselServer'; -import TrendsSidebar from '@/components/TrendsSidebar'; import LiveWireTicker from '@/components/LiveWireTicker'; import NewsTicker from "./components/NewsTicker"; import FeaturedBento from "./components/FeaturedBento"; @@ -179,7 +178,6 @@ export default function HomePage() { {/* Newsletter signup */} -
diff --git a/src/app/technology/page.tsx b/src/app/technology/page.tsx index 19b42c5..5f15387 100644 --- a/src/app/technology/page.tsx +++ b/src/app/technology/page.tsx @@ -105,7 +105,9 @@ export default async function TechnologyPage() {

{article.title}

- {article.date} + {article.category !== "Featured" && ( + {article.date} + )}
))} diff --git a/src/components/FeaturedBentoFromDb.tsx b/src/components/FeaturedBentoFromDb.tsx index 0146f9d..9cf636f 100644 --- a/src/components/FeaturedBentoFromDb.tsx +++ b/src/components/FeaturedBentoFromDb.tsx @@ -106,8 +106,6 @@ export default async function FeaturedBento() { )}
{hero.author_name || "Broadcast Beat"} - · - {ago(hero.wp_published_at)}
@@ -136,9 +134,6 @@ export default async function FeaturedBento() {

{r.title}

-
- {ago(r.wp_published_at)} -
))} diff --git a/src/components/TrendsSidebar.tsx b/src/components/TrendsSidebar.tsx deleted file mode 100644 index d895437..0000000 --- a/src/components/TrendsSidebar.tsx +++ /dev/null @@ -1,109 +0,0 @@ -import { createClient } from "@supabase/supabase-js"; - -export const dynamic = "force-dynamic"; -export const revalidate = 21600; // 6h - -interface Article { - title: string; - excerpt: string | null; - tags: string[] | null; - published_at: string | null; -} - -function detectTrends(recent: Article[], baseline: Article[]) { - const recentCounts: Record = {}; - for (const a of recent) for (const t of a.tags || []) { - const k = t.toLowerCase(); - recentCounts[k] = (recentCounts[k] || 0) + 1; - } - const baseCounts: Record = {}; - for (const a of baseline) for (const t of a.tags || []) { - const k = t.toLowerCase(); - baseCounts[k] = (baseCounts[k] || 0) + 1; - } - const scored = Object.entries(recentCounts).map(([k, c]) => { - const baseline_per_day = (baseCounts[k] || 0) / 30; - const recent_per_day = c / 7; - const lift = baseline_per_day > 0 ? recent_per_day / baseline_per_day : recent_per_day * 3; - return { entity: k, lift, count: c }; - }); - scored.sort((a, b) => b.lift - a.lift); - return scored.slice(0, 5); -} - -function titleCase(s: string): string { - return s.replace(/\b\w/g, (c) => c.toUpperCase()); -} - -export default async function TrendsSidebar() { - const sb = createClient( - process.env.NEXT_PUBLIC_SUPABASE_URL!, - process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!, - { - db: { schema: (process.env.NEXT_PUBLIC_SUPABASE_SCHEMA || "bb") as "public" }, - auth: { persistSession: false }, - } - ); - - const since7d = new Date(Date.now() - 7 * 86400000).toISOString(); - const since30d = new Date(Date.now() - 30 * 86400000).toISOString(); - const [recent, baseline] = await Promise.all([ - sb - .from("wp_imported_posts") - .select("title, excerpt, tags, wp_published_at") - .eq("status", "published") - .gte("wp_published_at", since7d) - .order("wp_published_at", { ascending: false }) - .limit(200), - sb - .from("wp_imported_posts") - .select("title, excerpt, tags, wp_published_at") - .eq("status", "published") - .gte("wp_published_at", since30d) - .lt("wp_published_at", since7d) - .order("wp_published_at", { ascending: false }) - .limit(800), - ]); - - const recentArts: Article[] = (recent.data || []).map((r: any) => ({ - title: r.title, excerpt: r.excerpt, tags: r.tags, published_at: r.wp_published_at, - })); - const baselineArts: Article[] = (baseline.data || []).map((r: any) => ({ - title: r.title, excerpt: r.excerpt, tags: r.tags, published_at: r.wp_published_at, - })); - const trends = detectTrends(recentArts, baselineArts); - - return ( - - ); -}