refactor(status-page): tighten the refined-theme conversion

Apply review feedback:
- Type the styles factory's return as a named RefinedStyles interface so the consumer no longer needs `as Function` / `as any` casts on factory entries
- Lift toneColor / toneSoft to shared/overallStatus alongside the existing OverallTone type — the next three themes will need the same mapping
- Reuse heatLevel() in the legacy classPrefix branch of ThemedInfrastructure so both API paths share one threshold table
- Memoize the styles map in RefinedStatusPage so MUI's sx processor sees referential equality across renders that don't actually change tokens
- Make the dual-API gate in ThemedHeatmap / ThemedHistogram require ALL relevant sx props together so a partial migration can't silently fall back to the legacy class path
This commit is contained in:
gorkem-bwl committed 2026-04-27 18:30:04 -04:00
1 parent 163f5ec1ec
commit b95d8886b9
6 files changed
+92 -68

No files matched your search

@@ -118,8 +118,8 @@ export const ThemedInfrastructure = ({ monitor, sxApi, classPrefix }: Props) =>
return (
<Box className={`${classPrefix}-infra`}>
{gauges.map((g) => {
const heatClass =
g.value > 85 ? `${classPrefix}-hot` : g.value > 70 ? `${classPrefix}-warm` : "";
const level = heatLevel(g.value);
const heatClass = level === "ok" ? "" : `${classPrefix}-${level}`;
return (
<Box
key={g.key}