mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-09 13:01:00 +00:00
refactor(v1.5): apply simplify-review safe-to-apply suggestions
Drops dead `id` props and `scroll-mt-28` classes from admin section components (load-bearing in v1.4 monolithic admin, dead since the v1.5 phase-4b dynamic-route split). Also removes the unused `LEGACY_ANCHOR_TO_SLUG` map, the `admin-shell` re-export shim, the `BERLIN_TZ` and duplicate `MS_PER_DAY` constants, the verbose `AdminSectionPage` docstring, the `useEffect` paraphrase comment in `ai-section`, and rewrites the `_exhaustive: never` exhaustiveness guard to the modern `slug satisfies never` form. `UserManagementSection` now reads `currentUserId` via `useAuth()` instead of accepting it as a prop. Findings 1, 2, 3, 4, 6, 7, 8, 11, 15, 16, 17 from .planning/phase-6-simplify-findings.md. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
79864bb8c2
commit
88c8db1abc
22 files changed
+41
-147
No files matched your search
@@ -16,10 +16,8 @@
|
||||
* does not produce 360 zero-rows of noise.
|
||||
*/
|
||||
|
||||
const BERLIN_TZ = "Europe/Berlin";
|
||||
|
||||
const BERLIN_DAY_FORMATTER = new Intl.DateTimeFormat("en-US", {
|
||||
timeZone: BERLIN_TZ,
|
||||
timeZone: "Europe/Berlin",
|
||||
year: "numeric",
|
||||
month: "2-digit",
|
||||
day: "2-digit",
|
||||
|
||||
@@ -17,8 +17,6 @@ import {
|
||||
} from "@/lib/insights/bucket-series";
|
||||
import { annotate } from "@/lib/logging/context";
|
||||
|
||||
const MS_PER_DAY = 24 * 60 * 60 * 1000;
|
||||
|
||||
const BERLIN_DAY_FORMATTER = new Intl.DateTimeFormat("en-US", {
|
||||
timeZone: "Europe/Berlin",
|
||||
year: "numeric",
|
||||
@@ -285,7 +283,7 @@ export async function generateMoodStatusForUser(
|
||||
// ~90-day window so the model still gets a recency-weighted view of
|
||||
// tag patterns. The mood DB query already pulls 3 years (no where
|
||||
// filter); we slice by date here, not by record count.
|
||||
const tagWindowCutoff = new Date(now.getTime() - 90 * MS_PER_DAY);
|
||||
const tagWindowCutoff = new Date(now.getTime() - 90 * 24 * 60 * 60 * 1000);
|
||||
const recentEntries = entries.filter(
|
||||
(entry) => entry.moodLoggedAt.getTime() >= tagWindowCutoff.getTime(),
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user