From b6ad62a3ab8799b697153006b4f331665fa4e96b Mon Sep 17 00:00:00 2001 From: Gigi Date: Sun, 19 Oct 2025 10:41:02 +0200 Subject: [PATCH] refactor: rename to NIP-85 (kind 39802 for reading progress) - Rename NIP-39802.md to NIP-85.md - Update all references from NIP-39802 to NIP-85 in code comments - Add Table of Contents to NIP document - Update kinds.ts to reference NIP-85 and NIP-84 (highlights) - Maintain kind number 39802 for the event type NIP-85 is the specification number, 39802 is the event kind number. --- public/md/{NIP-39802.md => NIP-85.md} | 17 +++++++++++++++-- src/config/kinds.ts | 4 ++-- src/services/readingDataProcessor.ts | 6 +++--- src/services/readingPositionService.ts | 2 +- 4 files changed, 21 insertions(+), 8 deletions(-) rename public/md/{NIP-39802.md => NIP-85.md} (92%) diff --git a/public/md/NIP-39802.md b/public/md/NIP-85.md similarity index 92% rename from public/md/NIP-39802.md rename to public/md/NIP-85.md index 03ecb405..8bef6c5a 100644 --- a/public/md/NIP-39802.md +++ b/public/md/NIP-85.md @@ -1,10 +1,23 @@ -# NIP-39802 +# NIP-85 ## Reading Progress `draft` `optional` -This NIP defines a parameterized replaceable event kind for tracking reading progress across articles and web content. +This NIP defines kind `39802`, a parameterized replaceable event for tracking reading progress across articles and web content. + +## Table of Contents + +* [Event Kind](#event-kind) +* [Event Structure](#event-structure) + * [Tags](#tags) + * [Content](#content) + * [Semantics](#semantics) +* [Examples](#examples) +* [Querying](#querying) +* [Privacy Considerations](#privacy-considerations) +* [Rationale](#rationale) +* [Implementation Notes](#implementation-notes) ## Event Kind diff --git a/src/config/kinds.ts b/src/config/kinds.ts index ed3cca16..d8e6e9d8 100644 --- a/src/config/kinds.ts +++ b/src/config/kinds.ts @@ -1,9 +1,9 @@ // Nostr event kinds used throughout the application export const KINDS = { - Highlights: 9802, // NIP-?? user highlights + Highlights: 9802, // NIP-84 user highlights BlogPost: 30023, // NIP-23 long-form article AppData: 30078, // NIP-78 application data - ReadingProgress: 39802, // NIP-39802 reading progress + ReadingProgress: 39802, // NIP-85 reading progress List: 30001, // NIP-51 list (addressable) ListReplaceable: 30003, // NIP-51 replaceable list ListSimple: 10003, // NIP-51 simple list diff --git a/src/services/readingDataProcessor.ts b/src/services/readingDataProcessor.ts index bfd97d79..9dfbcc8a 100644 --- a/src/services/readingDataProcessor.ts +++ b/src/services/readingDataProcessor.ts @@ -3,7 +3,7 @@ import { ReadItem } from './readsService' import { fallbackTitleFromUrl } from '../utils/readItemMerge' import { KINDS } from '../config/kinds' -const READING_PROGRESS_KIND = KINDS.ReadingProgress // 39802 +const READING_PROGRESS_KIND = KINDS.ReadingProgress // 39802 - NIP-85 interface ReadArticle { id: string @@ -37,13 +37,13 @@ export function processReadingProgress( const content = JSON.parse(event.content) const position = content.progress || 0 - // Validate progress is between 0 and 1 (NIP-39802 requirement) + // Validate progress is between 0 and 1 (NIP-85 requirement) if (position < 0 || position > 1) { console.warn('Invalid progress value (must be 0-1):', position, 'event:', event.id.slice(0, 8)) continue } - // Use event.created_at as authoritative timestamp (NIP-39802 spec) + // Use event.created_at as authoritative timestamp (NIP-85 spec) const timestamp = event.created_at let itemId: string diff --git a/src/services/readingPositionService.ts b/src/services/readingPositionService.ts index 718d9869..5ea0e49a 100644 --- a/src/services/readingPositionService.ts +++ b/src/services/readingPositionService.ts @@ -7,7 +7,7 @@ import { publishEvent } from './writeService' import { RELAYS } from '../config/relays' import { KINDS } from '../config/kinds' -const READING_PROGRESS_KIND = KINDS.ReadingProgress // 39802 - NIP-39802 Reading Progress +const READING_PROGRESS_KIND = KINDS.ReadingProgress // 39802 - NIP-85 Reading Progress export interface ReadingPosition { position: number // 0-1 scroll progress