From 8259587d4580913a302841225f1cab90cfcc7949 Mon Sep 17 00:00:00 2001 From: ashilkn Date: Sat, 20 Jan 2024 15:39:44 +0530 Subject: [PATCH 1/5] wrap isar.clear() in isar.writeTxn() to avoid error --- lib/db/embeddings_db.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/db/embeddings_db.dart b/lib/db/embeddings_db.dart index eeb5b15c6..e39a10d0a 100644 --- a/lib/db/embeddings_db.dart +++ b/lib/db/embeddings_db.dart @@ -23,7 +23,7 @@ class EmbeddingsDB { } Future clearTable() async { - await _isar.clear(); + await _isar.writeTxn(() => _isar.clear()); } Future> getAll(Model model) async { From 08079a3945038fa5d3baae086f93d83333240911 Mon Sep 17 00:00:00 2001 From: ashilkn Date: Mon, 22 Jan 2024 10:55:59 +0530 Subject: [PATCH 2/5] make memories always scrollable --- lib/ui/home/memories/memories_widget.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/ui/home/memories/memories_widget.dart b/lib/ui/home/memories/memories_widget.dart index 059f10b03..dfd8e6b98 100644 --- a/lib/ui/home/memories/memories_widget.dart +++ b/lib/ui/home/memories/memories_widget.dart @@ -91,7 +91,9 @@ class _MemoriesWidgetState extends State { return SizedBox( height: _maxHeight, child: ListView.builder( - physics: const BouncingScrollPhysics(), + physics: const AlwaysScrollableScrollPhysics( + parent: BouncingScrollPhysics(), + ), scrollDirection: Axis.horizontal, controller: _controller, itemCount: collatedMemories.length, From affdc2d2c71d0a668d3e2e8934a2ed693355c8c3 Mon Sep 17 00:00:00 2001 From: ashilkn Date: Mon, 22 Jan 2024 13:42:46 +0530 Subject: [PATCH 3/5] Change point of maximum scale to maxWidth of memory from left edge of screen --- lib/ui/home/memories/memories_widget.dart | 6 +++++- lib/ui/home/memories/memory_cover_widget.dart | 16 ++++++++++------ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/lib/ui/home/memories/memories_widget.dart b/lib/ui/home/memories/memories_widget.dart index dfd8e6b98..7799bf1f5 100644 --- a/lib/ui/home/memories/memories_widget.dart +++ b/lib/ui/home/memories/memories_widget.dart @@ -98,13 +98,17 @@ class _MemoriesWidgetState extends State { controller: _controller, itemCount: collatedMemories.length, itemBuilder: (context, itemIndex) { - final offsetOfItem = _maxWidth * itemIndex; + final maxScaleOffsetX = + _maxWidth + MemoryCoverWidget.horizontalPadding * 2; + final offsetOfItem = + (_maxWidth + MemoryCoverWidget.horizontalPadding * 2) * itemIndex; return MemoryCoverWidget( memories: collatedMemories[itemIndex], controller: _controller, offsetOfItem: offsetOfItem, maxHeight: _maxHeight, maxWidth: _maxWidth, + maxScaleOffsetX: maxScaleOffsetX, ); }, ), diff --git a/lib/ui/home/memories/memory_cover_widget.dart b/lib/ui/home/memories/memory_cover_widget.dart index ba2e4a736..d56b1a340 100644 --- a/lib/ui/home/memories/memory_cover_widget.dart +++ b/lib/ui/home/memories/memory_cover_widget.dart @@ -14,6 +14,8 @@ class MemoryCoverWidget extends StatefulWidget { final double maxWidth; static const centerStrokeWidth = 1.0; static const aspectRatio = 0.68; + static const horizontalPadding = 2.5; + final double maxScaleOffsetX; const MemoryCoverWidget({ required this.memories, @@ -21,6 +23,7 @@ class MemoryCoverWidget extends StatefulWidget { required this.offsetOfItem, required this.maxHeight, required this.maxWidth, + required this.maxScaleOffsetX, super.key, }); @@ -48,13 +51,12 @@ class _MemoryCoverWidgetState extends State { animation: widget.controller, builder: (context, child) { final diff = (widget.controller.offset - widget.offsetOfItem) + - widthOfScreen / 7; + widget.maxScaleOffsetX; final scale = 1 - (diff / widthOfScreen).abs() / 3.7; return Padding( - padding: const EdgeInsets.symmetric(horizontal: 2.5), - //Adding this row is a workaround for making height of memory cover - //render as [MemoryCoverWidgetNew.height] * scale. Without this, height of rendered memory - //cover will be [MemoryCoverWidgetNew.height]. + padding: const EdgeInsets.symmetric( + horizontal: MemoryCoverWidget.horizontalPadding, + ), child: GestureDetector( onTap: () async { await routeToPage( @@ -67,7 +69,9 @@ class _MemoryCoverWidgetState extends State { forceCustomPageRoute: true, ); setState(() {}); - }, + }, //Adding this row is a workaround for making height of memory cover + //render as [MemoryCoverWidgetNew.height] * scale. Without this, height of rendered memory + //cover will be [MemoryCoverWidgetNew.height]. child: Row( children: [ Container( From 3b8be2486673a688c9a8531b09905b656406cd15 Mon Sep 17 00:00:00 2001 From: ashilkn Date: Wed, 24 Jan 2024 11:59:01 +0530 Subject: [PATCH 4/5] fix: search stuck at loading state --- lib/ui/viewer/search/search_widget.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ui/viewer/search/search_widget.dart b/lib/ui/viewer/search/search_widget.dart index 16db6f85a..7c4b93525 100644 --- a/lib/ui/viewer/search/search_widget.dart +++ b/lib/ui/viewer/search/search_widget.dart @@ -201,7 +201,7 @@ class SearchWidgetState extends State { String query, ) { int resultCount = 0; - final maxResultCount = _isYearValid(query) ? 12 : 11; + final maxResultCount = _isYearValid(query) ? 11 : 10; final streamController = StreamController>(); if (query.isEmpty) { From 0c5a2a00a402bff9181e84c1104d88c0649af718 Mon Sep 17 00:00:00 2001 From: ashilkn Date: Wed, 24 Jan 2024 21:30:50 +0530 Subject: [PATCH 5/5] bump up version to 0.8.47 --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 56f9560ba..71a0eed13 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -12,7 +12,7 @@ description: ente photos application # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 0.8.46+566 +version: 0.8.47+567 environment: sdk: ">=3.0.0 <4.0.0"