diff --git a/src/components/ContentPanel.tsx b/src/components/ContentPanel.tsx index d9324bff..837b4314 100644 --- a/src/components/ContentPanel.tsx +++ b/src/components/ContentPanel.tsx @@ -61,6 +61,9 @@ interface ContentPanelProps { // For highlight creation onTextSelection?: (text: string) => void onClearSelection?: () => void + // For reading progress indicator positioning + isSidebarCollapsed?: boolean + isHighlightsCollapsed?: boolean } const ContentPanel: React.FC = ({ @@ -85,7 +88,9 @@ const ContentPanel: React.FC = ({ currentUserPubkey, followedPubkeys = new Set(), onTextSelection, - onClearSelection + onClearSelection, + isSidebarCollapsed = false, + isHighlightsCollapsed = false }) => { const [isMarkedAsRead, setIsMarkedAsRead] = useState(false) const [isCheckingReadStatus, setIsCheckingReadStatus] = useState(false) @@ -381,6 +386,8 @@ const ContentPanel: React.FC = ({ progress={progressPercentage} isComplete={isReadingComplete} showPercentage={true} + isSidebarCollapsed={isSidebarCollapsed} + isHighlightsCollapsed={isHighlightsCollapsed} /> )} diff --git a/src/components/ReadingProgressIndicator.tsx b/src/components/ReadingProgressIndicator.tsx index 8de3f907..2e46efa2 100644 --- a/src/components/ReadingProgressIndicator.tsx +++ b/src/components/ReadingProgressIndicator.tsx @@ -5,18 +5,36 @@ interface ReadingProgressIndicatorProps { isComplete?: boolean showPercentage?: boolean className?: string + isSidebarCollapsed?: boolean + isHighlightsCollapsed?: boolean } export const ReadingProgressIndicator: React.FC = ({ progress, isComplete = false, showPercentage = true, - className = '' + className = '', + isSidebarCollapsed = false, + isHighlightsCollapsed = false }) => { const clampedProgress = Math.min(100, Math.max(0, progress)) + // Calculate left and right offsets based on sidebar states + const leftOffset = isSidebarCollapsed + ? 'var(--sidebar-collapsed-width)' + : 'var(--sidebar-width)' + const rightOffset = isHighlightsCollapsed + ? 'var(--highlights-collapsed-width)' + : 'var(--highlights-width)' + return ( -
+