diff --git a/src/app/medications/page-client.tsx b/src/app/medications/page-client.tsx index 8013d1f2b..544d2a86c 100644 --- a/src/app/medications/page-client.tsx +++ b/src/app/medications/page-client.tsx @@ -1,5 +1,6 @@ "use client"; +import { useRecordCapabilities } from "@/hooks/use-record-capabilities"; import { useCallback, useEffect, useState } from "react"; import { useQuery, useQueryClient } from "@tanstack/react-query"; import Link from "next/link"; @@ -159,6 +160,11 @@ function MedicationCardSkeleton() { export default function MedicationsPageClient() { const { user, isAuthenticated, isLoading: authLoading } = useAuth(); const { t } = useTranslations(); + // v1.36.x — adding a medication and marking a dose are both admitted + // delegated writes, so a WRITE delegate keeps the Add menu whole. The + // take-all-due sweep is not (it rides the bulk intake route), and neither is + // the customize page, which sharing does not cover at all. + const { canAdd, canManage } = useRecordCapabilities(); // v1.18.1 (D3) — medications is an opt-out module. When the account has it // turned off the whole page disappears (the nav entry is hidden by the same // gate) and the list query never fires (the API would 403 anyway). @@ -417,7 +423,7 @@ export default function MedicationsPageClient() { card's own one-tap job). Calm outline variant so the primary Add button keeps the visual lead; same responsive 44-px mobile tap floor as its neighbours. */} - {dueMeds.length >= 2 && ( + {canManage && dueMeds.length >= 2 && ( + +