Bound market memory and let large areas page instead of loading everything: - DiscoveryQuery gains an until cursor; OfferTransport gains discoverPage() (one-shot, EOSE-bounded, newest-first) alongside the existing live discover() stream, which now accepts since so it only carries NEW offers going forward. - NostrOfferTransport.discoverPage sorts by created_at desc and derives the next cursor from the oldest event seen (not the oldest type-matched one, so filtering never skips a page). - OffersCubit: discover() fetches the first page + opens a since=now live sub; loadNextPage() pages further back; the in-memory list is capped at 400 offers (each can carry a ~40KB inline photo thumbnail, so unbounded growth in a busy area was a real OOM risk). - market_screen: infinite scroll via a scroll-position trigger + footer spinner, instead of a single unbounded ListView. - Added discoverPage unit tests (commons_core) and cubit pagination tests (first page/cursor, accumulation, cap, cross-page dedup). |
||
|---|---|---|
| .. | ||
| fixtures | ||
| goldens | ||
| README.md | ||
| screenshot_support.dart | ||
| screenshots_test.dart | ||
Localized app screenshots
Golden-based harness that renders key screens as PNGs in several languages, for
the landing site (tane.comunes.org) and the app-store listings. No emulator —
it runs under flutter test, so it's deterministic and CI-friendly.
Regenerate
cd apps/app_seeds
flutter test --update-goldens --run-skipped --tags screenshots test/screenshots/screenshots_test.dart
tool/collect_screenshots.sh # copy PNGs into site/ and fastlane/
Drop --update-goldens to verify the committed PNGs still match. The
screenshots tag is skipped by default (dart_test.yaml) — so it never
runs in the normal suite or CI's flutter test --coverage, where golden pixel
differences across OS/font versions would cause false failures. --run-skipped
opts it back in.
What it produces
goldens/<locale>/<screen>.png for en, es, fr, de, pt, ja, screens
home · inventory · market · calendar · detail, plus goldens/rtl/inventory.png.
The market is rendered populated via a seeded OffersCubit with a no-op transport
(no network); home/calendar/detail/inventory render from the repository alone.
- Fonts: real glyphs come from
loadScreenshotFonts()— every family inFontManifest.json(MaterialIcons + bundled Noto/seedks) plus the bundled DejaVu Sans as the Latin text face. No Roboto needed. rtl/is a layout demo, not a locale: English strings forced right-to-left to prove the design is RTL-safe. The app ships no Arabic translation yet, so there is deliberately noar/with Arabic copy.- Partial locales (e.g.
ja) fall back to English for untranslated strings — that's the app's real runtime behavior, shown honestly. - These are raw device-canvas frames (no marketing captions or device bezels). Add those downstream only if a store rejects plain screenshots.
Adding a screen or locale
Edit screenshotLocales / the screens map in screenshots_test.dart. Screens
must render from the repository + cubits alone (no live Nostr/network stack), so
inventory/detail/calendar are the safe, self-contained set.