refactor(monitoring): simplify brand dashboard and harden citation rendering
- drop brand_time_buckets and sparkline/coverage UI; dashboard now returns a single day - compute mention rate from total actual samples instead of averaging per-platform rates - canonicalize ai_platform_id across services and aggregate platform-overview snapshots - strip mojibake and non-answer noise from callback payloads and question detail answers - keep Kimi citations panel-only; still store raw search_results for audit - render linked [n] inline citations for qwen/yuanbao answers with scroll-to-source behavior - restrict立即采集 to today's business date with a clear i18n hint - refresh content-citations into an ant-design table with truncation and hover styling Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import { aiPlatformCatalog } from "@geo/shared-types";
|
||||
|
||||
const monitoringPlatformIds = new Set(aiPlatformCatalog.map((item) => item.id));
|
||||
|
||||
export function normalizeMonitoringPlatformId(platformId?: string | null): string {
|
||||
return String(platformId ?? "").trim().toLowerCase();
|
||||
}
|
||||
|
||||
export function isMonitoringPlatformId(platformId?: string | null): boolean {
|
||||
const normalized = normalizeMonitoringPlatformId(platformId);
|
||||
return Boolean(normalized) && monitoringPlatformIds.has(normalized);
|
||||
}
|
||||
|
||||
export function normalizeMonitoringPlatformFilter(value: unknown): string {
|
||||
const normalized = normalizeMonitoringPlatformId(
|
||||
String(Array.isArray(value) ? value[0] ?? "" : value ?? ""),
|
||||
);
|
||||
if (!normalized) {
|
||||
return "all";
|
||||
}
|
||||
return monitoringPlatformIds.has(normalized) ? normalized : "all";
|
||||
}
|
||||
Reference in New Issue
Block a user