# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.2.0] - 2025-12-29

### Added

- "How to Play" `RulesModal` component for player guidance.
- New Header in `DashboardScreen` with Help and Notification icons.
- `SDK_HANDOVER_GUIDE.md` for easier integration.

### Fixed

- Mobile responsiveness and compact UI refinements across all screens.
- Web preview modal containment within smartphone frame.
- Radial gauge aspect ratio for better information density.

## [1.3.0] - 2026-01-03

### Changed

- `QwikCardApp` now renders the Playbasis Widget UI via `react-native-webview` (WebView-embedded Widget SDK).
- Updated SDK documentation to reflect WebView integration and the recommended one-line integration path.

### Added

- `react-native-webview` as a peer dependency.

## [1.3.1] - 2026-01-04

### Changed

- Updated production handover guidance to use production APIM base path `/v1`.
- Prepared new-tenant handover workflow for `qwik-prod` without requiring Expo.

## [2.3.8] - 2026-01-21

### Changed

- Published under npmjs as `@playbasis-ai/qwikcard-sdk` and aligned docs to the new scope.

## [2.3.9] - 2026-01-21

### Changed

- Hid the profile header section in the embedded widget for QwikCard.

## [2.3.10] - 2026-01-21

### Changed

- Updated README event list with XP values from the QwikCard rulebook.

## [2.3.13] - 2026-01-29

### Fixed

- Support `items` responses for quests, badges, and rewards to avoid empty dashboards.

## [2.3.14] - 2026-01-30

### Fixed

- Fallback badge image mapping for Qwik slugs when API omits image URLs.

## [2.3.15] - 2026-01-30

### Added

- Lightweight request retries/timeouts with opt-in configuration for smoother client UX.

## [2.3.16] - 2026-01-30

### Changed

- Improved empty-state guidance and skeletons in dashboard quest/badge/leaderboard panels.

## [2.3.17] - 2026-01-30

### Fixed

- Use quest catalog when player progress is empty so quests render immediately.
- Support array responses for player quests/badges.

## [2.3.18] - 2026-01-30

### Fixed

- Accept top-level leaderboard entries in API responses.

## [2.3.20] - 2026-01-31

### Fixed

- Normalize leaderboard entries across `entries/items/leaderboard` response shapes.
- Restore badge detail modal header styling in the embedded widget.
- Map quest catalog into widget quests so onboarding is never empty.

## [2.3.21] - 2026-01-31

### Changed

- Expanded “How to Earn XP” guidance to reflect the full Qwik rulebook and flag planned actions.

## [2.3.22] - 2026-01-31

### Fixed

- Lock text autoscaling in the embedded widget to stabilize layout in RN WebView.
- Normalize badge modal sizing and gradients for RN WebView rendering.

## [2.3.23] - 2026-01-31

### Changed

- Always render leaderboard entries with a fallback “not ranked yet” banner for zero‑XP players.

## [2.3.24] - 2026-01-31

### Fixed

- Always include a current-user placeholder in leaderboard bootstrap data so the UI never renders empty.

## [2.3.11] - 2026-01-29

### Changed

- Updated widget SDK data flow to require live API responses (no dummy fallback).

## [2.3.12] - 2026-01-29

### Changed

- Rebuilt embedded widget bundle with latest API-driven badge/quest logic.

## [2.3.3] - 2026-01-19

### Fixed

- Updated `Currency` type and `usePoints` hook to use `coins` (matching API) instead of `qwik-coins`.

## [2.3.2] - 2026-01-17

### Changed

- Pinned Arcade Center banners to the hosted CDN URLs.

## [2.3.1] - 2026-01-17

### Changed

- Fixed Arcade Center banner URL resolution when running inside the widget WebView.

## [2.3.0] - 2026-01-17

### Changed

- Fixed Arcade Center banner URLs for hosted game assets.

## [2.2.9] - 2026-01-17

### Changed

- Added Arcade Center banner rendering with hosted images.

## [2.2.8] - 2026-01-17

### Changed

- Rebuilt the embedded widget assets with the latest Arcade Center updates.

## [2.2.7] - 2026-01-17

### Added

- Play tab with Arcade Center (Match-3 Challenge + Bubble Blast) in the embedded widget.

### Fixed

- `GradientCard` now falls back to `View` when `react-native-linear-gradient` is unavailable.

### Removed

- Legacy React Native screens and Navigator exports (WebView widget is the primary UI).

### Changed

- Added tab collapse/expand control in the widget Play navigation.

### Fixed

- Cleaned unused campaign hooks in widget runtime.

### Fixed

- Arcade Center now returns to the Play tab on back with Qwik light header.

## [1.0.0] - 2024-12-15

### Added

- Initial release of @playbasis/qwikcard-sdk

  (Package name/scope may differ depending on your distribution channel.)

- `PlaybasisProvider` - React context provider for SDK configuration
- `PlaybasisClient` - Fetch-based API client with idempotency support

#### Hooks

- `usePoints()` - Manage player point balances
- `useQuests()` - Track quest progress and completion
- `useBadges()` - Display earned and available badges
- `useRewards()` - Browse and redeem rewards
- `usePlaybasis()` - Direct access to client and context

#### Components

- `PointsBalance` - Display multiple currency balances
- `QuestProgress` - Quest card with progress bar
- `RewardCard` - Reward item with redemption button
- `BadgeIcon` - Badge display with earned/locked states

#### Event Types

- `card.purchase` - Debit card transactions
- `card.deposit` - Direct deposits
- `card.atm` - ATM withdrawals
- `qwikit.sent` / `qwikit.received` - P2P transfers
- `referral.signup` - Referral completions
- `profile.complete` - Profile completion

### Security

- Fetch-based client (no axios dependency)
- Safe JSON parsing with error handling
- UUID-based idempotency keys (collision-resistant)
- No credentials stored in SDK
