Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
10 changes: 9 additions & 1 deletion apps/web/src/components/header.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import { useState } from "react";
import { Link, useRouterState } from "@tanstack/react-router";
import { Menu, Newspaper, Bookmark, LayoutDashboard, User } from "lucide-react";
import {
Menu,
Newspaper,
Bookmark,
LayoutDashboard,
User,
BrainCircuit,
} from "lucide-react";
import { Button } from "@/components/ui/button";
import { LanguagePicker } from "@/components/LanguagePicker";
import { useScrollVisibility } from "@/hooks/use-scroll-visibility";
Expand All @@ -15,6 +22,7 @@ import {

const links = [
{ to: "/feed", key: "tabs.feed", icon: Newspaper },
{ to: "/quiz", key: "tabs.quiz", icon: BrainCircuit },
{ to: "/salvate", key: "tabs.saved", icon: Bookmark },
{ to: "/activitate", key: "tabs.activity", icon: LayoutDashboard },
{ to: "/profil", key: "tabs.profile", icon: User },
Expand Down
6 changes: 4 additions & 2 deletions apps/web/src/components/layout/MobileTabBar.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Bookmark, BarChart3, Newspaper, User } from "lucide-react";
import { Bookmark, BarChart3, BrainCircuit, Newspaper, User } from "lucide-react";
import { Link, useRouterState } from "@tanstack/react-router";
import type { ComponentType, MouseEvent } from "react";
import { useScrollVisibility } from "@/hooks/use-scroll-visibility";
Expand All @@ -13,6 +13,7 @@ type TabItem = {

type TabKey =
| "tabs.feed"
| "tabs.quiz"
| "tabs.saved"
| "tabs.activity"
| "tabs.profile";
Expand All @@ -29,6 +30,7 @@ const tabDefinitions: readonly TabDefinition[] = [
pathname.startsWith("/feed/") ||
pathname.startsWith("/event/"),
},
{ to: "/quiz", key: "tabs.quiz", icon: BrainCircuit },
{ to: "/salvate", key: "tabs.saved", icon: Bookmark },
{ to: "/activitate", key: "tabs.activity", icon: BarChart3 },
{ to: "/profil", key: "tabs.profile", icon: User },
Expand Down Expand Up @@ -68,7 +70,7 @@ export function MobileTabBar() {
style={{ paddingBottom: "calc(1rem + env(safe-area-inset-bottom, 0px))" }}
>
<div className="mx-auto max-w-md rounded-[1.4rem] border border-border bg-background/92 p-2 shadow-lg shadow-foreground/5 backdrop-blur-xl">
<div className="grid grid-cols-4 gap-1">
<div className="grid grid-cols-5 gap-1">
{tabDefinitions.map(({ to, key, icon: Icon, isActive: customIsActive }) => {
const isActive = customIsActive
? customIsActive(pathname)
Expand Down
114 changes: 110 additions & 4 deletions apps/web/src/lib/i18n/strings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const ro = {
"Biviant nu îți arată doar perspective diferite, ci îți arată exact ce susține fiecare parte, unde sunt de acord și unde apar distorsiuni.",
"router.notFound": "Pagina nu a fost găsită",
"tabs.feed": "Feed",
"tabs.quiz": "Quiz",
"tabs.saved": "Salvate",
"tabs.activity": "Activitate",
"tabs.profile": "Profil",
Expand Down Expand Up @@ -388,6 +389,58 @@ const ro = {
"coverage.title": "Acoperirea surselor",
"coverage.factual": "Factualitate",
"coverage.credibility": "Credibilitate",
"quiz.metaTitle": "Quizul zilnic — Biviant",
"quiz.metaDescription":
"Testează-ți atenția la știri cu 5 întrebări zilnice bazate pe afirmații și surse reale.",
"quiz.kicker": "Quiz zilnic",
"quiz.title": "Daily 5",
"quiz.subtitle":
"Cinci întrebări scurte care verifică ce ai înțeles din afirmațiile, sursele și unghiurile zilei.",
"quiz.loading.title": "Se încarcă quizul",
"quiz.loading.body": "Pregătim întrebările de azi.",
"quiz.empty.title": "Quizul de azi nu este gata",
"quiz.empty.body":
"Îl publicăm doar când există suficiente afirmații verificate și atribuite surselor. Între timp, poți explora feedul.",
"quiz.empty.action": "Deschide feedul",
"quiz.progress": "Întrebarea {current} din {total}",
"quiz.sourceLine": "Bazat pe relatări de la {source}",
"quiz.previous": "Înapoi",
"quiz.next": "Următoarea",
"quiz.finish": "Vezi scorul",
"quiz.submitting": "Se verifică...",
"quiz.submit.error": "Nu am putut trimite quizul. Încearcă din nou.",
"quiz.result.kicker": "Rezultatul tău",
"quiz.result.title": "{score}/{max} corecte",
"quiz.result.saved": "Scorul a fost salvat și ziua de streak a fost păstrată.",
"quiz.result.public":
"Scorul tău este afișat aici. Conectează-te ca să îl salvezi și să conteze la streak.",
"quiz.share.action": "Distribuie",
"quiz.share.title": "Quizul zilnic Biviant",
"quiz.share.text": "Am făcut {score}/{max} la quizul zilnic Biviant",
"quiz.share.copied": "Rezultatul a fost copiat",
"quiz.share.error": "Nu am putut distribui rezultatul.",
"quiz.backToFeed": "Înapoi la feed",
"quiz.signIn.title": "Salvează scorurile și streakul",
"quiz.signIn.body":
"Un cont gratuit păstrează rezultatele quizului, salvează streakul și îți sincronizează activitatea.",
"quiz.review.question": "Întrebarea {count}",
"quiz.review.correctAnswer": "Răspuns corect: {answer}",
"quiz.review.openEvent": "Vezi evenimentul",
"quiz.review.source": "Sursa",
"quiz.correct": "Corect",
"quiz.incorrect": "Greșit",
"quiz.type.claimAttribution": "Atribuirea afirmației",
"quiz.type.factCheck": "Fact check",
"quiz.type.perspectiveMatch": "Potrivire de perspectivă",
"quiz.type.coverageGap": "Lacună de acoperire",
"quiz.type.question": "Întrebare",
"quiz.cta.feedTitle": "Quizul de azi e momentul de revenire",
"quiz.cta.feedBody":
"Testează în 3 minute ce ai prins din afirmațiile și sursele zilei.",
"quiz.cta.activityTitle": "Păstrează streakul cu Daily 5",
"quiz.cta.activityBody":
"Quizul zilnic îți verifică atenția și contează ca activitate de azi.",
"quiz.cta.action": "Joacă quizul",
"bookmark.added": "Salvat",
"bookmark.removed": "Salvarea a fost eliminată",
"bookmark.error": "Ceva nu a mers bine. Încearcă din nou.",
Expand Down Expand Up @@ -417,8 +470,8 @@ const ro = {
"calendar.weekday.fri": "Vin",
"calendar.weekday.sat": "Sâm",
"calendar.weekday.sun": "Dum",
"calendar.eventsRead.one": "{count} eveniment citit",
"calendar.eventsRead.many": "{count} evenimente citite",
"calendar.eventsRead.one": "{count} activitate",
"calendar.eventsRead.many": "{count} activități",
"calendar.less": "Mai puțin",
"calendar.more": "Mai mult",
"reset.metaTitle": "Resetează parola — Biviant",
Expand Down Expand Up @@ -507,6 +560,7 @@ type BaseStrings = typeof ro;

const en: { [K in keyof BaseStrings]: string } = {
"tabs.feed": "Feed",
"tabs.quiz": "Quiz",
"seo.siteTitle": "Biviant — every news story broken down fact by fact",
"seo.siteDescription":
"Biviant doesn't just show you different perspectives. It shows you exactly what each side claims, where they agree, and where they spin.",
Expand Down Expand Up @@ -890,6 +944,58 @@ const en: { [K in keyof BaseStrings]: string } = {
"coverage.title": "Source coverage",
"coverage.factual": "Factual",
"coverage.credibility": "Credibility",
"quiz.metaTitle": "Daily News Quiz — Biviant",
"quiz.metaDescription":
"Test your news literacy with a daily quiz based on real claims, sources, and coverage gaps.",
"quiz.kicker": "Daily quiz",
"quiz.title": "Daily 5",
"quiz.subtitle":
"Five quick questions that test what you noticed about today’s claims, sources, and framing.",
"quiz.loading.title": "Loading today’s quiz",
"quiz.loading.body": "Preparing the latest questions.",
"quiz.empty.title": "Today’s quiz is not ready",
"quiz.empty.body":
"We only publish it when there are enough source-attributed claims to make it fair. Browse the feed while the pipeline catches up.",
"quiz.empty.action": "Open the feed",
"quiz.progress": "Question {current} of {total}",
"quiz.sourceLine": "Based on reporting from {source}",
"quiz.previous": "Back",
"quiz.next": "Next",
"quiz.finish": "See score",
"quiz.submitting": "Checking...",
"quiz.submit.error": "Could not submit the quiz. Please try again.",
"quiz.result.kicker": "Your result",
"quiz.result.title": "{score}/{max} correct",
"quiz.result.saved": "Your score was saved and today’s streak activity counted.",
"quiz.result.public":
"Your score is shown here. Sign in to save it and count it toward your streak.",
"quiz.share.action": "Share",
"quiz.share.title": "Biviant Daily News Quiz",
"quiz.share.text": "I scored {score}/{max} on today’s Biviant news quiz",
"quiz.share.copied": "Result copied",
"quiz.share.error": "Could not share this result.",
"quiz.backToFeed": "Back to feed",
"quiz.signIn.title": "Save scores and keep your streak",
"quiz.signIn.body":
"A free account saves quiz results, keeps your streak alive, and syncs your activity.",
"quiz.review.question": "Question {count}",
"quiz.review.correctAnswer": "Correct answer: {answer}",
"quiz.review.openEvent": "Open event",
"quiz.review.source": "Source",
"quiz.correct": "Correct",
"quiz.incorrect": "Incorrect",
"quiz.type.claimAttribution": "Claim attribution",
"quiz.type.factCheck": "Fact check",
"quiz.type.perspectiveMatch": "Perspective match",
"quiz.type.coverageGap": "Coverage gap",
"quiz.type.question": "Question",
"quiz.cta.feedTitle": "Today’s quiz is your return ritual",
"quiz.cta.feedBody":
"Spend three minutes testing what you caught about today’s claims and sources.",
"quiz.cta.activityTitle": "Keep your streak with Daily 5",
"quiz.cta.activityBody":
"The daily quiz checks your attention and counts as today’s activity.",
"quiz.cta.action": "Play quiz",
"bookmark.added": "Bookmarked",
"bookmark.removed": "Bookmark removed",
"bookmark.error": "Something went wrong. Please try again.",
Expand Down Expand Up @@ -918,8 +1024,8 @@ const en: { [K in keyof BaseStrings]: string } = {
"calendar.weekday.fri": "Fri",
"calendar.weekday.sat": "Sat",
"calendar.weekday.sun": "Sun",
"calendar.eventsRead.one": "{count} event read",
"calendar.eventsRead.many": "{count} events read",
"calendar.eventsRead.one": "{count} activity",
"calendar.eventsRead.many": "{count} activities",
"calendar.less": "Less",
"calendar.more": "More",
"reset.metaTitle": "Reset password — Biviant",
Expand Down
21 changes: 21 additions & 0 deletions apps/web/src/routeTree.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { Route as SitemapDotxmlRouteImport } from './routes/sitemap[.]xml'
import { Route as SalvateRouteImport } from './routes/salvate'
import { Route as RobotsDottxtRouteImport } from './routes/robots[.]txt'
import { Route as ResetPasswordRouteImport } from './routes/reset-password'
import { Route as QuizRouteImport } from './routes/quiz'
import { Route as ProfilRouteImport } from './routes/profil'
import { Route as PoliticaConfidentialitateRouteImport } from './routes/politica-confidentialitate'
import { Route as ParteneriRouteImport } from './routes/parteneri'
Expand Down Expand Up @@ -66,6 +67,11 @@ const ResetPasswordRoute = ResetPasswordRouteImport.update({
path: '/reset-password',
getParentRoute: () => rootRouteImport,
} as any)
const QuizRoute = QuizRouteImport.update({
id: '/quiz',
path: '/quiz',
getParentRoute: () => rootRouteImport,
} as any)
const ProfilRoute = ProfilRouteImport.update({
id: '/profil',
path: '/profil',
Expand Down Expand Up @@ -150,6 +156,7 @@ export interface FileRoutesByFullPath {
'/parteneri': typeof ParteneriRoute
'/politica-confidentialitate': typeof PoliticaConfidentialitateRoute
'/profil': typeof ProfilRoute
'/quiz': typeof QuizRoute
'/reset-password': typeof ResetPasswordRoute
'/robots.txt': typeof RobotsDottxtRoute
'/salvate': typeof SalvateRoute
Expand All @@ -173,6 +180,7 @@ export interface FileRoutesByTo {
'/parteneri': typeof ParteneriRoute
'/politica-confidentialitate': typeof PoliticaConfidentialitateRoute
'/profil': typeof ProfilRoute
'/quiz': typeof QuizRoute
'/reset-password': typeof ResetPasswordRoute
'/robots.txt': typeof RobotsDottxtRoute
'/salvate': typeof SalvateRoute
Expand All @@ -197,6 +205,7 @@ export interface FileRoutesById {
'/parteneri': typeof ParteneriRoute
'/politica-confidentialitate': typeof PoliticaConfidentialitateRoute
'/profil': typeof ProfilRoute
'/quiz': typeof QuizRoute
'/reset-password': typeof ResetPasswordRoute
'/robots.txt': typeof RobotsDottxtRoute
'/salvate': typeof SalvateRoute
Expand All @@ -222,6 +231,7 @@ export interface FileRouteTypes {
| '/parteneri'
| '/politica-confidentialitate'
| '/profil'
| '/quiz'
| '/reset-password'
| '/robots.txt'
| '/salvate'
Expand All @@ -245,6 +255,7 @@ export interface FileRouteTypes {
| '/parteneri'
| '/politica-confidentialitate'
| '/profil'
| '/quiz'
| '/reset-password'
| '/robots.txt'
| '/salvate'
Expand All @@ -268,6 +279,7 @@ export interface FileRouteTypes {
| '/parteneri'
| '/politica-confidentialitate'
| '/profil'
| '/quiz'
| '/reset-password'
| '/robots.txt'
| '/salvate'
Expand All @@ -292,6 +304,7 @@ export interface RootRouteChildren {
ParteneriRoute: typeof ParteneriRoute
PoliticaConfidentialitateRoute: typeof PoliticaConfidentialitateRoute
ProfilRoute: typeof ProfilRoute
QuizRoute: typeof QuizRoute
ResetPasswordRoute: typeof ResetPasswordRoute
RobotsDottxtRoute: typeof RobotsDottxtRoute
SalvateRoute: typeof SalvateRoute
Expand Down Expand Up @@ -355,6 +368,13 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof ResetPasswordRouteImport
parentRoute: typeof rootRouteImport
}
'/quiz': {
id: '/quiz'
path: '/quiz'
fullPath: '/quiz'
preLoaderRoute: typeof QuizRouteImport
parentRoute: typeof rootRouteImport
}
'/profil': {
id: '/profil'
path: '/profil'
Expand Down Expand Up @@ -468,6 +488,7 @@ const rootRouteChildren: RootRouteChildren = {
ParteneriRoute: ParteneriRoute,
PoliticaConfidentialitateRoute: PoliticaConfidentialitateRoute,
ProfilRoute: ProfilRoute,
QuizRoute: QuizRoute,
ResetPasswordRoute: ResetPasswordRoute,
RobotsDottxtRoute: RobotsDottxtRoute,
SalvateRoute: SalvateRoute,
Expand Down
18 changes: 18 additions & 0 deletions apps/web/src/routes/activitate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { useEffect, useMemo, useState } from "react";
import { formatRelativeTimestamp } from "@/lib/dates";
import {
Bookmark,
BrainCircuit,
ChevronRight,
Flame,
Newspaper,
Expand Down Expand Up @@ -401,6 +402,23 @@ function AuthorizedDashboard({
</div>
</div>

<section className="flex flex-col gap-3 rounded-xl border border-border bg-card p-4 sm:flex-row sm:items-center sm:justify-between sm:p-5">
<div className="flex items-start gap-3">
<div className="flex size-10 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary">
<BrainCircuit className="size-5" />
</div>
<div>
<h2 className="font-semibold">{t("quiz.cta.activityTitle")}</h2>
<p className="text-sm text-muted-foreground">
{t("quiz.cta.activityBody")}
</p>
</div>
</div>
<Button asChild size="sm" className="shrink-0">
<Link to="/quiz">{t("quiz.cta.action")}</Link>
</Button>
</section>

{/* Activity + Bias Row */}
<div className="grid gap-4 lg:grid-cols-[1.3fr_0.7fr]">
{/* Activity Calendar */}
Expand Down
24 changes: 23 additions & 1 deletion apps/web/src/routes/feed.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { useEffect, useMemo, useRef, useState } from "react";
import { createFileRoute } from "@tanstack/react-router";
import { createFileRoute, Link } from "@tanstack/react-router";
import { api } from "@news-app/backend/convex/_generated/api";
import type { Id } from "@news-app/backend/convex/_generated/dataModel";
import { useConvexAuth, usePaginatedQuery, useQuery } from "convex/react";
import {
BrainCircuitIcon,
CheckIcon,
ChevronDownIcon,
ClockIcon,
Expand Down Expand Up @@ -678,6 +679,27 @@ function FeedContent() {
/>
)}

{!isSearching && (
<section className="flex flex-col gap-3 rounded-xl border border-border bg-card/90 px-4 py-4 shadow-sm sm:flex-row sm:items-center sm:justify-between sm:px-5">
<div className="flex items-start gap-3">
<div className="flex size-10 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary">
<BrainCircuitIcon className="size-5" />
</div>
<div>
<h2 className="text-sm font-semibold">
{t("quiz.cta.feedTitle")}
</h2>
<p className="text-sm text-muted-foreground">
{t("quiz.cta.feedBody")}
</p>
</div>
</div>
<Button asChild size="sm" className="shrink-0">
<Link to="/quiz">{t("quiz.cta.action")}</Link>
</Button>
</section>
)}

<div className="grid gap-6">
{isSearching && searchResults === undefined && (
<div
Expand Down
Loading