diff --git a/apps/web_v1/src/App.css b/apps/web_v1/src/App.css index d71b236..cb972c6 100644 --- a/apps/web_v1/src/App.css +++ b/apps/web_v1/src/App.css @@ -922,6 +922,27 @@ gap: 2px; } +.explore-article-meta-line { + min-width: 0; + display: flex; + align-items: center; + justify-content: space-between; + gap: 8px; +} + +.explore-article-meta-line > :first-child { + min-width: 0; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.explore-article-list-time { + flex: 0 0 auto; + font-variant-numeric: tabular-nums; + white-space: nowrap; +} + .explore-article-title { display: -webkit-box; overflow: hidden; diff --git a/apps/web_v1/src/pages/workspace-explore.tsx b/apps/web_v1/src/pages/workspace-explore.tsx index 45f3caa..c4220de 100644 --- a/apps/web_v1/src/pages/workspace-explore.tsx +++ b/apps/web_v1/src/pages/workspace-explore.tsx @@ -407,7 +407,10 @@ export function WorkspaceExplorePage({ > {sourceInitial(itemSource.name)} - {itemSource.name} · {itemTime(item)} + + {itemSource.name} + {itemTime(item)} + {item.title} {item.summary || '暂无摘要'} @@ -565,7 +568,22 @@ function itemTime(item: DatasetItemDTO) { const value = item.publishedAt ?? item.createdAt const parsed = new Date(value) if (Number.isNaN(parsed.getTime())) return '' - return new Intl.DateTimeFormat('zh-CN', { dateStyle: 'medium' }).format(parsed) + const now = new Date() + const today = new Date(now.getFullYear(), now.getMonth(), now.getDate()) + const itemDate = new Date(parsed.getFullYear(), parsed.getMonth(), parsed.getDate()) + const dayDifference = Math.round((today.getTime() - itemDate.getTime()) / 86_400_000) + const dateLabel = dayDifference === 0 + ? '今天' + : dayDifference === 1 + ? '昨天' + : new Intl.DateTimeFormat('zh-CN', { month: 'numeric', day: 'numeric' }).format(parsed) + const timeLabel = new Intl.DateTimeFormat('zh-CN', { + hour: '2-digit', + minute: '2-digit', + second: '2-digit', + hourCycle: 'h23', + }).format(parsed) + return `${dateLabel} ${timeLabel}` } function sourceSubtitle(source: DatasetSourceDTO) {