mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-11 05:42:19 +00:00
fix(labs): call the date filter "Last measured"
The filter compares only the day of a marker's newest reading, so a marker measured inside the range and again later drops out. "Date range" promised more than that. The pill now reads "Last measured" in every locale, and the from/to semantics are written down where the filter is defined.
This commit is contained in:
1 parent
2e2a0ac4a1
commit
82ad1e2b45
14 files changed
+23
-8
No files matched your search
@@ -10704,6 +10704,7 @@
|
||||
"searchPlaceholder": "Biomarker suchen...",
|
||||
"searchLabel": "Biomarker suchen",
|
||||
"clearSearch": "Suche leeren",
|
||||
"lastMeasured": "Zuletzt gemessen",
|
||||
"statusLabel": "Status",
|
||||
"statusAll": "Alle Status",
|
||||
"statusAbnormal": "Außerhalb des Bereichs",
|
||||
|
||||
@@ -10704,6 +10704,7 @@
|
||||
"searchPlaceholder": "Search biomarkers...",
|
||||
"searchLabel": "Search biomarkers",
|
||||
"clearSearch": "Clear search",
|
||||
"lastMeasured": "Last measured",
|
||||
"statusLabel": "Status",
|
||||
"statusAll": "All statuses",
|
||||
"statusAbnormal": "Out of range",
|
||||
|
||||
@@ -10704,6 +10704,7 @@
|
||||
"searchPlaceholder": "Buscar biomarcadores...",
|
||||
"searchLabel": "Buscar biomarcadores",
|
||||
"clearSearch": "Borrar búsqueda",
|
||||
"lastMeasured": "Última medición",
|
||||
"statusLabel": "Estado",
|
||||
"statusAll": "Todos los estados",
|
||||
"statusAbnormal": "Fuera de rango",
|
||||
|
||||
@@ -10704,6 +10704,7 @@
|
||||
"searchPlaceholder": "Rechercher des biomarqueurs...",
|
||||
"searchLabel": "Rechercher des biomarqueurs",
|
||||
"clearSearch": "Effacer la recherche",
|
||||
"lastMeasured": "Dernière mesure",
|
||||
"statusLabel": "Statut",
|
||||
"statusAll": "Tous les statuts",
|
||||
"statusAbnormal": "Hors normes",
|
||||
|
||||
@@ -10704,6 +10704,7 @@
|
||||
"searchPlaceholder": "Cerca biomarcatori...",
|
||||
"searchLabel": "Cerca biomarcatori",
|
||||
"clearSearch": "Cancella ricerca",
|
||||
"lastMeasured": "Ultima misurazione",
|
||||
"statusLabel": "Stato",
|
||||
"statusAll": "Tutti gli stati",
|
||||
"statusAbnormal": "Fuori intervallo",
|
||||
|
||||
@@ -10704,6 +10704,7 @@
|
||||
"searchPlaceholder": "바이오마커 검색...",
|
||||
"searchLabel": "바이오마커 검색",
|
||||
"clearSearch": "검색어 지우기",
|
||||
"lastMeasured": "마지막 측정",
|
||||
"statusLabel": "상태",
|
||||
"statusAll": "모든 상태",
|
||||
"statusAbnormal": "범위 벗어남",
|
||||
|
||||
@@ -10704,6 +10704,7 @@
|
||||
"searchPlaceholder": "Biomarkers zoeken...",
|
||||
"searchLabel": "Biomarkers zoeken",
|
||||
"clearSearch": "Zoekopdracht wissen",
|
||||
"lastMeasured": "Laatst gemeten",
|
||||
"statusLabel": "Status",
|
||||
"statusAll": "Alle statussen",
|
||||
"statusAbnormal": "Buiten bereik",
|
||||
|
||||
@@ -10704,6 +10704,7 @@
|
||||
"searchPlaceholder": "Szukaj biomarkerów...",
|
||||
"searchLabel": "Szukaj biomarkerów",
|
||||
"clearSearch": "Wyczyść wyszukiwanie",
|
||||
"lastMeasured": "Ostatni pomiar",
|
||||
"statusLabel": "Status",
|
||||
"statusAll": "Wszystkie statusy",
|
||||
"statusAbnormal": "Poza zakresem",
|
||||
|
||||
@@ -10704,6 +10704,7 @@
|
||||
"searchPlaceholder": "Buscar biomarcadores...",
|
||||
"searchLabel": "Buscar biomarcadores",
|
||||
"clearSearch": "Limpar busca",
|
||||
"lastMeasured": "Última medição",
|
||||
"statusLabel": "Status",
|
||||
"statusAll": "Todos os status",
|
||||
"statusAbnormal": "Fora da faixa",
|
||||
|
||||
@@ -10704,6 +10704,7 @@
|
||||
"searchPlaceholder": "Поиск биомаркеров...",
|
||||
"searchLabel": "Поиск биомаркеров",
|
||||
"clearSearch": "Очистить поиск",
|
||||
"lastMeasured": "Последнее измерение",
|
||||
"statusLabel": "Статус",
|
||||
"statusAll": "Все статусы",
|
||||
"statusAbnormal": "Вне нормы",
|
||||
|
||||
@@ -44,7 +44,7 @@ describe("<LabFilterRail> layout", () => {
|
||||
const { screen } = await renderWithApp(<LabFilterRail {...props()} />);
|
||||
|
||||
const search = screen.getByRole("searchbox", { name: "Search biomarkers" });
|
||||
const dateRange = screen.getByRole("button", { name: "Date range" });
|
||||
const dateRange = screen.getByRole("button", { name: "Last measured" });
|
||||
const searchRect = search.element().getBoundingClientRect();
|
||||
const dateRect = dateRange.element().getBoundingClientRect();
|
||||
|
||||
@@ -75,7 +75,7 @@ describe("<LabFilterRail> layout", () => {
|
||||
|
||||
const controls = [
|
||||
search.element(),
|
||||
screen.getByRole("button", { name: "Date range" }).element(),
|
||||
screen.getByRole("button", { name: "Last measured" }).element(),
|
||||
screen.getByRole("combobox", { name: "Status: Out of range" }).element(),
|
||||
screen.getByRole("combobox", { name: "Category" }).element(),
|
||||
screen.getByRole("button", { name: "Reset" }).element(),
|
||||
@@ -108,7 +108,7 @@ describe("<LabFilterRail> layout", () => {
|
||||
|
||||
const controls = [
|
||||
screen.getByRole("searchbox", { name: "Biomarker suchen" }).element(),
|
||||
screen.getByRole("button", { name: "Zeitraum" }).element(),
|
||||
screen.getByRole("button", { name: "Zuletzt gemessen" }).element(),
|
||||
screen
|
||||
.getByRole("combobox", {
|
||||
name: "Status: Außerhalb des Bereichs",
|
||||
@@ -130,7 +130,7 @@ describe("<LabFilterRail> layout", () => {
|
||||
const { screen } = await renderWithApp(<LabFilterRail {...props()} />);
|
||||
const controls = [
|
||||
screen.getByRole("searchbox", { name: "Search biomarkers" }).element(),
|
||||
screen.getByRole("button", { name: "Date range" }).element(),
|
||||
screen.getByRole("button", { name: "Last measured" }).element(),
|
||||
screen.getByRole("combobox", { name: "Status" }).element(),
|
||||
screen.getByRole("combobox", { name: "Category" }).element(),
|
||||
];
|
||||
|
||||
@@ -43,7 +43,7 @@ describe("<LabFilterRail>", () => {
|
||||
|
||||
// The shared rail keeps search and all filter dimensions in one ordered row.
|
||||
const searchIdx = html.indexOf('placeholder="Search biomarkers..."');
|
||||
const dateRangeIdx = html.indexOf("Date range");
|
||||
const dateRangeIdx = html.indexOf("Last measured");
|
||||
const statusIdx = html.indexOf("Status");
|
||||
const categoryIdx = html.indexOf("Category");
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ export function LabFilterRail({
|
||||
</div>
|
||||
|
||||
<FilterBarDateRange
|
||||
label={t("dataList.dateRange")}
|
||||
label={t("labs.filter.lastMeasured")}
|
||||
from={filters.fromDay ?? ""}
|
||||
to={filters.toDay ?? ""}
|
||||
onFromChange={onFromDayChange}
|
||||
|
||||
@@ -39,7 +39,12 @@ export interface LabListFilters {
|
||||
status?: LabStatusFilter;
|
||||
/** Category key (matches category.key) or ALL. */
|
||||
category?: string;
|
||||
/** Inclusive day bounds, YYYY-MM-DD for newest reading (latest.takenAt). */
|
||||
/**
|
||||
* "Last measured": inclusive day bounds (`?from` / `?to`, YYYY-MM-DD) on
|
||||
* the marker's newest reading (`latest.takenAt`), in the display zone.
|
||||
* Older readings are not looked at, so a marker measured inside the range
|
||||
* and again after it drops out, which is why the pill reads "Last measured".
|
||||
*/
|
||||
fromDay?: string;
|
||||
toDay?: string;
|
||||
}
|
||||
@@ -179,7 +184,7 @@ export function filterMarkerRows(
|
||||
if (markerCategory !== category) return false;
|
||||
}
|
||||
|
||||
// 4. Date bounds on latest reading
|
||||
// 4. "Last measured": the newest reading's day, never an older one
|
||||
if (fromDay || toDay) {
|
||||
const takenDate = dayKeyOf(row.latest.takenAt);
|
||||
if (fromDay && takenDate < fromDay) return false;
|
||||
|
||||
Reference in new issue
Block a user