From 8bd5d7aadfbcf2c82aede4bc20b4082d0381f8bc Mon Sep 17 00:00:00 2001 From: Gigi Date: Fri, 10 Oct 2025 21:43:55 +0100 Subject: [PATCH] fix: move long article summaries below image on mobile to prevent overlay issues --- src/components/ReaderHeader.tsx | 59 +++++++++++++++++++-------------- src/index.css | 23 +++++++++++++ 2 files changed, 57 insertions(+), 25 deletions(-) diff --git a/src/components/ReaderHeader.tsx b/src/components/ReaderHeader.tsx index b1890900..970b1b59 100644 --- a/src/components/ReaderHeader.tsx +++ b/src/components/ReaderHeader.tsx @@ -28,36 +28,45 @@ const ReaderHeader: React.FC = ({ }) => { const cachedImage = useImageCache(image, settings) const formattedDate = published ? format(new Date(published * 1000), 'MMM d, yyyy') : null + const isLongSummary = summary && summary.length > 150 + if (cachedImage) { return ( -
- {title - {formattedDate && ( -
- {formattedDate} -
- )} - {title && ( -
-

{title}

- {summary &&

{summary}

} -
- {readingTimeText && ( -
- - {readingTimeText} -
- )} - {hasHighlights && ( -
- - {highlightCount} highlight{highlightCount !== 1 ? 's' : ''} -
- )} + <> +
+ {title + {formattedDate && ( +
+ {formattedDate}
+ )} + {title && ( +
+

{title}

+ {summary &&

{summary}

} +
+ {readingTimeText && ( +
+ + {readingTimeText} +
+ )} + {hasHighlights && ( +
+ + {highlightCount} highlight{highlightCount !== 1 ? 's' : ''} +
+ )} +
+
+ )} +
+ {isLongSummary && ( +
+

{summary}

)} -
+ ) } diff --git a/src/index.css b/src/index.css index e3bde3ef..e8d42461 100644 --- a/src/index.css +++ b/src/index.css @@ -1437,6 +1437,29 @@ body.mobile-sidebar-open { border: 1px solid rgba(100, 108, 255, 0.4); } +.reader-summary-below-image { + display: none; +} + +@media (max-width: 768px) { + .reader-header-overlay .reader-summary.hide-on-mobile { + display: none; + } + + .reader-summary-below-image { + display: block; + padding: 0 0 1.5rem 0; + margin-top: -1rem; + } + + .reader-summary-below-image .reader-summary { + color: #aaa; + font-size: 1rem; + line-height: 1.6; + margin: 0; + } +} + /* Private Bookmark Styles */ .private-bookmark { background: #2a2a2a;