169 Commits

Author SHA1 Message Date
24d30eb5d0 lint fix wip 2026-01-07 17:09:07 +01:00
6d993bedc5 lint fix wip 2026-01-07 12:52:52 +01:00
86c8de87b2 lint fix wip 2026-01-07 12:37:23 +01:00
ddda722141 lint fix wip 2026-01-07 11:36:24 +01:00
b69dfc96e9 lint fix wip 2026-01-07 11:00:13 +01:00
e0c025908b lint fix wip 2026-01-07 04:21:54 +01:00
dace103da8 lint fix wip 2026-01-07 03:45:01 +01:00
17e4b10b1f lint fix wip 2026-01-07 03:10:40 +01:00
ff7b83d829 lint fix wip 2026-01-07 02:26:30 +01:00
790b8f6e25 lint fix wip 2026-01-07 02:24:24 +01:00
3c888e375a lint fix wip 2026-01-07 02:20:33 +01:00
64c94b6679 lint fix wip 2026-01-07 02:17:26 +01:00
d068b67deb lint fix wip 2026-01-07 02:11:40 +01:00
9f7a0e1527 lint fix wip 2026-01-07 02:06:09 +01:00
964f4aeb60 lint fix wip 2026-01-07 01:59:05 +01:00
b2e6250ff5 lint fix wip 2026-01-07 01:51:26 +01:00
7fdd71278e lint fix wip 2026-01-07 00:05:01 +01:00
a061cee73a lint fix wip 2026-01-06 23:40:47 +01:00
5677ca245d lint fix wip 2026-01-06 23:20:55 +01:00
dec7359dcd lint fix wip 2026-01-06 23:07:30 +01:00
fa1db1faa6 lint fix wip 2026-01-06 22:48:58 +01:00
ec50e564b2 lint fix wip 2026-01-06 22:43:48 +01:00
64e2f7f826 lint fix wip 2026-01-06 22:28:46 +01:00
f9fdf61d4d lint fix wip 2026-01-06 22:17:23 +01:00
d01ecb7402 lint fix wip 2026-01-06 22:13:46 +01:00
91fe30a860 lint fix wip 2026-01-06 21:52:38 +01:00
e97d2b32cc lint fix wip 2026-01-06 21:44:43 +01:00
b7d65a55c7 lint fix wip 2026-01-06 21:16:28 +01:00
cdd923e981 lint fix wip 2026-01-06 20:59:59 +01:00
9e364d0313 lint fix wip 2026-01-06 18:47:12 +01:00
07b9d9d7bb lint fix wip 2026-01-06 18:09:23 +01:00
e07a2cae53 lint fix wip 2026-01-06 18:03:18 +01:00
b08070d984 lint fix wip 2026-01-06 17:48:29 +01:00
c1442886cf lint fix wip 2026-01-06 17:45:45 +01:00
5b7b77aa9a lint fix wip 2026-01-06 17:10:07 +01:00
cc84d85193 lint fix wip 2026-01-06 16:44:12 +01:00
0e856d958e lint fix wip 2026-01-06 16:37:26 +01:00
cc0f3816fa lint fix wip 2026-01-06 16:35:15 +01:00
ccf2fdf759 lint fix wip 2026-01-06 16:10:08 +01:00
303c0bf7df lint fix wip 2026-01-06 15:57:34 +01:00
390f895920 lint fix wip 2026-01-06 15:41:58 +01:00
c8479efece Add missing language settings translations
**Motivations:**
- Missing translations for language settings in public locale files
- settings.language.title, settings.language.description, settings.language.french, and settings.language.english were missing from public/locales files

**Root causes:**
- Translations existed in locales/ but not in public/locales/
- LanguageSettingsManager component uses these keys but they were not available in public files

**Correctifs:**
- Added settings.language.title=Langue de préférence in public/locales/fr.txt
- Added settings.language.description=Choisissez votre langue préférée pour l'interface in public/locales/fr.txt
- Added settings.language.loading=Chargement... in public/locales/fr.txt
- Added settings.language.french=Français in public/locales/fr.txt
- Added settings.language.english=Anglais in public/locales/fr.txt
- Added settings.language.title=Preferred Language in public/locales/en.txt
- Added settings.language.description=Choose your preferred language for the interface in public/locales/en.txt
- Added settings.language.loading=Loading... in public/locales/en.txt
- Added settings.language.french=French in public/locales/en.txt
- Added settings.language.english=English in public/locales/en.txt

**Evolutions:**
- Language settings now display correctly in both French and English
- All translation keys are now available in public locale files

**Pages affectées:**
- public/locales/fr.txt
- public/locales/en.txt
2026-01-06 15:41:03 +01:00
a50d308578 lint fix wip 2026-01-06 15:35:06 +01:00
fbcf8fcd91 Add spinner and page reload after cache update
**Motivations:**
- User requested spinner during cache update and page reload after completion
- Better UX: visual feedback during update and automatic refresh to show updated data

**Root causes:**
- No visual spinner during cache update operation
- Page was not reloaded after cache update, requiring manual refresh

**Correctifs:**
- Added Spinner component with CSS animation
- Modified button to show spinner during update
- Added page reload using router.reload() after successful cache update
- Wait 1 second after success message before reloading to show feedback

**Evolutions:**
- Better user experience with visual feedback during cache update
- Automatic page reload ensures updated data is displayed immediately
- Spinner provides clear indication that operation is in progress

