perf(inventory): lazy list, photo thumbnails, indexes, debounced reload
Scale the local inventory to 10k+ varieties: - Render the list with ListView.builder over a flattened header/item model instead of building every tile upfront. - Store a small regenerable JPEG thumbnail per photo (schema v14) and use it for the 48px list avatar; full bytes stay for offer image hosting. Existing photos are backfilled lazily at startup. Thumbnail is local-only (excluded from CRDT sync and backups by the JSON codec). - Add indexes on varieties(is_deleted,is_draft), attachments(parent_type, parent_id,kind), lots(variety_id) via @TableIndex. - Debounce watchInventoryView (~250ms) so a burst of table writes triggers one reload, not seven. - cacheWidth/cacheHeight on the list avatar decode. - Scale test raised 3k -> 10k; migration test v13 -> v14.
This commit is contained in:
parent
2884ddd3c7
commit
3de01bd948
12 changed files with 5114 additions and 34 deletions
|
|
@ -11,19 +11,19 @@ void main() {
|
|||
verifier = SchemaVerifier(GeneratedHelper());
|
||||
});
|
||||
|
||||
test('freshly created database matches the exported schema v13', () async {
|
||||
final schema = await verifier.schemaAt(13);
|
||||
test('freshly created database matches the exported schema v14', () async {
|
||||
final schema = await verifier.schemaAt(14);
|
||||
final db = AppDatabase(schema.newConnection());
|
||||
await verifier.migrateAndValidate(db, 13);
|
||||
await verifier.migrateAndValidate(db, 14);
|
||||
await db.close();
|
||||
});
|
||||
|
||||
// Every historical version upgrades cleanly to the current schema (v13).
|
||||
for (var from = 1; from <= 12; from++) {
|
||||
test('upgrades v$from → v13 and matches the fresh schema', () async {
|
||||
// Every historical version upgrades cleanly to the current schema (v14).
|
||||
for (var from = 1; from <= 13; from++) {
|
||||
test('upgrades v$from → v14 and matches the fresh schema', () async {
|
||||
final connection = await verifier.startAt(from);
|
||||
final db = AppDatabase(connection);
|
||||
await verifier.migrateAndValidate(db, 13);
|
||||
await verifier.migrateAndValidate(db, 14);
|
||||
await db.close();
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue