Wallet redesign: split buy/spend, compact balance, exchange confirm + insufficient-chips fix #242

Merged
developer merged 1 commits from feature/wallet-redesign into development 2026-07-10 16:00:54 +00:00
Owner

Reworks the Wallet screen to be compact and to separate "get chips" from "spend chips", and fixes
a reported bug. Design agreed in the session.

Bug fix

Buying a value with too few chips showed the generic "Something went wrong" toast. The backend's
insufficient_chips (409) code was propagated correctly, but had no i18n mapping, so errorKey
fell back to error.generic. Added error.insufficient_chips / error.product_not_found. Also, a
value's Exchange button is now disabled up front when the spendable balance cannot cover it (the
server stays authoritative and still rejects it).

Redesign

  • Compact balance leads the screen: the running context's own chips (🪙 N), then any linked
    other-platform chips behind that platform's logo, monospaced digits. Inside a VK/TG store only that
    store's own segment shows; on the web the direct segment leads and linked vk/tg follow.
  • The benefits list is renamed Active, moved above the store, shows one inline line
    (hints + ad-free end date) and hides when nothing is active.
  • The store splits by a two-way toggle into Buy chips (money packs, with the watch-an-ad
    row at the top) and Spend chips (values). Default: Buy chips.
  • A value's action reads Exchange and opens a single confirmation dialog — chip spends are
    instant, with no provider window to stand in for a confirmation. The existing cross-platform
    store-compliance warning folds into that same dialog when the spend would draw VK/TG chips
    (agreed: one dialog, not two).

Model (verified, unchanged)

The money → chips → values model is untouched. Confirmed against the code + PAYMENTS_DECISIONS_ru:
real money buys only chip packs; values are chips-only — a "no-ads for money" product is
structurally impossible (the shape validator forbids a money-priced benefit), which is why creating
one in the admin console failed. No wire or backend change here.

Tests & docs

  • e2e: wallet.spec.ts rewritten for the split storefront, the balance, the Exchange-confirm dialog
    (with/without the cross-platform warning) and the GP stub — chromium + webkit green.
  • Verified locally green: pnpm check, pnpm test:unit (584), pnpm build, bundle gate,
    pnpm test:e2e (both engines); plus a portrait visual pass on the mock (balance / toggle / Active
    / Exchange / confirm dialog).
  • Docs: FUNCTIONAL.md (+_ru) wallet story rewritten.
  • App bundle budget 126 → 127 KB (the redesign rides the always-loaded settings hub).
Reworks the Wallet screen to be compact and to separate "get chips" from "spend chips", and fixes a reported bug. Design agreed in the session. ## Bug fix Buying a value with too few chips showed the generic **"Something went wrong"** toast. The backend's `insufficient_chips` (409) code was propagated correctly, but had **no i18n mapping**, so `errorKey` fell back to `error.generic`. Added `error.insufficient_chips` / `error.product_not_found`. Also, a value's **Exchange button is now disabled up front** when the spendable balance cannot cover it (the server stays authoritative and still rejects it). ## Redesign - **Compact balance** leads the screen: the running context's own chips (🪙 N), then any linked other-platform chips behind that platform's logo, monospaced digits. Inside a VK/TG store only that store's own segment shows; on the web the direct segment leads and linked vk/tg follow. - The benefits list is renamed **Active**, moved **above** the store, shows one inline line (hints + ad-free end date) and **hides when nothing is active**. - The **store** splits by a two-way toggle into **Buy chips** (money packs, with the watch-an-ad row at the top) and **Spend chips** (values). Default: Buy chips. - A value's action reads **Exchange** and opens a **single confirmation dialog** — chip spends are instant, with no provider window to stand in for a confirmation. The existing cross-platform store-compliance **warning folds into that same dialog** when the spend would draw VK/TG chips (agreed: one dialog, not two). ## Model (verified, unchanged) The money → chips → values model is untouched. Confirmed against the code + `PAYMENTS_DECISIONS_ru`: real money buys **only chip packs**; values are **chips-only** — a "no-ads for money" product is structurally impossible (the shape validator forbids a money-priced benefit), which is why creating one in the admin console failed. No wire or backend change here. ## Tests & docs - e2e: `wallet.spec.ts` rewritten for the split storefront, the balance, the Exchange-confirm dialog (with/without the cross-platform warning) and the GP stub — **chromium + webkit green**. - Verified locally green: `pnpm check`, `pnpm test:unit` (584), `pnpm build`, bundle gate, `pnpm test:e2e` (both engines); plus a portrait visual pass on the mock (balance / toggle / Active / Exchange / confirm dialog). - Docs: `FUNCTIONAL.md` (+`_ru`) wallet story rewritten. - App bundle budget **126 → 127 KB** (the redesign rides the always-loaded settings hub).
developer added 1 commit 2026-07-10 15:46:53 +00:00
feat(ui): wallet storefront redesign — split buy/spend, compact balance, exchange confirm
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Has been skipped
CI / integration (pull_request) Has been skipped
CI / ui (pull_request) Successful in 1m11s
CI / conformance (pull_request) Successful in 10s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m55s
8ce986922a
Reworks the Wallet screen to be more compact and to separate the two flows, and fixes a
reported bug.

Bug: buying a value with too few chips showed the generic "Something went wrong" toast — the
backend's `insufficient_chips` (409) code was propagated correctly but had no i18n mapping, so
`errorKey` fell back to `error.generic`. Add `error.insufficient_chips` / `error.product_not_found`.
Also disable a value's Exchange button up front when the spendable balance cannot cover it (the
server stays authoritative).

Redesign:
- a compact **balance** row leads the screen — the context's own chips (🪙 N) then any linked
  other-platform chips behind that platform's logo (monospaced digits); inside a VK/TG store only
  that store's own segment shows;
- the benefits section is renamed **Active**, moved above the store, shows one inline line
  (hints + ad-free) and hides when nothing is active;
- the **store** splits by a two-way toggle into **Buy chips** (money packs + the watch-an-ad row at
  the top) and **Spend chips** (values, exchanged for chips);
- a value's action reads **Exchange** and opens a single confirmation dialog (chip spends are
  instant, with no provider window to confirm them); the existing cross-platform store-compliance
  warning folds into that same dialog when the spend would draw VK/TG chips.

No payments-model or wire change; the money→chips→values model is unchanged (verified: money buys
only chip packs, values are chips-only — "no-ads for money" is structurally impossible).

Tests: wallet e2e updated for the new layout (chromium + webkit green). Docs: FUNCTIONAL (+_ru)
wallet story rewritten. App bundle budget 126 → 127 KB (always-loaded settings hub).
owner approved these changes 2026-07-10 16:00:22 +00:00
developer merged commit a241e43d79 into development 2026-07-10 16:00:54 +00:00
developer deleted branch feature/wallet-redesign 2026-07-10 16:00:54 +00:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: developer/scrabble-game#242