mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-19 08:12:52 +00:00
Merge branch 'fix/v1475-cleanup' into release/v1.47.5
# Conflicts: # src/__tests__/baselines/source-file-lines.json # src/__tests__/baselines/source-function-lines.json # src/__tests__/baselines/version-stamp-comments.json
This commit is contained in:
commit
d5dd05b5ac
164 files changed
+1109
-15288
No files matched your search
+1
-1
@@ -22,4 +22,4 @@ Every endpoint wraps its handler in `apiHandler` (`@/lib/api-handler`), parses a
|
||||
|
||||
## Conventions
|
||||
|
||||
See [`../../CLAUDE.md`](../../CLAUDE.md). The request-flow walk in `.planning/codebase/arch.md` annotates each layer with file:line citations. Related dirs: handlers compose [`../lib/`](../lib/README.md); pages render [`../components/`](../components/README.md).
|
||||
Related dirs: handlers compose [`../lib/`](../lib/README.md); pages render [`../components/`](../components/README.md).
|
||||
@@ -34,6 +34,7 @@ import { checkRateLimit, rateLimitHeaders } from "@/lib/rate-limit";
|
||||
import { resolveGlucoseUnit, type GlucoseUnit } from "@/lib/glucose";
|
||||
import { glucoseUnitPatchSchema } from "@/lib/validations/user-prefs";
|
||||
import { refreshTextsAfterUnitChange } from "@/lib/insights/unit-change-refresh";
|
||||
import { invalidateUserProfile } from "@/lib/cache/invalidate";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
@@ -103,9 +104,11 @@ export const PATCH = apiHandler(async (req: Request) => {
|
||||
},
|
||||
});
|
||||
|
||||
// The status notes and narratives quote glucose in this unit; re-warm
|
||||
// them so today's stored text does not keep the old one.
|
||||
// The targets payload and the status notes and narratives carry glucose in
|
||||
// this unit: evict the cached payloads and re-warm today's stored text so
|
||||
// neither keeps the old one.
|
||||
if (resolveGlucoseUnit(previous?.glucoseUnit) !== next) {
|
||||
invalidateUserProfile(user.id);
|
||||
void refreshTextsAfterUnitChange(user.id);
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,10 @@ describe("GET /api/version", () => {
|
||||
);
|
||||
expect(body.data.license).toBe("PolyForm-Noncommercial-1.0.0");
|
||||
expect(body.data.repository).toContain("github.com");
|
||||
expect(body.data.changelog).toContain("CHANGELOG");
|
||||
// The release notes, not the multi-megabyte CHANGELOG.md.
|
||||
expect(body.data.changelog).toBe(
|
||||
"https://github.com/MBombeck/HealthLog/releases",
|
||||
);
|
||||
expect(body.data.docs).toContain("docs.healthlog.dev");
|
||||
});
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ export const GET = apiHandler(async () => {
|
||||
builtAt,
|
||||
license: "PolyForm-Noncommercial-1.0.0",
|
||||
repository: "https://github.com/MBombeck/HealthLog",
|
||||
changelog: "https://github.com/MBombeck/HealthLog/blob/main/CHANGELOG.md",
|
||||
changelog: "https://github.com/MBombeck/HealthLog/releases",
|
||||
docs: "https://docs.healthlog.dev",
|
||||
offlineGeoEnabled,
|
||||
geoProviderHost,
|
||||
|
||||
@@ -21,7 +21,7 @@ export default function IntakeHistoryRedirectPage({
|
||||
const router = useRouter();
|
||||
|
||||
useEffect(() => {
|
||||
router.replace(`/medications/${id}?tab=verlauf`);
|
||||
router.replace(`/medications/${id}?tab=history`);
|
||||
}, [id, router]);
|
||||
|
||||
return (
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
/**
|
||||
* v1.15.18 — the `/medications/[id]` detail page is the tabbed shell.
|
||||
*
|
||||
* The page owns auth + the medication read and delegates the rest to
|
||||
* `<MedicationDetailTabs>` (the tab strip, `?tab=` URL state, the hero
|
||||
* and the wizard / advanced affordances). Source-level guards (the page
|
||||
* is a client component with `use()` + hooks, so a full render is
|
||||
* heavier than the contract warrants):
|
||||
* - it renders `MedicationDetailTabs` and nothing tab-specific itself;
|
||||
* - it carries no `TodaysDoseCard` (lives only on the list page);
|
||||
* - it hosts neither the wizard nor the modal advanced sheet directly
|
||||
* (those live inside the tab component).
|
||||
*/
|
||||
|
||||
import { readFileSync } from "node:fs";
|
||||
import { join } from "node:path";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
const source = readFileSync(
|
||||
join(process.cwd(), "src/app/medications/[id]/page.tsx"),
|
||||
"utf8",
|
||||
);
|
||||
|
||||
describe("medication detail page is the tabbed shell (v1.15.18)", () => {
|
||||
it("delegates to MedicationDetailTabs", () => {
|
||||
expect(source).toContain("MedicationDetailTabs");
|
||||
});
|
||||
|
||||
it("does not import or render TodaysDoseCard", () => {
|
||||
expect(source).not.toContain("TodaysDoseCard");
|
||||
expect(source).not.toContain("todays-dose-card");
|
||||
});
|
||||
|
||||
it("does not host the wizard or the modal advanced sheet directly", () => {
|
||||
expect(source).not.toContain("AdvancedSettingsSheet");
|
||||
expect(source).not.toContain("MedicationWizardDialog");
|
||||
});
|
||||
});
|
||||
@@ -435,7 +435,7 @@ export default function MedicationsPageClient() {
|
||||
|
||||
function openHistory(med: Medication) {
|
||||
seedDetail(med);
|
||||
router.push(`/medications/${med.id}?tab=verlauf`);
|
||||
router.push(`/medications/${med.id}?tab=history`);
|
||||
}
|
||||
|
||||
function closeDialog() {
|
||||
|
||||
Reference in new issue
Block a user