fix(auth,bank): guard switch-auth nav and surface banking retry
Frontend verify / commits (pull_request) Successful in 39s
Frontend verify / security (pull_request) Successful in 10s
Frontend verify / verify (pull_request) Failing after 5m50s

AuthForm disables the switch-auth Link while submit is pending so pointer
click and Enter can no longer leave the auth route and lose the draft/error
context. The form restores a true Link after the request settles.

CardsPage/CardPage distinguish cold vs cached banking failures:
- cold card/section errors expose accessible alert + retry
- cached failures keep the previous data and offer a section GET retry
- summary-only/history-only outages do not hide successful sections
- notFound still skips the retry CTA

Tests cover the pending link guard, cold/cached cards error with retry,
summary failure with retry, and the prerequisite card list recovery.

Closes #56, #57
This commit is contained in:
2026-10-14 10:43:34 +03:00
parent e5f8bbe33c
commit e38ecd87d6
10 changed files with 251 additions and 32 deletions
@@ -18,6 +18,7 @@ import { Link } from "react-router";
import {
BankCardFace,
BankFeedback,
BankPeriodPicker,
BankSummaryView,
} from "@/entities/bank-card";
@@ -51,15 +52,17 @@ const CardsPageViewCards: FC<CardsPageViewProps> = (props) => {
);
}
const text = t(vm.archive ? "bank.emptyHint" : "bank.noActive");
if (!vm.cards.error) {
const text = t(vm.archive ? "bank.emptyHint" : "bank.noActive");
return (
<StateView
action={<Button onClick={vm.onAddCard}>{t("bank.addCard")}</Button>}
text={text}
title={t("bank.empty")}
/>
);
return (
<StateView
action={<Button onClick={vm.onAddCard}>{t("bank.addCard")}</Button>}
text={text}
title={t("bank.empty")}
/>
);
}
}
if (vm.cards.isLoading) {
@@ -103,6 +106,15 @@ const CardsPageView: FC<CardsPageViewProps> = (props) => {
onChange={vm.onArchiveChange}
/>
{vm.cards.error && (
<BankFeedback
cached={Boolean(vm.cards.data)}
error={vm.cards.error}
loadingError={!vm.cards.data}
retry={vm.retryCards}
/>
)}
<CardsPageViewCards {...props} />
<Group align="flex-end" justify="space-between">
@@ -123,9 +135,10 @@ const CardsPageView: FC<CardsPageViewProps> = (props) => {
<BankSummaryView
all
data={vm.summary.data}
error={vm.summary.isError}
error={vm.summary.error}
fetching={vm.summary.isFetching}
loading={vm.summary.isLoading}
retry={vm.retrySummary}
/>
</Stack>
);