feat: display article summary in header

- Add summary field to ReadableContent interface
- Pass summary through ContentPanel to ReaderHeader
- Display summary below title in both overlay and standard layouts
- Style summary with reading font for consistency
- Summary appears in white with shadow in image overlays
- Summary appears in gray (#aaa) in standard headers
- Enhances article preview and reading experience
This commit is contained in:
Gigi
2025-10-08 12:35:05 +01:00
parent 1609c6e580
commit fea425b5d0
5 changed files with 28 additions and 8 deletions

View File

@@ -19,6 +19,7 @@ interface ContentPanelProps {
markdown?: string markdown?: string
selectedUrl?: string selectedUrl?: string
image?: string image?: string
summary?: string
highlights?: Highlight[] highlights?: Highlight[]
showHighlights?: boolean showHighlights?: boolean
highlightStyle?: 'marker' | 'underline' highlightStyle?: 'marker' | 'underline'
@@ -40,6 +41,7 @@ const ContentPanel: React.FC<ContentPanelProps> = ({
markdown, markdown,
selectedUrl, selectedUrl,
image, image,
summary,
highlights = [], highlights = [],
showHighlights = true, showHighlights = true,
highlightStyle = 'marker', highlightStyle = 'marker',
@@ -117,6 +119,7 @@ const ContentPanel: React.FC<ContentPanelProps> = ({
<ReaderHeader <ReaderHeader
title={title} title={title}
image={image} image={image}
summary={summary}
readingTimeText={readingStats ? readingStats.text : null} readingTimeText={readingStats ? readingStats.text : null}
hasHighlights={hasHighlights} hasHighlights={hasHighlights}
highlightCount={relevantHighlights.length} highlightCount={relevantHighlights.length}

View File

@@ -5,6 +5,7 @@ import { faHighlighter, faClock } from '@fortawesome/free-solid-svg-icons'
interface ReaderHeaderProps { interface ReaderHeaderProps {
title?: string title?: string
image?: string image?: string
summary?: string
readingTimeText?: string | null readingTimeText?: string | null
hasHighlights: boolean hasHighlights: boolean
highlightCount: number highlightCount: number
@@ -13,6 +14,7 @@ interface ReaderHeaderProps {
const ReaderHeader: React.FC<ReaderHeaderProps> = ({ const ReaderHeader: React.FC<ReaderHeaderProps> = ({
title, title,
image, image,
summary,
readingTimeText, readingTimeText,
hasHighlights, hasHighlights,
highlightCount highlightCount
@@ -24,6 +26,7 @@ const ReaderHeader: React.FC<ReaderHeaderProps> = ({
{title && ( {title && (
<div className="reader-header-overlay"> <div className="reader-header-overlay">
<h2 className="reader-title">{title}</h2> <h2 className="reader-title">{title}</h2>
{summary && <p className="reader-summary">{summary}</p>}
<div className="reader-meta"> <div className="reader-meta">
{readingTimeText && ( {readingTimeText && (
<div className="reading-time"> <div className="reading-time">
@@ -49,6 +52,7 @@ const ReaderHeader: React.FC<ReaderHeaderProps> = ({
{title && ( {title && (
<div className="reader-header"> <div className="reader-header">
<h2 className="reader-title">{title}</h2> <h2 className="reader-title">{title}</h2>
{summary && <p className="reader-summary">{summary}</p>}
<div className="reader-meta"> <div className="reader-meta">
{readingTimeText && ( {readingTimeText && (
<div className="reading-time"> <div className="reading-time">

View File

@@ -105,6 +105,7 @@ const ThreePaneLayout: React.FC<ThreePaneLayoutProps> = (props) => {
html={props.readerContent?.html} html={props.readerContent?.html}
markdown={props.readerContent?.markdown} markdown={props.readerContent?.markdown}
image={props.readerContent?.image} image={props.readerContent?.image}
summary={props.readerContent?.summary}
selectedUrl={props.selectedUrl} selectedUrl={props.selectedUrl}
highlights={props.classifiedHighlights} highlights={props.classifiedHighlights}
showHighlights={props.showHighlights} showHighlights={props.showHighlights}

View File

@@ -501,17 +501,19 @@ body {
} }
.reader-header { .reader-header {
display: flex; margin-bottom: 2rem;
align-items: center;
justify-content: space-between;
margin-bottom: 1rem;
gap: 1rem;
flex-wrap: wrap;
} }
.reader-title { .reader-title {
margin: 0; margin: 0 0 0.75rem 0;
flex: 1; font-family: var(--reading-font);
}
.reader-summary {
color: #aaa;
font-size: 1.1rem;
line-height: 1.5;
margin: 0 0 1rem 0;
font-family: var(--reading-font); font-family: var(--reading-font);
} }
@@ -1098,6 +1100,15 @@ body {
margin-bottom: 0.75rem; margin-bottom: 0.75rem;
} }
.reader-header-overlay .reader-summary {
color: rgba(255, 255, 255, 0.9);
font-size: 1.1rem;
line-height: 1.5;
margin: 0 0 1rem 0;
text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
font-family: var(--reading-font);
}
.reader-header-overlay .reader-meta { .reader-header-overlay .reader-meta {
display: flex; display: flex;
align-items: center; align-items: center;

View File

@@ -7,6 +7,7 @@ export interface ReadableContent {
html?: string html?: string
markdown?: string markdown?: string
image?: string image?: string
summary?: string
} }
interface CachedContent { interface CachedContent {