fix: move progress indicator outside reader and fix position tracking

- Move ReadingProgressIndicator outside reader div for true fixed positioning
- Replace position-indicator library with custom scroll tracking
- Track document scroll position instead of content scroll
- Remove unused position-indicator dependency
- Ensure progress indicator is always visible and shows correct percentage
This commit is contained in:
Gigi
2025-10-13 21:04:39 +02:00
parent ec34bc3d04
commit e921967082
4 changed files with 29 additions and 45 deletions

View File

@@ -374,8 +374,8 @@ const ContentPanel: React.FC<ContentPanelProps> = ({
const highlightRgb = hexToRgb(highlightColor)
return (
<div className="reader" style={{ '--highlight-rgb': highlightRgb } as React.CSSProperties}>
{/* Reading Progress Indicator */}
<>
{/* Reading Progress Indicator - Outside reader for fixed positioning */}
{isTextContent && (
<ReadingProgressIndicator
progress={progressPercentage}
@@ -384,7 +384,8 @@ const ContentPanel: React.FC<ContentPanelProps> = ({
/>
)}
{/* Hidden markdown preview to convert markdown to HTML */}
<div className="reader" style={{ '--highlight-rgb': highlightRgb } as React.CSSProperties}>
{/* Hidden markdown preview to convert markdown to HTML */}
{markdown && (
<div ref={markdownPreviewRef} style={{ display: 'none' }}>
<ReactMarkdown
@@ -590,7 +591,8 @@ const ContentPanel: React.FC<ContentPanelProps> = ({
<p>No readable content found for this URL.</p>
</div>
)}
</div>
</div>
</>
)
}