({ t: p.t, value: p.value })),
- }}
- startMs={startMs}
- doseChanges={dto.markers.doseChanges}
- pauses={dto.markers.pauses}
- adherence={dto.adherence.map((a) => ({
- date: a.date,
- rate: a.rate,
- }))}
- timezone={timezone}
- startLabel={t("medications.efficacy.startMarker")}
- adherenceLabel={t("medications.efficacy.adherenceLane")}
- typicalRangeLabel={t("medications.efficacy.typicalRange")}
- />
+
+
+
+
+
({ t: p.t, value: p.value })),
+ }}
+ startMs={startMs}
+ doseChanges={dto.markers.doseChanges}
+ pauses={dto.markers.pauses}
+ adherence={dto.adherence.map((a) => ({
+ date: a.date,
+ rate: a.rate,
+ }))}
+ timezone={timezone}
+ startLabel={t("medications.efficacy.startMarker")}
+ adherenceLabel={t("medications.efficacy.adherenceLane")}
+ typicalRangeLabel={t("medications.efficacy.typicalRange")}
+ mode={scaleMode}
+ />
+
) : (
{t("medications.efficacy.noSeries")}
diff --git a/src/components/medications/detail/medication-detail-tabs.tsx b/src/components/medications/detail/medication-detail-tabs.tsx
index 1b520fbc7..9454035c6 100644
--- a/src/components/medications/detail/medication-detail-tabs.tsx
+++ b/src/components/medications/detail/medication-detail-tabs.tsx
@@ -51,6 +51,8 @@ import { resolveMedicationTargets } from "@/lib/medications/med-target-map";
import { MedicationDetailSection } from "@/components/medications/medication-detail-section";
import { MedicationComplianceBars } from "@/components/medications/card-parts/medication-compliance-bars";
import { DoseHistoryLedger } from "@/components/medications/dose-history-ledger";
+import { IntakeHistoryListV2 } from "@/components/medications/intake-history-list-v2";
+import { SegmentedToggle } from "@/components/medications/detail/segmented-toggle";
import { ScheduleTimesEditor } from "@/components/medications/scheduling/schedule-times-editor";
import { ScheduleHistoryTimeline } from "@/components/medications/scheduling/schedule-history-timeline";
import type { DoseWindowEntry } from "@/components/medications/scheduling/dose-window";
@@ -232,6 +234,10 @@ export function MedicationDetailTabs({
const [editOpen, setEditOpen] = useState(shouldOpenEditFromUrl);
const [importOpen, setImportOpen] = useState(false);
const [phaseSheetOpen, setPhaseSheetOpen] = useState(false);
+ // Verlauf tab: the schedule-expanded ledger covers only a trailing 90-day
+ // window; "all" swaps in the full paginated intake history so older doses
+ // stay reachable.
+ const [historyView, setHistoryView] = useState<"recent" | "all">("recent");
const id = medication.id;
const oneShot = medication.oneShot === true;
@@ -682,22 +688,44 @@ export function MedicationDetailTabs({
Slot zuordnen?" nudge). CSV import lives under Erweitert →
Daten (the DataPortabilityRow), not in this header. */}
-
- ({
- windowStart: s.windowStart,
- label: s.label,
- dose: s.dose,
- timesOfDay: s.timesOfDay,
- }))}
+
+
-
+
+ {historyView === "recent" ? (
+
+ ({
+ windowStart: s.windowStart,
+ label: s.label,
+ dose: s.dose,
+ timesOfDay: s.timesOfDay,
+ }))}
+ />
+
+ ) : (
+
+ )}
{/* INJEKTION — injectable routes only. Current GLP-1 charts +
diff --git a/src/components/medications/detail/segmented-toggle.tsx b/src/components/medications/detail/segmented-toggle.tsx
new file mode 100644
index 000000000..e5fc1cfda
--- /dev/null
+++ b/src/components/medications/detail/segmented-toggle.tsx
@@ -0,0 +1,64 @@
+"use client";
+
+import { cn } from "@/lib/utils";
+
+/**
+ * Small two-plus-segment text toggle for medication-detail surfaces. Mirrors
+ * the icon-only `MedicationViewToggle` chrome (bordered pill group, filled
+ * active segment, ghost inactive) but carries text labels. `aria-pressed`
+ * announces the state per segment; the group is named for screen readers.
+ * Segments keep the 40-px mobile tap floor, shrinking to the 32-px control
+ * height on desktop.
+ */
+export interface SegmentedToggleOption {
+ value: T;
+ label: string;
+}
+
+interface SegmentedToggleProps {
+ value: T;
+ options: SegmentedToggleOption[];
+ onChange: (value: T) => void;
+ ariaLabel: string;
+ dataSlot?: string;
+}
+
+export function SegmentedToggle({
+ value,
+ options,
+ onChange,
+ ariaLabel,
+ dataSlot,
+}: SegmentedToggleProps) {
+ return (
+
+ {options.map(({ value: optionValue, label }) => {
+ const active = value === optionValue;
+ return (
+
+ );
+ })}
+
+ );
+}