Merge branch 'main' into spike/block2-derisking
# Conflicts: # apps/app_seeds/lib/i18n/strings.g.dart
This commit is contained in:
commit
1fb8e37536
25 changed files with 2396 additions and 36 deletions
|
|
@ -21,6 +21,7 @@ import '../services/auto_backup_store.dart';
|
|||
import '../services/export_import_service.dart';
|
||||
import '../services/file_picker_file_service.dart';
|
||||
import '../services/file_service.dart';
|
||||
import '../services/locale_store.dart';
|
||||
import '../services/ocr/label_text_extractor.dart';
|
||||
import '../services/ocr/ocr_language.dart';
|
||||
import '../services/ocr/tesseract_label_extractor.dart';
|
||||
|
|
@ -68,9 +69,18 @@ Future<void> configureDependencies() async {
|
|||
// contacted here (local-first — the social layer only enriches).
|
||||
final socialService = await SocialService.fromRootSeedHex(rootSeedHex);
|
||||
|
||||
// Seed the bundled species catalog (idempotent) before the UI opens.
|
||||
// Seed the bundled species catalog before the UI opens — but only once per
|
||||
// catalog version. Parsing the ~1.5 MB catalog and scanning the species table
|
||||
// on every launch was the main startup jank; the version marker skips both
|
||||
// when this install already holds the current catalog.
|
||||
const catalogVersionKey = 'species_catalog_version';
|
||||
final speciesRepository = SpeciesRepository(database, idGen: IdGen());
|
||||
await speciesRepository.seedBundled(await loadBundledSpecies());
|
||||
await speciesRepository.seedBundledIfNeeded(
|
||||
version: speciesCatalogVersion,
|
||||
readVersion: () => secretStore.read(catalogVersionKey),
|
||||
writeVersion: (v) => secretStore.write(catalogVersionKey, v),
|
||||
loadSeeds: loadBundledSpecies,
|
||||
);
|
||||
|
||||
final varietyRepository = VarietyRepository(
|
||||
database,
|
||||
|
|
@ -97,6 +107,7 @@ Future<void> configureDependencies() async {
|
|||
..registerSingleton<FileService>(fileService)
|
||||
..registerSingleton<LabelTextExtractor>(labelExtractor)
|
||||
..registerSingleton<OnboardingStore>(OnboardingStore(secretStore))
|
||||
..registerSingleton<LocaleStore>(LocaleStore(secretStore))
|
||||
..registerSingleton<SocialService>(socialService)
|
||||
..registerSingleton<SocialSettings>(SocialSettings(secretStore))
|
||||
..registerSingleton<OfferOutbox>(OfferOutbox(secretStore))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue