Commit Graph
16 Commits
Author SHA1 Message Date
Maria PapoilaandPaperclip 3d4b129b4c BIT-15752: Add unit tests across writer-pipeline, bridge, and frontend
Tests / writer-pipeline tests (push) Failing after 1s
Tests / bridge tests (push) Failing after 1s
Tests / frontend lib tests (push) Failing after 1s
Tests / writer-pipeline tests (pull_request) Successful in 52s
Tests / bridge tests (pull_request) Successful in 25s
Tests / frontend lib tests (pull_request) Successful in 29s
87 new tests covering previously untested pure functions:
- writer-pipeline: token-metrics, store (canonicalUrl/itemId/upsertItem/shortlist), config-load
- bridge: ranking (freshness/relevance/rank/filter/take_top_n), aggregator-mapper
- frontend/lib: format, ui-i18n, public-origin

Adds test:coverage scripts (node --experimental-test-coverage) and Gitea
CI workflow. writer-pipeline now reports 95.91% line coverage.

Co-Authored-By: Paperclip <[email protected]>
2026-04-29 01:08:41 +00:00
Artur Moreira 085ee7be88 Fix SSR 503 when bridge is unhealthy and correct systemd boot order
resolveSsrBridge now treats non-2xx /health as failure in production.
news-bridge no longer waits for news-frontend; frontend Wants+After
bridge so the API is up when Astro starts. Document the PT 503 string
and recovery commands in the BIT-746 runbook.
2026-04-23 10:36:22 +01:00
Artur Moreira b629f6c6aa feat(frontend): PT shell i18n, html lang pt-PT, i18n docs (BIT-739)
- Set document language to full BCP-47 from domain config (e.g. pt-PT).
- Extend ui-i18n with service errors, ad labels, ARIA landmarks, category
  meta fallback, and localized search upstream message.
- Localize ArticleHeader (dates, reading time, breadcrumb); omit duplicate
  breadcrumb when institutional chrome already provides one.

Docs: add docs/i18n.md strategy sketch; domains.md and deployment.md
(BRIDGE_INTERNAL_URL) cross-links.

Paperclip-Agent: ac1be104-8818-496a-80c5-fbc590a87855
Paperclip-Issue: 182b154e-5ad4-4965-9f30-50a66ef51ce0
Paperclip-Run: 6ce7746f-bfb6-4486-a1f5-aed26fe8e149
Made-with: Cursor
2026-04-02 20:06:48 +00:00
Artur Moreira 9a4c144f27 fix(frontend): block production SSR from using mock bridge content
When the Astro server could not reach the bridge health endpoint, the
code fell back to MockBridgeClient, which serves English placeholder
articles and a fictional author name. That was indexed and shown on
andebol.net (BIT-738).

Introduce resolveSsrBridge() so production never uses the mock; allow
BRIDGE_INTERNAL_URL to override the domain JSON endpoint for real
deploy topology; adjust pages and sitemap accordingly.

Made-with: Cursor
2026-04-02 19:57:45 +00:00
Artur Moreira 6be81f11dc feat(institutional): portal parity — trending, section labels, secondary nav (BIT-688)
Add an institutional trending strip with section title and card rhythm.
Show a visible hero section label; localize related-articles titles.
Article pages gain breadcrumbs in institutional theme; category pages get
a horizontal secondary nav aligned with the news hub plus a wider layout.
Search gains an institutional masthead, accessible heading hierarchy, and
a results section title when queries return articles.

Verified: npm run build (frontend).

Paperclip-Task: b8b9096e-1fcd-478f-a92f-83a1db0ce67d
Paperclip-Run: 33ce910a-e3fe-4e2d-be3f-e8a3261c73e7
Made-with: Cursor
2026-04-01 14:19:29 +00:00
Artur MoreiraandPaperclip a70f930808 fix(frontend): surface /noticias archive and fix public URL behind proxy
Add getPublicOrigin() so canonical URLs and JSON-LD use Host + X-Forwarded-Proto
instead of localhost:4321 when nginx proxies to Node.

