Skip to content

feat(app): consolidate 0.4.2 Effect rewrite - #239

Open
MagicTheDev wants to merge 38 commits into
mainfrom
feat/0.4.2
Open

MagicTheDev wants to merge 38 commits into
mainfrom
feat/0.4.2

Conversation

@MagicTheDev

@MagicTheDev MagicTheDev commented Sep 10, 2026 •

Copy link
Copy Markdown
Member

Summary

  • complete the ClashKing App 0.4.2 Effect rewrite on the exact RC25 API contract pair
  • fix notification registration and settings behavior, add Legend-defense account controls, and keep OTA/native update version selection covered by contract-level tests
  • replace numbered personal-base slots with unlimited saved bases, optional War/Legend labels, durable download history, and exact-count cleanup for saved bases older than 90 days
  • show Battlelog farming loot as one 30-day UTC total and a tappable seven-row daily grid, with the matching image export available only from the Battlelogs player header
  • render stored Legend-season data immediately, isolate optional analytics endpoint failures, and retain stable content while selected-day data loads
  • keep the separate Legends experience, shared-base workflows, expanded Legend Stats, and compatible OTP worker dependency updates already consolidated on this branch
  • synchronize all 28 direct Expo dependencies to Expo Doctor's required SDK 57 patch versions and declare the dynamic expo-web-browser config plugin

API contract provenance

The Expo client is pinned to the committed RC25 package pair produced from ClashKing API commit a7089c4a6315d4f00fea00d85ed9c389ac91dbbb:

  • @clashking/api-client: 0e33a0d60cab8c7ff9c13e22aabed2ce4d9a61673f914fb763725bd028a9df85
  • @clashking/api-contracts: 7e443f06d4810501e8a5cb6083e207988e1d64456f9df955f4140185477e277e

Personal bases use the final item-level kind, saved, savedAt, and downloadedAt contract. Saving or relabeling uses the strict PUT body, unsaving preserves lifetime download history, and cleanup uses the fixed older-than-90-days endpoint before refreshing authoritative state.

Legend selected-day summaries use the exact POST /v2/legends/days contract. Opponent enrichment batches the selected player and unique nonautomatic opponents through /v2/legends/ranks, then batches opponent day summaries through /v2/legends/days; automatic rows are deliberately excluded.

Experience details

  • Notifications use the final account-aware controls and Legend-defense settings behavior.
  • Personal bases separate current saved state from lifetime download history, support clearable War/Legend labels, allow history items to be re-saved without recording another download, and confirm the exact eligible count before cleanup. Shared-base history remains separate.
  • Battlelogs aggregate Gold, Elixir, and Dark Elixir across exactly 30 UTC calendar days ending today. Every day, including zero-loot days, opens a resource breakdown, and the horizontal image export repeats the same total and grid.
  • Legends builds an immediate baseline from legends_by_season and ranking data, enriches each optional section independently, avoids a player refetch when a baseline is present, and keeps the previous content visible during day navigation.
  • Legend Stats uses the existing LegendDaysEndpoint fields for attacks, players, star counts, average duration/destruction, heroes, pets, equipment, and pet assignments. It supports legend_i, top_1000, and top_200 cohorts without changing the retained Army browsing experience.

Validation

  • npm run typecheck
  • npm run lint (0 errors; 7 pre-existing warnings)
  • npx expo-doctor (21/21 checks)
  • full Jest run (201 suites, 1,120 tests)
  • API boundary validation (10 tests; 577 files across 22 modules)
  • native plugin tests (39 tests)
  • E2E structure validation (23 TypeScript files)
  • web build tests (8 tests)
  • release tests (10 tests)
  • localization generation/check across all 33 supported ARB files
  • license inventory/check (323 texts; 965 packages)
  • npm run web:export (28 static routes)
  • git diff --check

No visual tests, simulator launch, merge, deployment, production change, App Store release, or OTA publication was performed. Direct-LAN Metro plus installation and launch on the exact saved iPhone Matt are local delivery-verification steps and are tracked separately from production release status.

Supersedes #237 and #238.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@sonarqubecloud

Copy link
Copy Markdown

@Destinea

Copy link
Copy Markdown
Contributor

Added in the latest push

  • Replaced the Android up/down reorder buttons with direct drag and drop from a compact handle in the top-right corner of each Home card.
  • Added live movement feedback: surrounding cards shift before the dragged card is released.
  • Kept the native Android ScrollView and pull-to-refresh behavior; scrolling is temporarily disabled only while dragging.
  • Made the drag handle subtle, fully contained within the card, and available only when multiple cards can be reordered.
  • Vertically aligned the progress percentage with the card title and account selector.
  • Preserved the reordered card order through the existing persistence action.
  • Added a regression test covering drag preview, scroll locking, and the final persisted order.

Please verify on Android

  • Drag each Home card upward and downward using only the corner handle.
  • Confirm neighboring cards move before release and the expected order is committed after release.
  • Confirm tapping a card still opens it and horizontal account selection still works.
  • Confirm vertical scrolling and pull-to-refresh still work when no drag is active.
  • Confirm the handle does not overlap the title, account selector, or percentage on cards with and without progress.
  • Relaunch the app and confirm the chosen order is retained.

Validated locally with TypeScript, lint, localization checks, and 6 focused dashboard tests. Also exercised on a physical Samsung Android device.

@Destinea

Copy link
Copy Markdown
Contributor

CI follow-up

The latest push fixed the React Compiler lint error in the War refresh retry callback. Current CI status:

  • Android debug build: passed
  • iOS unsigned simulator build: passed
  • Change detection: passed
  • Expo test suite: 1129 passed, 1 failed

The remaining failure is unrelated to the Home card reorder changes: legends-root.test.tsx has a date-dependent assertion that expects 2026-09-16T05:10:00.000Z, while the current-date calculation now returns 2026-09-21T05:10:00.000Z. I have left that unrelated Legends test unchanged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants