Fix stats command flow and tracking metrics regressions

- Route default `subminer stats` through attached `--stats`; keep daemon path for `--background`/`--stop`
- Update overview metrics: lookup rate uses lifetime Yomitan lookups per 100 tokens; new words dedupe by headword
- Suppress repeated macOS `Overlay loading...` OSD during fullscreen tracker flaps and improve session-detail chart scaling
- Add/adjust launcher, tracker query, stats server, IPC, overlay, and stats UI regression tests; add changelog fragments
This commit is contained in:
2026-03-19 15:46:52 -07:00
parent 274b0619ac
commit f2d6c70019
37 changed files with 1093 additions and 190 deletions

View File

@@ -29,6 +29,7 @@ interface AnimeGroup {
totalCards: number;
totalWords: number;
totalActiveMs: number;
totalKnownWords: number;
}
function groupSessionsByDay(sessions: SessionSummary[]): Map<string, SessionSummary[]> {
@@ -65,6 +66,7 @@ function groupSessionsByAnime(sessions: SessionSummary[]): AnimeGroup[] {
existing.totalCards += session.cardsMined;
existing.totalWords += displayWordCount;
existing.totalActiveMs += session.activeWatchedMs;
existing.totalKnownWords += session.knownWordsSeen;
} else {
map.set(key, {
key,
@@ -75,6 +77,7 @@ function groupSessionsByAnime(sessions: SessionSummary[]): AnimeGroup[] {
totalCards: session.cardsMined,
totalWords: displayWordCount,
totalActiveMs: session.activeWatchedMs,
totalKnownWords: session.knownWordsSeen,
});
}
}
@@ -173,6 +176,12 @@ function SessionItem({
</div>
<div className="text-ctp-overlay2">tokens</div>
</div>
<div>
<div className="text-ctp-green font-medium font-mono tabular-nums">
{formatNumber(session.knownWordsSeen)}
</div>
<div className="text-ctp-overlay2">known words</div>
</div>
</div>
</button>
<button
@@ -258,6 +267,12 @@ function AnimeGroupRow({
</div>
<div className="text-ctp-overlay2">tokens</div>
</div>
<div>
<div className="text-ctp-green font-medium font-mono tabular-nums">
{formatNumber(group.totalKnownWords)}
</div>
<div className="text-ctp-overlay2">known words</div>
</div>
</div>
<div
className={`text-ctp-overlay2 text-xs transition-transform ${expanded ? 'rotate-90' : ''}`}
@@ -327,6 +342,12 @@ function AnimeGroupRow({
</div>
<div className="text-ctp-overlay2">tokens</div>
</div>
<div>
<div className="text-ctp-green font-medium font-mono tabular-nums">
{formatNumber(s.knownWordsSeen)}
</div>
<div className="text-ctp-overlay2">known words</div>
</div>
</div>
</button>
<button