fix(ui): draw every failed read through a read-failure primitive

Around thirty surfaces drew a failed read their own way: a bare
destructive paragraph with no retry, a muted line saying the data was
still being learned, a skeleton that never ended, an error card nested
in a tile, or nothing at all. None of them told an ended session from a
refusal. They now use QueryErrorRow or QueryErrorCard with the query's
error and a retry, inset where a card already frames them, and keep
their card and title where the page would otherwise jump. Hydration and
caffeine now fail the same way.

The recovery page no longer points to Integrations while Oura's first
resilience level is simply on its way.

A guard reads every read hook's isError branch and refuses hand-rolled
markup there, and refuses a framed error row inside a card.
This commit is contained in:
Marc-André Bombeck committed 2026-10-20 10:10:49 +02:00
1 parent a1b56f0b75
commit 923249dbf6
60 files changed
+579 -175

No files matched your search

@@ -80,6 +80,7 @@ export function CoachConversationsMemoryCard({
/>
{history.isError ? (
<QueryErrorRow
inset
error={history.error}
onRetry={() => void history.refetch()}
/>
@@ -326,6 +326,7 @@ export function CoachMemorySection({
{query.isError && (
<QueryErrorRow
inset
error={query.error}
message={t("settings.ai.coachMemory.loadError")}
onRetry={() => query.refetch()}
@@ -188,6 +188,7 @@ export function CoachRemindersSection({
{query.isError && (
<QueryErrorRow
inset
error={query.error}
message={t("settings.ai.coachReminders.loadError")}
onRetry={() => query.refetch()}
@@ -16,6 +16,7 @@ import { HeartPulse, Upload } from "lucide-react";
import { formatRelative } from "@/components/settings/integration-status-pill";
import { Button } from "@/components/ui/button";
import { QueryErrorRow } from "@/components/ui/query-error-row";
import { apiGet } from "@/lib/api/api-fetch";
import { useFormatters, useTranslations } from "@/lib/i18n/context";
import type { ConnectionHealth } from "@/lib/integrations/connection-health";
@@ -303,6 +304,8 @@ export function AppleHealthCard({ enabled }: { enabled: boolean }) {
data: status,
isLoading,
isError,
error,
refetch,
} = useQuery({
queryKey: queryKeys.healthKitStatus(),
queryFn: () => apiGet<HealthKitStatus>("/api/integrations/healthkit"),
@@ -384,9 +387,12 @@ export function AppleHealthCard({ enabled }: { enabled: boolean }) {
}
>
{isError ? (
<p role="alert" className="text-destructive text-sm">
{t("settings.appleHealth.status.unavailable")}
</p>
<QueryErrorRow
error={error}
slot="apple-health-status-error"
message={t("settings.appleHealth.status.unavailable")}
onRetry={() => void refetch()}
/>
) : null}
</IntegrationCard>
);
@@ -47,6 +47,7 @@ import {
integrationDocsHref,
} from "./setup-guide-link";
import type { IntegrationStatusViewModel } from "./shared";
import { QueryErrorRow } from "@/components/ui/query-error-row";
interface DawarichStatus {
connected: boolean;
@@ -298,9 +299,13 @@ function DawarichHome() {
{t("settings.dawarichHomePlace")}
</Label>
{places.isError ? (
<p role="alert" className="text-destructive text-sm">
{t(errorKeyOf(places.error))}
</p>
<QueryErrorRow
inset
error={places.error}
slot="dawarich-places-error"
message={t(errorKeyOf(places.error))}
onRetry={() => void places.refetch()}
/>
) : (
<NativeSelect
id="dawarich-home-place"
+12 -1
View File
@@ -37,6 +37,7 @@ import { useTranslations } from "@/lib/i18n/context";
import { MODULE_KEYS, MODULE_REGISTRY } from "@/lib/modules/registry";
import { queryKeys } from "@/lib/query-keys";
import { apiGet } from "@/lib/api/api-fetch";
import { QueryErrorRow } from "@/components/ui/query-error-row";
interface PrivacySummary {
retention: {
@@ -73,6 +74,8 @@ export function PrivacySection() {
data: summary,
isLoading: summaryLoading,
isError: summaryError,
error: summaryFailure,
refetch: refetchSummary,
} = useQuery({
queryKey: queryKeys.privacySummary(),
queryFn: () => apiGet<PrivacySummary>("/api/settings/privacy-summary"),
@@ -141,7 +144,15 @@ export function PrivacySection() {
<Skeleton className="h-4 w-2/3" />
<Skeleton className="h-4 w-1/2" />
</div>
) : summaryError || !summary ? (
) : summaryError && !summary ? (
<QueryErrorRow
inset
error={summaryFailure}
slot="privacy-retention-error"
message={t("settings.privacy.retention.unavailable")}
onRetry={() => void refetchSummary()}
/>
) : !summary ? (
<p className="text-muted-foreground text-sm">
{t("settings.privacy.retention.unavailable")}
</p>
@@ -445,6 +445,7 @@ export function ScoreSection() {
{analyticsQuery.isError ? (
<QueryErrorRow
inset
error={analyticsQuery.error}
slot="score-config-eligibility-error"
message={t("settings.sections.score.eligibilityFailed")}
@@ -110,6 +110,7 @@ export function SecurityActivityCard({
{isError && (
<QueryErrorRow
inset
error={error}
message={t("settings.security.activityLoadError")}
onRetry={() => refetch()}
@@ -165,6 +165,7 @@ export function SecuritySessionsCard({
{isError && (
<QueryErrorRow
inset
error={error}
message={t("settings.security.sessionsLoadError")}
onRetry={() => refetch()}
@@ -105,6 +105,7 @@ export function TrustedDevicesCard({
{isError && (
<QueryErrorRow
inset
error={error}
message={t("settings.security.trustedDevices.loadError")}
onRetry={() => refetch()}