disclosure-bureau/web/app/page.tsx
Luiz Gustavo 1687120b7f
Some checks failed
CI / Web — typecheck + lint + build (push) Failing after 36s
CI / Scripts — Python smoke (push) Failing after 4s
CI / Web — npm audit (push) Failing after 42s
CI / Retrieval — golden set (Recall@5 + MRR) (push) Failing after 6s
W5.6 (Phase 3D): Iconic Cases — curated rail on homepage
8 hand-picked UFO incidents that any enthusiast recognises:
  - Kenneth Arnold 1947 (the genesis — "flying saucers" coined)
  - Roswell 1947 (the original Army press release)
  - Maury Island 1947 (Puget Sound, slag drop, FBI plane crash)
  - Mantell 1948 (first known UFO casualty)
  - Rendlesham Forest 1980 (USAF security police, deputy commander tape)
  - Phoenix Lights 1997 (V-formation across Arizona, governor's reversal)
  - Nimitz Tic-Tac 2004 (USS Nimitz F/A-18, gun-cam released 2017)
  - Green Fireballs Sandia 1948 (copper salts, nuclear-site overflights)

Each case has:
  - Bilingual hand-written editorial blurb (PT-BR + EN, no LLM)
  - Painterly editorial hero illustration at 2K
  - Year + tag chips (military / civilian / modern / early / naval /
    aviation / mass-sighting)
  - Link to /e/events/<id> when indexed in corpus, /search?q=... when not,
    /c/<slug> for the green-fireballs narrative case

Components:
  lib/iconic-cases.ts — IconicCase type + ICONIC_CASES editorial list
  components/iconic-cases.tsx — magazine grid: first two as wide hero pair,
    rest as 3-up tiles below. Hover scale on images, gradient overlays,
    aspect-16/11 hero + 16/10 compact, lazy-loaded.
  app/page.tsx — inserted between <FeaturedCase /> and <PortalGrid />

4 new hero illustrations generated this session:
  - iconic-nimitz-tic-tac-2004.png       (Nano Banana Pro)
  - iconic-phoenix-lights-1997.png       (Nano Banana Pro)
  - iconic-rendlesham-forest-1980.png    (gpt-image-1.5 via Codex)
  - iconic-mantell-1948.png              (Nano Banana Pro)
Per user direction: mixed generators (Nano Banana primary, Codex
co-pilot) so the homepage has stylistic variety while keeping the
painterly editorial register.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 16:50:52 -03:00

122 lines
5 KiB
TypeScript

import { listDocuments, readDocument } from "@/lib/wiki";
import { ChatBubble } from "@/components/chat-bubble";
import { BatchProgressBanner } from "@/components/batch-progress-banner";
import { getLocale } from "@/components/locale-toggle";
import { summarize, pickPitch } from "@/lib/doc-summary";
import { DocListFilters } from "@/components/doc-list-filters";
import { SiteHeader } from "@/components/site-header";
import { HeroBanner } from "@/components/hero-banner";
import { FeaturedCase } from "@/components/featured-case";
import { IconicCases } from "@/components/iconic-cases";
import { PortalGrid, type PortalCounts } from "@/components/portal-grid";
import { GreatestHits } from "@/components/greatest-hits";
import { pgQuery } from "@/lib/retrieval/db";
// Read wiki/ filesystem + DB at request time, not build time.
export const dynamic = "force-dynamic";
async function loadCounts(documentsCount: number): Promise<PortalCounts> {
const rows = await pgQuery<{ entity_class: string; c: string }>(
`SELECT entity_class, COUNT(*)::text AS c
FROM public.entities
GROUP BY entity_class`,
).catch(() => [] as Array<{ entity_class: string; c: string }>);
const by: Record<string, number> = {};
for (const r of rows) by[r.entity_class] = Number(r.c);
return {
events: by.event ?? 0,
people: by.person ?? 0,
uap_objects: by.uap_object ?? 0,
locations: by.location ?? 0,
operations: by.organization ?? 0,
documents: documentsCount,
};
}
export default async function Home() {
const ids = await listDocuments();
const locale = (await getLocale()) === "en" ? "en" : "pt-br";
const docs = await Promise.all(
ids.map(async (id) => {
const f = await readDocument(id);
const summaryLang: "pt" | "en" = locale === "en" ? "en" : "pt";
return {
id,
title: (f?.fm.canonical_title as string) ?? id,
pages: (f?.fm.page_count as number) ?? 0,
collection: (f?.fm.collection as string) ?? "uncategorized",
classification: (f?.fm.highest_classification as string) ?? "—",
summary: pickPitch(f?.fm as Record<string, unknown> | undefined, summaryLang) ?? (f?.body ? summarize(f.body, summaryLang) : ""),
};
}),
);
const counts = await loadCounts(ids.length);
const totalPages = docs.reduce((s, d) => s + d.pages, 0);
return (
<div className="min-h-screen">
<SiteHeader locale={locale} />
<HeroBanner
locale={locale}
stats={{
documents: counts.documents,
events: counts.events,
people: counts.people,
uap_objects: counts.uap_objects,
}}
heroDocId="dow-uap-d017-general-correspondence-of-sandia"
heroPage={1}
/>
<FeaturedCase locale={locale} />
<IconicCases locale={locale} />
<PortalGrid counts={counts} locale={locale} />
<GreatestHits locale={locale} limit={9} />
<BatchProgressBanner />
{/* Document list — kept but reframed as "the primary record" */}
<section className="mx-auto max-w-7xl px-4 md:px-8 py-12 md:py-16 border-t border-[rgba(224,192,128,0.10)]">
<div className="text-[10px] font-mono uppercase tracking-[0.18em] text-[#5a6678] mb-2">
{locale === "en" ? "// The primary record" : "// O registro primário"}
</div>
<h2 className="font-display text-2xl md:text-3xl text-[#e7ecf3] mb-1">
{locale === "en" ? "Every document, indexed and searchable" : "Cada documento, indexado e buscável"}
</h2>
<p className="text-[#9aa6b8] text-sm mb-6">
{locale === "en"
? `${ids.length} declassified files · ${totalPages.toLocaleString("pt-BR")} pages`
: `${ids.length} arquivos desclassificados · ${totalPages.toLocaleString("pt-BR")} páginas`}
</p>
<DocListFilters docs={docs} />
</section>
<ChatBubble context={{}} />
{/* JSON-LD: WebSite + ItemList of recent docs (helps GEO discovery) */}
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify({
"@context": "https://schema.org",
"@type": "WebSite",
name: "The Disclosure Bureau",
url: process.env.NEXT_PUBLIC_SITE_URL ?? "https://disclosure.top",
description: locale === "en"
? `Public archive of ${counts.documents} declassified UAP/UFO documents from the US Department of War, with ${counts.events.toLocaleString()} catalogued events and ${counts.people.toLocaleString()} people.`
: `Arquivo público de ${counts.documents} documentos UAP/UFO desclassificados do Departamento de Guerra dos EUA, com ${counts.events.toLocaleString()} eventos catalogados e ${counts.people.toLocaleString()} pessoas.`,
potentialAction: {
"@type": "SearchAction",
target: `${process.env.NEXT_PUBLIC_SITE_URL ?? "https://disclosure.top"}/search?q={search_term_string}`,
"query-input": "required name=search_term_string",
},
}) }}
/>
</div>
);
}