**Pages affectées:**
- components/CacheUpdateManager.tsx
2026-01-06 15:34:26 +01:00
29cb20c614 Fix authors not loading from cache on startup
**Motivations:**
- Authors were not being loaded from cache, causing 'Aucun contenu trouvé' message even when authors exist
- useArticles only loaded articles from Nostr subscription, not authors from cache
- Authors should be loaded from cache first (cache-first architecture)

**Root causes:**
- useArticles hook only subscribed to articles from Nostr, not loading authors from cache
- No method to get all authors from cache
- Authors were only extracted from articles returned by subscription, which may not include author presentations

**Correctifs:**
- Added getAll method to objectCache to retrieve all objects of a type from cache
- Modified useArticles to load authors from cache on startup before subscribing to Nostr
- Authors are now loaded from cache and merged with articles from subscription
- totalSponsoring is calculated for each author when loading from cache

**Evolutions:**
- Authors are now available immediately from cache on page load
- Better user experience: no 'Aucun contenu trouvé' when authors exist in cache
- Cache-first architecture: authors loaded from cache before Nostr subscription

**Pages affectées:**
- lib/objectCache.ts
- hooks/useArticles.ts
2026-01-06 15:33:02 +01:00
52bd9492b7 lint fix wip 2026-01-06 15:11:52 +01:00
f5d9033183 Refactor to use cache-first architecture with background sync
**Motivations:**
- total_sponsoring should be calculated from cache, not stored in tags
- Author searches should use cache first, not query Nostr directly
- All elements should be read/written from/to database
- Background sync should scan all notes with service='zapwall.fr' tag and update cache
- Sync should run at startup and resume on each page navigation

**Root causes:**
- total_sponsoring was stored in tags which required updates on every sponsoring payment
- Author queries were querying Nostr directly instead of using cache
- No background sync service to keep cache up to date with new notes

**Correctifs:**
- Removed totalSponsoring from AuthorTags interface and buildAuthorTags
- Modified getAuthorSponsoring to calculate from cache (sponsoring queries) instead of tags
- Modified parsePresentationEvent to set totalSponsoring to 0 (calculated on demand from cache)
- Modified fetchAuthorByHashId and fetchAuthorPresentationFromPool to use cache first and calculate totalSponsoring from cache
- Created platformSyncService that scans all notes with service='zapwall.fr' tag and caches them
- Modified _app.tsx to start continuous sync on mount and resume on page navigation
- All author presentations now calculate totalSponsoring from cache when loaded

**Evolutions:**
- Cache-first architecture: all queries check cache before querying Nostr
- Background sync service keeps cache up to date automatically
- totalSponsoring is always calculated from actual sponsoring data in cache
- Better performance: cache queries are faster than Nostr queries
- Non-blocking sync: background sync doesn't block UI

**Pages affectées:**
- lib/nostrTagSystemTypes.ts
- lib/nostrTagSystemBuild.ts
- lib/articlePublisherHelpersPresentation.ts
- lib/sponsoring.ts
- lib/authorQueries.ts
- lib/platformSync.ts (new)
- pages/_app.tsx
2026-01-06 15:04:14 +01:00
568ec17f03 Document language preference settings feature 2026-01-06 14:58:09 +01:00
cc49c9d7c1 Add language preference selector in settings
**Motivations:**
- Allow users to set their preferred language (fr/en) in the settings page
- Load language preference from localStorage at startup to configure the application locale

**Root causes:**
- Language preference was only available in the header via LanguageSelector component
- Language preference was stored in IndexedDB instead of localStorage
- No centralized language settings management in the settings page

**Correctifs:**
- Created LanguageSettingsManager component for settings page
- Migrated language storage from IndexedDB to localStorage for consistency
- Updated _app.tsx to load locale from localStorage synchronously at startup
- Updated useI18n hook to use localStorage instead of IndexedDB
- Updated LanguageSelector component to use localStorage instead of IndexedDB

**Evolutions:**
- Added language preference section in settings page (displayed first)
- Language preference is now loaded at application startup from localStorage
- Added translations for language settings (settings.language.*)

**Pages affectées:**
- components/LanguageSettingsManager.tsx (new)
- pages/settings.tsx
- pages/_app.tsx
- hooks/useI18n.ts
- components/LanguageSelector.tsx
- locales/fr.txt
- locales/en.txt
2026-01-06 14:57:38 +01:00
c39e732049 Fix author page to use structured JSON data instead of raw content
**Motivations:**
- The author page was displaying the raw note content (visible part) instead of using the structured JSON data
- This caused elements like 'Nouveau profil publié sur zapwall.fr' to appear, which should not be visible
- The page should follow the structure of the creation form for consistency

**Root causes:**
- AuthorPageHeader was using presentation.content which contains the raw note visible content
- The structured data (description, contentDescription) extracted from JSON tags was not being used for display

**Correctifs:**
- Modified AuthorPageHeader to use presentation.description and presentation.contentDescription instead of presentation.content
- Extract author name from title (format: 'Présentation de <name>')
- Display structured fields following the creation form structure: presentation personnelle and description du contenu
- Fixed TypeScript errors for null/undefined handling

**Evolutions:**
- Author page now displays data in a structured way matching the creation form
- Better user experience with clear sections for presentation and content description

**Pages affectées:**
- pages/author/[pubkey].tsx
2026-01-06 14:54:49 +01:00