From 16560e0b525846a1d970ac7ff8c908d5ee482791 Mon Sep 17 00:00:00 2001 From: Nicolas Cantu Date: Tue, 6 Jan 2026 00:59:38 +0100 Subject: [PATCH] series building --- components/ArticlesList.tsx | 1 + components/HomeView.tsx | 26 +++++++++++++++++++------- components/KeyIndicator.tsx | 11 +++++------ 3 files changed, 25 insertions(+), 13 deletions(-) diff --git a/components/ArticlesList.tsx b/components/ArticlesList.tsx index e393d99..175a4a5 100644 --- a/components/ArticlesList.tsx +++ b/components/ArticlesList.tsx @@ -12,6 +12,7 @@ interface ArticlesListProps { } function LoadingState() { + // Use generic loading message at startup, then specific message once we know what we're loading return (

{t('common.loading.articles')}

diff --git a/components/HomeView.tsx b/components/HomeView.tsx index edddc19..cc9fb4c 100644 --- a/components/HomeView.tsx +++ b/components/HomeView.tsx @@ -9,6 +9,7 @@ import { PageHeader } from '@/components/PageHeader' import { Footer } from '@/components/Footer' import { FundingGauge } from '@/components/FundingGauge' import type { Dispatch, SetStateAction } from 'react' +import { t } from '@/lib/i18n' interface HomeViewProps { searchQuery: string @@ -97,12 +98,19 @@ function HomeContent({ }: HomeViewProps) { const shouldShowFilters = !loading && allArticles.length > 0 const shouldShowAuthors = selectedCategory !== null && selectedCategory !== 'all' - const articlesListProps = { articles, allArticles, loading, error, onUnlock, unlockedArticles } - const authorsListProps = { authors, allAuthors, loading, error } - // Determine loading state: if showing authors, authors are loaded from articles, so loading is the same - // But we need to check if authors are actually being loaded (when no articles yet) - const authorsLoading = loading && shouldShowAuthors && allAuthors.length === 0 + // At startup, we don't know yet if we're loading articles or authors + // Use a generic loading message until we have content + const isInitialLoad = loading && allArticles.length === 0 && allAuthors.length === 0 + const articlesListProps = { + articles, + allArticles, + loading: loading && !isInitialLoad, // Don't show loading if it's the initial generic state + error, + onUnlock, + unlockedArticles + } + const authorsListProps = { authors, allAuthors, loading: loading && !isInitialLoad, error } return (
@@ -117,10 +125,14 @@ function HomeContent({ )} - {shouldShowAuthors ? ( + {isInitialLoad ? ( +
+

{t('common.loading')}

+
+ ) : shouldShowAuthors ? ( ) : ( - + )} diff --git a/components/KeyIndicator.tsx b/components/KeyIndicator.tsx index 4cf35b6..7789698 100644 --- a/components/KeyIndicator.tsx +++ b/components/KeyIndicator.tsx @@ -1,3 +1,4 @@ +import Link from 'next/link' import { useNostrAuth } from '@/hooks/useNostrAuth' export function KeyIndicator() { @@ -6,18 +7,16 @@ export function KeyIndicator() { // Red if private key is accessible (unlocked) // Green if only public key is accessible (connected but not unlocked) const color = isUnlocked ? 'text-red-500' : 'text-green-500' - const title = isUnlocked ? 'Private key accessible' : pubkey ? 'Public key accessible' : 'Repository Git' + const title = isUnlocked ? 'Private key accessible (Settings)' : pubkey ? 'Public key accessible (Settings)' : 'Settings' return ( - e.stopPropagation()} > 🔑 - + ) }