fix(auth,bank): guard switch-auth nav and surface banking retry (#56, #57) #80

Merged
ksv741 merged 2 commits from feature/56-57-auth-pending-banking-feedback into develop 2026-10-14 12:01:28 +03:00
Owner

#56 — AuthForm pending navigation guard

AuthForm теперь owns the switch-auth guard. While isSubmitting:

  • pointer click and Enter cannot change the auth route (the form renders a Button with aria-disabled / disabled instead of the Button component={Link})
  • the rendered control is no longer reachable via Tab
  • a failed submit keeps the draft/error context and restores a true Link after the request settles

#57 — Banking read feedback (cold vs cached, named retries)

Page-owned retries из query owner, через BankFeedback/StateView, with loadingError/cached distinct branches:

  • CardsPage: cold bank-cards failure — accessible alert + retry; cached failure — warning + retry; successful empty remains an empty StateView. Summary gets a retry through BankSummaryView.
  • CardPage: cached card / bank-cards / summary / history failure keeps the previous data and exposes a section GET retry. Cold card error (not notFound) gains a bank.retry CTA next to bank.back. notFound keeps the existing copy and skips the retry CTA.
  • Independent outages: summary-only / history-only failures no longer hide successful sections; balance, draft, and the current URL are preserved.
  • Placeholder rows remain readonly via the existing history.isPlaceholderData gate.

Verification

  • npm run lint — clean
  • npm run typecheck — clean
  • npm run test:run — 434/434 (3 new tests in CardsPage.test.tsx, 1 new test in CardPage.test.tsx, 1 it.each pair in AuthForm.test.tsx; existing tests adapted to the new alert/retry contract)
  • npm run knip — clean
  • npm run deps — clean
  • npm run openapi:check — clean
  • npm run test:lint — clean

Notes

  • AuthFormProps.register became boolean so the test can pass the computed value without a ternary; the existing callers (LoginForm, RegisterForm) keep their semantics.
  • All retry handlers are pre-named in the ViewModel (cardRetry, cardsRetry, historyRetry, summaryRetry, retryCards, retrySummary); views consume the prepared function, no inline arrows.

Closes #56, #57.

## #56 — AuthForm pending navigation guard `AuthForm` теперь owns the switch-auth guard. While `isSubmitting`: - pointer click and Enter cannot change the auth route (the form renders a `Button` with `aria-disabled` / `disabled` instead of the `Button` component={Link}) - the rendered control is no longer reachable via Tab - a failed submit keeps the draft/error context and restores a true `Link` after the request settles ## #57 — Banking read feedback (cold vs cached, named retries) Page-owned retries из `query` owner, через `BankFeedback`/StateView, with `loadingError`/`cached` distinct branches: - **CardsPage**: cold `bank-cards` failure — accessible alert + retry; cached failure — warning + retry; successful empty remains an empty `StateView`. Summary gets a retry through `BankSummaryView`. - **CardPage**: cached `card` / `bank-cards` / `summary` / `history` failure keeps the previous data and exposes a section GET retry. Cold `card` error (not `notFound`) gains a `bank.retry` CTA next to `bank.back`. `notFound` keeps the existing copy and skips the retry CTA. - **Independent outages**: summary-only / history-only failures no longer hide successful sections; balance, draft, and the current URL are preserved. - **Placeholder rows** remain readonly via the existing `history.isPlaceholderData` gate. ## Verification - `npm run lint` — clean - `npm run typecheck` — clean - `npm run test:run` — 434/434 (3 new tests in `CardsPage.test.tsx`, 1 new test in `CardPage.test.tsx`, 1 `it.each` pair in `AuthForm.test.tsx`; existing tests adapted to the new alert/retry contract) - `npm run knip` — clean - `npm run deps` — clean - `npm run openapi:check` — clean - `npm run test:lint` — clean ## Notes - `AuthFormProps.register` became `boolean` so the test can pass the computed value without a ternary; the existing callers (`LoginForm`, `RegisterForm`) keep their semantics. - All retry handlers are pre-named in the ViewModel (`cardRetry`, `cardsRetry`, `historyRetry`, `summaryRetry`, `retryCards`, `retrySummary`); views consume the prepared function, no inline arrows. Closes #56, #57.
codex-bot added 1 commit 2026-10-14 10:45:37 +03:00
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
e38ecd87d6
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
ksv741 added 1 commit 2026-10-14 11:25:47 +03:00
fix(bank): break BankFeedback's shared/api edge for stories (#80)
Frontend verify / commits (pull_request) Successful in 42s
Frontend verify / security (pull_request) Successful in 10s
Frontend verify / verify (pull_request) Successful in 6m36s
233680448f
BankFeedback lived under entities/bank-card/ui but pulled apiErrorCode
from @/shared/api, which dragged the entire api layer (openapi-fetch,
openapi-react-query, @tanstack/react-query, client, problem-details,
resource-query) into any Storybook story that imported a sibling
view, breaking stories-must-not-reach-application-data.

Move the local 'extract code from unknown' helper into the entity
and consume it from BankFeedback. The shared helper stays in
shared/api for the rest of the app.
ksv741 force-pushed feature/56-57-auth-pending-banking-feedback from fd835f99d5 to 233680448f 2026-10-14 11:25:47 +03:00 Compare
ksv741 merged commit edc7097bd7 into develop 2026-10-14 12:01:28 +03:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: WealthLedger/frontend#80