mirror of
https://github.com/dergigi/boris.git
synced 2026-02-10 17:44:34 +01:00
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.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user