fix(growth): rank the rate board by a smoothed score

Show the real percentage on the card, but sort with delta / (baseline + prior) so a small baseline cannot dominate. Same-day publishes stay off the rate board.
This commit is contained in:
kairee committed 2026-11-02 22:06:41 +08:00
1 parent 0f2ac612f5
commit 39a6537f67
14 files changed
+158 -16

No files matched your search

+7
View File
@@ -52,6 +52,7 @@ DEFAULT_ANALYTICS: dict[str, Any] = {
"video_shrink_minutes": 60,
"shrink_minutes": None,
"home_growth_days": "auto",
"growth_rate_prior": 500,
}
DEFAULT_CONFIG: dict[str, Any] = {
@@ -210,6 +211,7 @@ class AnalyticsConfig:
video_shrink_minutes: int
shrink_minutes: int | None
home_growth_days: str | int
growth_rate_prior: int
@dataclass(frozen=True)
@@ -592,6 +594,11 @@ def _build_config(data: Mapping[str, Any], path: Path, *, secrets_path: Path) ->
)
),
home_growth_days=home_growth_days,
growth_rate_prior=_as_int(
analytics_raw.get("growth_rate_prior", 500),
"analytics.growth_rate_prior",
minimum=0,
),
)
return AppConfig(