fix(ui): log header counter reflects visible (filtered) count

When a text search is active, show 'X of Y entries' rather than the
loaded total, so the number matches what's on screen.
This commit is contained in:
hsiegeln
2026-04-17 13:19:51 +02:00
parent a2d55f7075
commit 07dbfb1391
2 changed files with 10 additions and 2 deletions

View File

@@ -901,7 +901,11 @@ export default function AgentHealth() {
<div className={logStyles.logHeader}>
<SectionHeader>Application Log</SectionHeader>
<div className={logStyles.headerActions}>
<span className={styles.sectionMeta}>{logStream.items.length} entries</span>
<span className={styles.sectionMeta}>
{filteredLogs.length === logStream.items.length
? `${filteredLogs.length} entries`
: `${filteredLogs.length} of ${logStream.items.length} entries`}
</span>
<Button variant="ghost" size="sm" onClick={() => setLogSortAsc((v) => !v)} title={logSortAsc ? 'Oldest first' : 'Newest first'}>
{logSortAsc ? '\u2191' : '\u2193'}
</Button>

View File

@@ -407,7 +407,11 @@ export default function AgentInstance() {
<div className={logStyles.logHeader}>
<SectionHeader>Application Log</SectionHeader>
<div className={logStyles.headerActions}>
<span className={styles.chartMeta}>{logStream.items.length} entries</span>
<span className={styles.chartMeta}>
{filteredLogs.length === logStream.items.length
? `${filteredLogs.length} entries`
: `${filteredLogs.length} of ${logStream.items.length} entries`}
</span>
<button className={logStyles.sortBtn} onClick={() => setLogSortAsc((v) => !v)} title={logSortAsc ? 'Oldest first' : 'Newest first'}>
{logSortAsc ? '\u2191' : '\u2193'}
</button>