feat: split 'To read' filter into 'Unopened' and 'Started'

- Add 'unopened' filter (no progress, 0%) - uses fa-envelope icon
- Add 'started' filter (0-10% progress) - uses fa-envelope-open icon
- Remove 'to-read' filter
- Use classic/regular variant for envelope icons
- Update filter logic in BookmarkList and Me components
- New filter ranges:
  - Unopened: 0% (never opened)
  - Started: 0-10% (opened but not read far)
  - Reading: 11-94%
  - Completed: 95-100%
This commit is contained in:
Gigi
2025-10-16 00:13:34 +02:00
parent e0869c436b
commit 165d10c49b
3 changed files with 15 additions and 8 deletions

View File

@@ -116,9 +116,12 @@ export const BookmarkList: React.FC<BookmarkListProps> = ({
}
switch (readingProgressFilter) {
case 'to-read':
// 0-10% reading progress (has tracking data)
return position !== undefined && position >= 0 && position <= 0.10
case 'unopened':
// No reading progress - never opened
return !position || position === 0
case 'started':
// 0-10% reading progress - opened but not read far
return position !== undefined && position > 0 && position <= 0.10
case 'reading':
// Has some progress but not completed (11% - 94%)
return position !== undefined && position > 0.10 && position <= 0.94

View File

@@ -191,8 +191,11 @@ const Me: React.FC<MeProps> = ({ relayPool, activeTab: propActiveTab, pubkey: pr
// but since these are all marked as read, we only care about the 'all' and 'completed' filters
switch (readingProgressFilter) {
case 'to-read':
// Marked articles are never "to-read"
case 'unopened':
// Marked articles are never "unopened"
return false
case 'started':
// Marked articles are never "started"
return false
case 'reading':
// Marked articles are never "in progress"

View File

@@ -1,9 +1,9 @@
import React from 'react'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faBookOpen, faCheckCircle, faAsterisk } from '@fortawesome/free-solid-svg-icons'
import { faBookmark } from '@fortawesome/free-regular-svg-icons'
import { faEnvelope, faEnvelopeOpen } from '@fortawesome/free-regular-svg-icons'
export type ReadingProgressFilterType = 'all' | 'to-read' | 'reading' | 'completed'
export type ReadingProgressFilterType = 'all' | 'unopened' | 'started' | 'reading' | 'completed'
interface ReadingProgressFiltersProps {
selectedFilter: ReadingProgressFilterType
@@ -13,7 +13,8 @@ interface ReadingProgressFiltersProps {
const ReadingProgressFilters: React.FC<ReadingProgressFiltersProps> = ({ selectedFilter, onFilterChange }) => {
const filters = [
{ type: 'all' as const, icon: faAsterisk, label: 'All' },
{ type: 'to-read' as const, icon: faBookmark, label: 'To Read' },
{ type: 'unopened' as const, icon: faEnvelope, label: 'Unopened' },
{ type: 'started' as const, icon: faEnvelopeOpen, label: 'Started' },
{ type: 'reading' as const, icon: faBookOpen, label: 'Reading' },
{ type: 'completed' as const, icon: faCheckCircle, label: 'Completed' }
]