Consolidate duplicate utility functions into shared modules

Extract repeated helper functions from components into shared utils
(colors.ts, date.ts, file.ts) to reduce duplication:
- isLightColor, parseFilamentColor, hexToColorName → utils/colors.ts
- formatMediaTime, formatDurationFromHours → utils/date.ts
- formatFileSize guard hardened for NaN/negative → utils/file.ts
- formatBytes (ToastContext), formatTime (Timelapse*) deduplicated

Functions with subtly different behavior are intentionally kept local
(formatFilament, formatStorageSize, formatBytes, formatUptime,
formatDateTime, formatDate, formatTimeAgo) to preserve exact UI output.
This commit is contained in:
AneoPsy
2026-03-03 04:20:21 -10:00
parent 15521deb0a
commit abe40f1ed0
15 changed files with 507 additions and 577 deletions
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -23,7 +23,7 @@
<!-- Splash screens for iOS -->
<link rel="apple-touch-startup-image" href="/img/android-chrome-512x512.png" />
<script type="module" crossorigin src="/assets/index-PuCtc4fr.js"></script>
<script type="module" crossorigin src="/assets/index-BAl7JF0v.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-D5I4wfky.css">
</head>
<body>