fix(export): hide recent-export row when no history

This commit is contained in:
aits2026
2026-03-05 20:24:55 +08:00
parent 7cea8b4fb3
commit 05c551d7ac
2 changed files with 6 additions and 28 deletions

View File

@@ -1877,20 +1877,6 @@
} }
} }
.row-export-meta {
display: inline-flex;
flex-direction: column;
align-items: center;
gap: 1px;
}
.row-export-meta-label {
font-size: 10px;
line-height: 1.2;
color: var(--text-tertiary);
font-weight: 500;
}
.row-export-time { .row-export-time {
font-size: 11px; font-size: 11px;
line-height: 1.2; line-height: 1.2;
@@ -1900,7 +1886,7 @@
text-align: center; text-align: center;
} }
.row-export-link.state-running + .row-export-meta .row-export-time { .row-export-link.state-running + .row-export-time {
color: var(--primary); color: var(--primary);
font-weight: 600; font-weight: 600;
} }
@@ -1911,11 +1897,6 @@
text-decoration: none; text-decoration: none;
} }
.row-export-link.state-disabled + .row-export-meta .row-export-meta-label,
.row-export-link.state-disabled + .row-export-meta .row-export-time {
color: var(--text-tertiary);
}
.row-export-link.state-disabled:hover:not(:disabled), .row-export-link.state-disabled:hover:not(:disabled),
.row-export-link.state-disabled:focus-visible { .row-export-link.state-disabled:focus-visible {
color: var(--text-tertiary); color: var(--text-tertiary);

View File

@@ -444,7 +444,7 @@ const formatPathBrief = (value: string, maxLength = 52): string => {
} }
const formatRecentExportTime = (timestamp?: number, now = Date.now()): string => { const formatRecentExportTime = (timestamp?: number, now = Date.now()): string => {
if (!timestamp) return '未导出' if (!timestamp) return ''
const diff = Math.max(0, now - timestamp) const diff = Math.max(0, now - timestamp)
const minute = 60 * 1000 const minute = 60 * 1000
const hour = 60 * minute const hour = 60 * minute
@@ -5067,7 +5067,9 @@ function ExportPage() {
const checked = canExport && selectedSessions.has(contact.username) const checked = canExport && selectedSessions.has(contact.username)
const isRunning = canExport && runningSessionIds.has(contact.username) const isRunning = canExport && runningSessionIds.has(contact.username)
const isQueued = canExport && queuedSessionIds.has(contact.username) const isQueued = canExport && queuedSessionIds.has(contact.username)
const recentExportTime = canExport ? formatRecentExportTime(lastExportBySession[contact.username], nowTick) : '—' const recentExportTimestamp = lastExportBySession[contact.username]
const hasRecentExport = canExport && Boolean(recentExportTimestamp)
const recentExportTime = hasRecentExport ? formatRecentExportTime(recentExportTimestamp, nowTick) : ''
const countedMessages = normalizeMessageCount(sessionMessageCounts[contact.username]) const countedMessages = normalizeMessageCount(sessionMessageCounts[contact.username])
const hintedMessages = normalizeMessageCount(matchedSession?.messageCountHint) const hintedMessages = normalizeMessageCount(matchedSession?.messageCountHint)
const displayedMessageCount = countedMessages ?? hintedMessages const displayedMessageCount = countedMessages ?? hintedMessages
@@ -5229,12 +5231,7 @@ function ExportPage() {
> >
{!canExport ? '暂无会话' : isRunning ? '导出中...' : isQueued ? '排队中' : '单会话导出'} {!canExport ? '暂无会话' : isRunning ? '导出中...' : isQueued ? '排队中' : '单会话导出'}
</button> </button>
{canExport && ( {hasRecentExport && <span className="row-export-time">{recentExportTime}</span>}
<div className="row-export-meta">
<span className="row-export-meta-label"></span>
<span className="row-export-time">{recentExportTime}</span>
</div>
)}
</div> </div>
</div> </div>
</div> </div>