- Nav and mobile menu: link "Notícias" to /noticias (eurohandball-style listing).
- Homepage "ver tudo" targets /noticias instead of /category/all.
- Redirect /news to /noticias for English-style paths.

Co-Authored-By: Paperclip <[email protected]>
Made-with: Cursor
2026-03-30 12:21:46 +00:00
Artur MoreiraandPaperclip f3e56f4b14 feat(andebol): redesign /noticias as magazine-style layout (BIT-623)
Replace uniform 3-column grid with rich newspaper-inspired layout:
- Secondary featured row (top stories cards) below hero
- Lead article displayed as large card for visual hierarchy
- Two-column main+sidebar layout on desktop
- "Most Read" trending sidebar with numbered article list
- Mixed card sizes (lg lead + md grid) instead of monotonous grid
- New i18n string: news_most_read (pt-PT + en)

Co-Authored-By: Paperclip <[email protected]>
2026-03-30 02:07:16 +00:00
7869b25b2a feat(andebol): add /noticias news archive page with hero + category tabs (BIT-624)
New dedicated news listing page for andebol.net inspired by eurohandball.com/news:
- Hero banner with latest featured article (page 1, unfiltered)
- Horizontal category filter tabs (all + domain categories)
- Responsive 3-column article grid with pagination
- Full i18n support (pt-PT / en)
- Uses institutional theme tokens and existing ArticleCard component

Co-Authored-By: Paperclip <[email protected]>
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-03-30 01:57:27 +00:00
Artur MoreiraandPaperclip 4ef03e52ea fix(homepage): dedupe feed bands and surface featured section
The bridge built hero, trending, featured, latest, and category rows from
overlapping slices of the same post list, so the same thumbnails appeared many
times. Reserve post ids top-to-bottom, over-fetch the main feed and category
queries, and de-dupe the hero when stickies overlap the feed.

Render the featured slice as its own banded section, localize the sports
trending strip, and use distinct heading ids when two grids share the page.

Co-Authored-By: Paperclip <[email protected]>
Made-with: Cursor
2026-03-29 21:00:56 +00:00
Artur MoreiraandPaperclip 1e0de85486 feat(andebol): surface FPA national agenda on homepage via bridge
Enable fpa_agenda_enabled on andebol.net domain config. The bridge fetches
ws.fpa.pt getAgendaJogosFAP with SWR caching, normalises rows, and attaches
fpa_agenda to the homepage JSON. The institutional theme renders a responsive
fixtures table with FPA attribution.

Co-Authored-By: Paperclip <[email protected]>
Made-with: Cursor
2026-03-27 16:57:24 +00:00
Artur Moreira 0a845c41cc feat(frontend): institutional layout pass — search, archive, discovery (BIT-591)
Add GET /search wired to bridge articles search with pagination and empty-state
category pills. Handle /category/all as a full-archive listing. Enrich
institutional theme: serif body rhythm, hero depth, footer gradient, header
search (all breakpoints) plus auth links when auth_links is set, homepage
DiscoverSection, and footer links to search and archive. Extend UI strings (EN/PT)
and mock bridge search for offline builds.

Verified: npx [email protected].0 node_modules/astro/bin/astro.mjs build (frontend).
Made-with: Cursor
2026-03-27 16:46:51 +00:00
Artur Moreira ff4c41bc2d fix(frontend): add ui-i18n module and locale-aware copy for institutional theme
The institutional header/footer already imported ui-i18n.ts but the file was
missing from the repository. Add Portuguese/English UI strings, wire
config.locale through homepage sections, category archives, article cards,
and related articles, and use Intl.RelativeTimeFormat for relative dates.

