Merge the document layout default and the air quality history into release/v1.42.0

This commit is contained in:
Marc-André Bombeck committed 2026-10-09 10:02:56 +02:00
commit 57c44006ee
35 files changed
+1884 -76

No files matched your search

@@ -31,9 +31,10 @@ import { useVirtualizer } from "@tanstack/react-virtual";
import { useTranslations } from "@/lib/i18n/context";
import type { InboundDocumentDto } from "@/lib/validations/inbound-documents";
import { UploadStateCard } from "./document-card";
import type {
DocumentsLayoutArrangement,
DocumentsLayoutView,
import {
DEFAULT_DOCUMENTS_LAYOUT,
type DocumentsLayoutArrangement,
type DocumentsLayoutView,
} from "@/lib/documents/documents-layout";
import {
columnsForWidth,
@@ -65,8 +66,8 @@ export function DocumentTimeline({
highlightId,
onPrefetch,
timezone,
view = "cards",
arrangement = "stacked",
view = DEFAULT_DOCUMENTS_LAYOUT.view,
arrangement = DEFAULT_DOCUMENTS_LAYOUT.arrangement,
}: {
/** Preview tiles or compact rows (the reader's vault presentation). */
view?: DocumentsLayoutView;
@@ -92,6 +92,13 @@ interface EnvironmentOverview {
days: number;
latestDate: string | null;
domain: string | null;
/** The history backfill's progress; null before its first run. */
history: {
total: number;
done: number;
complete: boolean;
checkedAt: string;
} | null;
};
/** v1.42 — the newest stored day; `airQuality` null while off/unfetched. */
latestDay: {
@@ -638,6 +645,26 @@ export function EnvironmentSection() {
? ` ${t("settings.sections.environment.airQuality.pollenEuropeOnly")}`
: ""}
</p>
{data.airQuality.history && data.airQuality.history.total > 0 && (
<p
className="text-muted-foreground text-xs"
data-testid="environment-aq-history"
data-complete={data.airQuality.history.complete}
>
{data.airQuality.history.complete
? t(
"settings.sections.environment.airQuality.historyComplete",
{ total: data.airQuality.history.total },
)
: t(
"settings.sections.environment.airQuality.historyProgress",
{
done: data.airQuality.history.done,
total: data.airQuality.history.total,
},
)}
</p>
)}
{data.latestDay?.airQuality && (
<div className="space-y-2">
<p className="text-sm font-medium">