feat(monitor): 作品栏和评论栏显示作品的发布日期
需求:抖音和小红书都要能看到作品的发布日期。 `MonitorNote.published_at` 其实**一直在库里**(ingest 早就按平台取:小红书 time、 抖音 create_time),只是从来没往 API 和界面上透 —— 后端序列化没这个键,前端类型里 也没有,所以界面上只有「首次发现」。 * 后端:list_notes 的序列化补上 published_at;_note_meta_map 也带上,于是 list_comments 多一个 note_published_at,分组接口的桶多一个 published_at。 * 前端:NotesTable 新增「发布日期」列(要让分组表头的 colspan 从 +4 变 +5); 评论栏作品那一层在标题旁显示日期 —— 同名作品不少,日期能帮着认。 * 新增 formatDate:发布日期问的是「哪一天发的」,绝对日期比「3天前」好认,也不会 每天看都在变。具体到分钟的版本放在 title 里,悬停可见。 刻意和「首次发现」分开:前者是作者发布的那天,后者是我们第一次看到它的那天。把一个 早就存在的作品加进监控时,两者能差好几个月 —— 测试里就用不同的值把这两者钉住。 顺带修正一处过时注释:前端类型里还写着 creator_name 是「已脱敏的昵称」, 脱敏已经在上一个提交里关掉了(config.MASK_NICKNAME)。 测试 +2:桶要带发布日期;作品列表接口要带,且它不等于 first_seen_at。
This commit is contained in:
@@ -25,7 +25,7 @@ import {
|
||||
useMonitorCommentsGrouped,
|
||||
} from '@/hooks/useMonitor'
|
||||
import { monitorApi } from '@/lib/api'
|
||||
import { formatRelative } from '@/lib/monitorFormat'
|
||||
import { formatDate, formatRelative } from '@/lib/monitorFormat'
|
||||
import type { CommentBucket, MonitorComment } from '@/types/monitor'
|
||||
|
||||
import { NoteCover } from './NoteCover'
|
||||
@@ -137,6 +137,15 @@ function CollapsibleGroup({
|
||||
noteId={bucket.note_id}
|
||||
/>
|
||||
</div>
|
||||
{/* 作品那一层光有标题不够 —— 同名的作品不少,发布日期能帮着认。 */}
|
||||
{bucket.published_at && (
|
||||
<span
|
||||
className="text-[10px] font-mono text-cyber-text-muted flex-shrink-0"
|
||||
title="作品发布时间"
|
||||
>
|
||||
{formatDate(bucket.published_at)}
|
||||
</span>
|
||||
)}
|
||||
<Badge variant="outline" className="text-[10px] px-1.5 py-0 flex-shrink-0">
|
||||
{bucket.comments.length} 条
|
||||
</Badge>
|
||||
|
||||
Reference in New Issue
Block a user