Refs: BIT-586
Made-with: Cursor
2026-03-27 10:59:04 +00:00
Artur MoreiraandPaperclip aff73455d0 feat(andebol): public WP login surface, auth nav, /entrar and /registar
- Nginx: proxy wp-login.php, wp-includes, wp-admin css/js/images, and
  wp-content/languages without RFC1918 allow (works with real_ip); keep
  rest of wp-admin, wp-content, wp-json restricted.
- Domain config: auth_links on andebol.net; optional DomainConfig field.
- Astro: Portuguese/English auth labels, header/footer links, redirects.
- Bridge: omit internal detail from 503 JSON (avoid leaking upstream msgs).
- Docs: deployment + domains schema for auth and membership.

Co-Authored-By: Paperclip <[email protected]>
Made-with: Cursor
2026-03-27 10:57:57 +00:00
738f847d36 feat: theme system + institutional theme + andebol.net domain config
Add domain-aware theme system (BIT-494, BIT-495, BIT-496, BIT-497):

- Theme architecture: move shared components into src/themes/sports/,
  create src/themes/institutional/ with handball-oriented design
- Domain config: andebol.net.json (institutional theme, pt-PT locale,
  handball categories, WP endpoint port 8081)
- theme.ts library: resolves theme components per domain config
- Updated layouts/pages to use theme-aware component loading
- Updated docs: domains.md, frontend.md with theme system docs
- Smoke test script for andebol.net
- WordPress .env.example with andebol env vars

Note: this work was completed in BIT-494/495/496/497 but was
never committed — committing now to unblock andebol.net deploy.

Co-Authored-By: Paperclip <[email protected]>
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-03-27 08:38:41 +00:00
Artur MoreiraandPaperclip a8b71762d9 fix(news-platform): SSR domain routing, resilient homepage, Gitea deploy hook
- Forward X-Site-Host from Astro to the bridge so loopback calls use the public domain JSON
- Normalize newsproject.bitreport.pt.json (categories slug/label, wp on 127.0.0.1:8080)
- Degrade homepage/trending when WordPress is down instead of 500
- Extend webhook-deploy.sh for config/ and wordpress/ changes; add deploy-hook-server + systemd unit
- Document automatic Gitea webhook flow in docs/deployment.md; align DOMAINS_CONFIG_PATH env

Co-Authored-By: Paperclip <[email protected]>
Made-with: Cursor
2026-03-23 19:47:19 +00:00
Artur MoreiraandPaperclip 4eb6d37781 feat: build Astro 6 SSR frontend for multi-domain sports news platform
Complete implementation of BIT-349:

- Astro 6 SSR with @astrojs/node standalone adapter
- Multi-domain config system: reads config/domains/<host>.json on each request
- Homepage: HeroSection (3 featured), TrendingBar, LatestGrid, CategorySections
- Category page: filterable grid + pagination
- Article page: header, body, structured data, related articles, sidebar ad slot
- Dark/light theme toggle (no-flash, localStorage-backed)
- Sticky responsive header with mobile menu
- SEO: meta/OG/Twitter tags, schema.org (WebSite, NewsArticle, BreadcrumbList)
- Dynamic /sitemap.xml and /robots.txt (SSR)
- BridgeClient with in-process SWR cache (60s fresh / 5min stale)
- MockBridgeClient fallback when bridge is unreachable (dev-friendly)
- Performance: minimal client JS, lazy images, fetchpriority on LCP
- docs/frontend.md added

Build passes: npm run build OK
Smoke test: all routes 200 (/, /category/:slug, /article/:slug, /robots.txt, /sitemap.xml)

Paperclip-Agent: Artur (urlKey artur; id ac1be104-8818-496a-80c5-fbc590a87855)
Paperclip-Issue: BIT-349
Paperclip-Run: 407358da-8311-4b0a-9672-dda636bcf974
Co-Authored-By: Paperclip <[email protected]>
Made-with: Cursor
2026-03-23 14:17:59 +00:00