mirror of
https://github.com/dergigi/boris.git
synced 2025-12-23 01:24:19 +01:00
feat: improve reading progress with validation and auto-mark
- Add autoMarkAsReadOnCompletion setting (opt-in, default: false) - Implement auto-mark as read when reaching 95%+ completion - Add validation for progress bounds (0-1) per NIP-39802 spec - Align completion threshold to 95% to match filter behavior - Skip invalid progress events with warning log Improvements ensure consistency between completion detection and filtering, while adding safety validation per the NIP spec.
This commit is contained in:
@@ -189,9 +189,10 @@ const ContentPanel: React.FC<ContentPanelProps> = ({
|
||||
syncEnabled: settings?.syncReadingPosition,
|
||||
onSave: handleSavePosition,
|
||||
onReadingComplete: () => {
|
||||
// Optional: Auto-mark as read when reading is complete
|
||||
if (activeAccount && !isMarkedAsRead) {
|
||||
// Could trigger auto-mark as read here if desired
|
||||
// Auto-mark as read when reading is complete (if enabled in settings)
|
||||
if (activeAccount && !isMarkedAsRead && settings?.autoMarkAsReadOnCompletion) {
|
||||
console.log('📖 [ContentPanel] Auto-marking as read on completion')
|
||||
handleMarkAsRead()
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user