10 KiB
Session Summary - 2026-01-05
Author: Équipe 4NK Date: 2026-01-05
Overview
This document summarizes all modifications and implementations completed during this development session, focusing on object identification, caching, payment systems, A5 pages, and payment notes.
Major Features Implemented
1. Object Identification System
Objective: Implement a comprehensive object identification system with id, hash, version, and index fields for all objects.
Implementation:
- ID format:
<hash>_<index=0>_<version=0> - All objects now have:
id,hash,version,index - Hash generation using SHA-256 from canonical object representation
- Index management for duplicate hash handling
- Version management for object updates
Files Modified:
types/nostr.ts: Added fields to all object interfaceslib/urlGenerator.ts: AddedbuildObjectIdandparseObjectIdfunctionslib/hashIdGenerator.ts: Hash generation for all object typeslib/nostrEventParsing.ts: Updated to extract and construct new ID fieldslib/objectCache.ts: Updated IndexedDB cache to support new ID structure
Routes: All object routes now use the new ID format: https://zapwall.fr/<type>/<id>
2. IndexedDB Caching System
Objective: Implement per-object-type caching in IndexedDB with settings storage and last sync date tracking.
Implementation:
- Separate IndexedDB stores for each object type (author, series, publication, review, purchase, sponsoring, review_tip)
- Settings store (excluding keys) for platform configuration
- Last synchronized day tracking for background sync resumption
- Database migration system (DB_VERSION incremented to 2)
- New indexes:
hash,indexfor efficient lookups
Files Modified:
lib/objectCache.ts: Complete rewrite with new structurecomponents/CacheUpdateManager.tsx: User-facing cache update button
Features:
- Cache per object type
- Settings cache (excluding sensitive keys)
- Last sync date tracking
- Cache clearing and re-synchronization
3. Payment Objects Extension
Objective: Extend object/route/cache system to include article payments, sponsoring, and review acknowledgements.
Implementation:
- New object types:
Purchase,Sponsoring,ReviewTip - Routes:
/purchase/[id],/sponsoring/[id],/review-tip/[id] - Query functions:
purchaseQueries.ts,sponsoringQueries.ts,reviewTipQueries.ts - Cache support for all new object types
- Parsing from zap receipts (kind 9735)
Files Created:
lib/purchaseQueries.tslib/sponsoringQueries.tslib/reviewTipQueries.tspages/purchase/[id].tsxpages/sponsoring/[id].tsxpages/review-tip/[id].tsx
Files Modified:
types/nostr.ts: Added new interfaceslib/objectCache.ts: Added cache supportlib/nostrEventParsing.ts: Added parsing functionslib/userContentSync.ts: Added sync functions
4. A5 Page System for Publications
Objective: Implement A5-sized pages within series publications, supporting both Markdown and image content.
Implementation:
- New
Pageinterface:number,type: 'markdown' | 'image',content - Pages stored in article
pagesarray - Two-column Markdown editor with live preview
- Page management: add, remove, edit pages
- Image upload similar to profile photos
- Serialization in Nostr events (JSON tag)
- Display component for published articles
Files Created:
components/MarkdownEditorTwoColumns.tsx: Two-column editor with page managementcomponents/ArticlePages.tsx: Display component for A5 pages
Files Modified:
types/nostr.ts: AddedPageinterface andpagestoArticlelib/articlePublisherTypes.ts: AddedpagestoArticleDraftlib/articleInvoice.ts: Updated to include pages in JSON metadatalib/metadataExtractor.ts: Updated to extract pages from eventscomponents/ArticleEditorForm.tsx: Integrated two-column editorcomponents/ArticlePreview.tsx: Integrated page display
5. Optional Text Fields
Objective: Add optional plain text messages to reviews, review tips, and sponsoring.
Implementation:
- Added
text?: stringtoReview,ReviewTip,Sponsoringinterfaces - Parsing from Nostr event tags
- Display in UI components
- Included in zap request tags
Files Modified:
types/nostr.ts: Addedtextfieldlib/articleMutations.ts: UpdatedbuildReviewEventto include textlib/nostrEventParsing.ts: Updated parsing to extract textlib/zapRequestBuilder.ts: Updated to include text in zap requests
6. Review, Review Tip, and Sponsoring Forms
Objective: Create user-facing forms for creating reviews, sending review tips, and sponsoring authors.
Implementation:
ReviewForm: Create reviews with optional title, required content, optional textReviewTipForm: Send tips to reviewers with optional text messageSponsoringForm: Sponsor authors with optional text message (Bitcoin mainnet)
Files Created:
components/ReviewForm.tsxcomponents/ReviewTipForm.tsxcomponents/SponsoringForm.tsx
Files Modified:
components/ArticleReviews.tsx: Integrated review and tip formspages/series/[id].tsx: Integrated review displaypages/author/[pubkey].tsx: Integrated sponsoring formpublic/locales/fr.txtandpublic/locales/en.txt: Added translations
7. Full-Width Layout
Objective: Allow the site to take up the full screen width.
Implementation:
- Removed
max-w-*constraints from all pages - Updated layout classes across the application
Files Modified:
- All page components (
pages/*.tsx) components/HomeView.tsx
8. Funding Gauge Priorities
Objective: Set priorities for funding gauges: Priority 1 for AI, Priority 2 for Anchoring.
Implementation:
- Updated
components/FundingGauge.tsxto display two gauges with priorities - Added translations for certification gauge
Files Modified:
components/FundingGauge.tsxpublic/locales/fr.txtandpublic/locales/en.txt
9. Payment Notes System
Objective: Create explicit payment notes (kind 1) for all confirmed payments with project tags.
Implementation:
- Extended tag system with
'payment'type - Created
PaymentTagsinterface - Three publication functions:
publishPurchaseNote,publishReviewTipNote,publishSponsoringNote - Integration with payment confirmation flows
- Zap receipt query utilities
Files Created:
lib/paymentNotes.ts: Payment note publication functionslib/zapReceiptQueries.ts: Zap receipt query utilities
Files Modified:
lib/nostrTagSystemTypes.ts: AddedPaymentTagslib/nostrTagSystemBuild.ts: AddedbuildPaymentTagslib/paymentPollingMain.ts: Integrated purchase note publication
Documentation: See docs/payment-notes-system.md for detailed documentation.
Tag System Verification
Verified that all note creation functions use the buildTags helper:
buildSeriesEvent: ✅ UsesbuildTagsbuildReviewEvent: ✅ UsesbuildTagsbuildAuthorPresentationEvent: ✅ UsesbuildTagsbuildPreviewTags: ✅ UsesbuildTags- Zap requests: ✅ Include
kind_typeand relevant tags
Technical Details
Object ID Format
id: <hash>_<index>_<version>
hash: SHA-256 hash of canonical object representationindex: Index for duplicate hashes (default: 0)version: Version number for updates (default: 0)
IndexedDB Schema
- Stores:
author,series,publication,review,purchase,sponsoring,review_tip,settings - Indexes:
hash,index,version,hidden - Version: 2 (migrated from 1)
Payment Flow Integration
- Purchase: Zap receipt → Content delivery → Payment note publication
- Review Tip: Zap request → Zap receipt (via Alby) → Payment note publication (to be integrated)
- Sponsoring: Bitcoin transaction → Verification → Tracking → Payment note publication (to be integrated)
Internationalization
Added translations for:
- A5 pages (
page.*) - Reviews (
review.*) - Review tips (
reviewTip.*) - Sponsoring (
sponsoring.*) - Funding gauge priorities
- Common optional field label
Testing Considerations
- All new code compiles without TypeScript errors
- Linter checks pass
- No fallback mechanisms (as per project rules)
- Error handling with logging
- Non-blocking payment note publication
Known Limitations
- Review Tip Notes: Automatic publication after zap receipt confirmation not yet fully integrated
- Sponsoring Notes: Requires payer information at transaction submission time (currently not captured)
- Payment History UI: Not yet implemented (payment notes are published but not displayed in UI)
Next Steps
- Complete review tip note publication integration
- Improve sponsoring note publication with payer information capture
- Implement payment history UI
- Add payment aggregation queries
- Create payment search functionality
Files Summary
Created Files
lib/purchaseQueries.tslib/sponsoringQueries.tslib/reviewTipQueries.tslib/paymentNotes.tslib/zapReceiptQueries.tslib/zapRequestBuilder.tscomponents/MarkdownEditorTwoColumns.tsxcomponents/ArticlePages.tsxcomponents/ReviewForm.tsxcomponents/ReviewTipForm.tsxcomponents/SponsoringForm.tsxpages/purchase/[id].tsxpages/sponsoring/[id].tsxpages/review-tip/[id].tsx
Modified Files
types/nostr.tslib/urlGenerator.tslib/objectCache.tslib/nostrEventParsing.tslib/nostrTagSystemTypes.tslib/nostrTagSystemBuild.tslib/articlePublisherTypes.tslib/articleInvoice.tslib/metadataExtractor.tslib/articleMutations.tslib/paymentPollingMain.tslib/userContentSync.tscomponents/ArticleEditorForm.tsxcomponents/ArticlePreview.tsxcomponents/ArticleReviews.tsxcomponents/CacheUpdateManager.tsxcomponents/FundingGauge.tsxpages/series/[id].tsxpages/author/[pubkey].tsx- All page layout files (removed max-w constraints)
public/locales/fr.txtpublic/locales/en.txt
Related Documentation
docs/payment-notes-system.md: Detailed payment notes system documentationdocs/object-identification-system.md: Object ID system (if exists)docs/tag-system.md: Tag system documentation (if exists)