From 5047891fe6074a7028b0d4b186e04225db621552 Mon Sep 17 00:00:00 2001 From: CodeDoctorDE Date: Sun, 2 Jun 2024 19:27:59 +0200 Subject: [PATCH] Show no elements message when document search is empty --- app/android/Gemfile.lock | 18 +++++++++--------- app/lib/dialogs/search.dart | 12 ++++++++++-- docs/pnpm-lock.yaml | 28 ++++++++++++++-------------- metadata/en-US/changelogs/107.txt | 4 +++- 4 files changed, 36 insertions(+), 26 deletions(-) diff --git a/app/android/Gemfile.lock b/app/android/Gemfile.lock index b495ce5b7701..903156300b6a 100644 --- a/app/android/Gemfile.lock +++ b/app/android/Gemfile.lock @@ -10,13 +10,13 @@ GEM artifactory (3.0.17) atomos (0.1.3) aws-eventstream (1.3.0) - aws-partitions (1.931.0) + aws-partitions (1.937.0) aws-sdk-core (3.196.1) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.651.0) aws-sigv4 (~> 1.8) jmespath (~> 1, >= 1.6.1) - aws-sdk-kms (1.81.0) + aws-sdk-kms (1.82.0) aws-sdk-core (~> 3, >= 3.193.0) aws-sigv4 (~> 1.1) aws-sdk-s3 (1.151.0) @@ -119,10 +119,10 @@ GEM representable (~> 3.0) retriable (>= 2.0, < 4.a) rexml - google-apis-iamcredentials_v1 (0.20.0) - google-apis-core (>= 0.14.0, < 2.a) - google-apis-playcustomapp_v1 (0.15.0) - google-apis-core (>= 0.14.0, < 2.a) + google-apis-iamcredentials_v1 (0.21.0) + google-apis-core (>= 0.15.0, < 2.a) + google-apis-playcustomapp_v1 (0.16.0) + google-apis-core (>= 0.15.0, < 2.a) google-apis-storage_v1 (0.38.0) google-apis-core (>= 0.15.0, < 2.a) google-cloud-core (1.7.0) @@ -131,12 +131,12 @@ GEM google-cloud-env (2.1.1) faraday (>= 1.0, < 3.a) google-cloud-errors (1.4.0) - google-cloud-storage (1.51.0) + google-cloud-storage (1.52.0) addressable (~> 2.8) digest-crc (~> 0.4) google-apis-core (~> 0.13) google-apis-iamcredentials_v1 (~> 0.18) - google-apis-storage_v1 (~> 0.37) + google-apis-storage_v1 (~> 0.38) google-cloud-core (~> 1.6) googleauth (~> 1.9) mini_mime (~> 1.0) @@ -148,7 +148,7 @@ GEM os (>= 0.9, < 2.0) signet (>= 0.16, < 2.a) highline (2.0.3) - http-cookie (1.0.5) + http-cookie (1.0.6) domain_name (~> 0.5) httpclient (2.8.3) jmespath (1.6.2) diff --git a/app/lib/dialogs/search.dart b/app/lib/dialogs/search.dart index a8340ce1981d..f91f4896e244 100644 --- a/app/lib/dialogs/search.dart +++ b/app/lib/dialogs/search.dart @@ -26,7 +26,7 @@ Future> _searchIsolate(NoteData noteData, String currentPage, class _SearchDialogState extends State { final TextEditingController _searchController = TextEditingController(); - Future> _searchResults = Future.value([]); + Future?> _searchResults = Future.value(null); final FocusNode _focusNode = FocusNode(); @override @@ -121,7 +121,7 @@ class _SearchDialogState extends State { ), const SizedBox(height: 16), Flexible( - child: FutureBuilder>( + child: FutureBuilder?>( future: _searchResults, builder: (context, snapshot) { if (snapshot.hasError) { @@ -136,7 +136,15 @@ class _SearchDialogState extends State { ], ); } + if (!snapshot.hasData) return const SizedBox(); final results = snapshot.data?.toList() ?? []; + if (results.isEmpty) { + return Text( + AppLocalizations.of(context).noElements, + textAlign: TextAlign.center, + style: Theme.of(context).textTheme.bodyLarge, + ); + } return ListView.builder( itemCount: results.length, shrinkWrap: true, diff --git a/docs/pnpm-lock.yaml b/docs/pnpm-lock.yaml index 654d5dd8b508..8769ba99adcb 100644 --- a/docs/pnpm-lock.yaml +++ b/docs/pnpm-lock.yaml @@ -818,8 +818,8 @@ packages: cpu: [x64] os: [win32] - '@shikijs/core@1.6.1': - resolution: {integrity: sha512-CqYyepN4SnBopaoXYwng4NO8riB5ask/LTCkhOFq+GNGtr2X+aKeD767eYdqYukeixEUvv4bXdyTYVaogj7KBw==} + '@shikijs/core@1.6.2': + resolution: {integrity: sha512-guW5JeDzZ7uwOjTfCOFZ2VtVXk5tmkMzBYbKGfXsmAH1qYOej49L5jQDcGmwd6/OgvpmWhzO2GNJkQIFnbwLPQ==} '@types/acorn@4.0.6': resolution: {integrity: sha512-veQTnWP+1D/xbxVrPC3zHnCZRjSrKfhbMUlEA43iMZLu7EsnTtkJklIuwrCPbOi8YkvDQAiW05VQQFvvz9oieQ==} @@ -1036,8 +1036,8 @@ packages: resolution: {integrity: sha512-xlx1yCK2Oc1APsPXDL2LdlNP6+uu8OCDdhOBSVT279M/S+y75O30C2VuD8T2ogdePBBl7PfPF4504tnLgX3zfw==} engines: {node: '>=14.16'} - caniuse-lite@1.0.30001625: - resolution: {integrity: sha512-4KE9N2gcRH+HQhpeiRZXd+1niLB/XNLAhSy4z7fI8EzcbcPoAqjNInxVHTiTwWfTIV4w096XG8OtCOCQQKPv3w==} + caniuse-lite@1.0.30001626: + resolution: {integrity: sha512-JRW7kAH8PFJzoPCJhLSHgDgKg5348hsQ68aqb+slnzuB5QFERv846oA/mRChmlLAOdEDeOkRn3ynb1gSFnjt3w==} ccount@2.0.1: resolution: {integrity: sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==} @@ -2109,8 +2109,8 @@ packages: resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} engines: {node: '>=8'} - shiki@1.6.1: - resolution: {integrity: sha512-1Pu/A1rtsG6HZvQm4W0NExQ45e02og+rPog7PDaFDiMumZgOYnZIu4JtGQeAIfMwdbKSjJQoCUr79vDLKUUxWA==} + shiki@1.6.2: + resolution: {integrity: sha512-X3hSm5GzzBd/BmPmGfkueOUADLyBoZo1ojYQXhd+NU2VJn458yt4duaS0rVzC+WtqftSV7mTVvDw+OB9AHi3Eg==} signal-exit@3.0.7: resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} @@ -2590,7 +2590,7 @@ snapshots: remark-parse: 11.0.0 remark-rehype: 11.1.0 remark-smartypants: 2.1.0 - shiki: 1.6.1 + shiki: 1.6.2 unified: 11.0.4 unist-util-remove-position: 5.0.0 unist-util-visit: 5.0.0 @@ -3020,7 +3020,7 @@ snapshots: '@expressive-code/plugin-shiki@0.35.3': dependencies: '@expressive-code/core': 0.35.3 - shiki: 1.6.1 + shiki: 1.6.2 '@expressive-code/plugin-text-markers@0.35.3': dependencies: @@ -3241,7 +3241,7 @@ snapshots: '@rollup/rollup-win32-x64-msvc@4.18.0': optional: true - '@shikijs/core@1.6.1': {} + '@shikijs/core@1.6.2': {} '@types/acorn@4.0.6': dependencies: @@ -3497,7 +3497,7 @@ snapshots: rehype: 13.0.1 resolve: 1.22.8 semver: 7.6.2 - shiki: 1.6.1 + shiki: 1.6.2 string-width: 7.1.0 strip-ansi: 7.1.0 tsconfck: 3.1.0(typescript@5.4.5) @@ -3559,7 +3559,7 @@ snapshots: browserslist@4.23.0: dependencies: - caniuse-lite: 1.0.30001625 + caniuse-lite: 1.0.30001626 electron-to-chromium: 1.4.788 node-releases: 2.0.14 update-browserslist-db: 1.0.16(browserslist@4.23.0) @@ -3569,7 +3569,7 @@ snapshots: camelcase@7.0.1: {} - caniuse-lite@1.0.30001625: {} + caniuse-lite@1.0.30001626: {} ccount@2.0.1: {} @@ -5158,9 +5158,9 @@ snapshots: shebang-regex@3.0.0: {} - shiki@1.6.1: + shiki@1.6.2: dependencies: - '@shikijs/core': 1.6.1 + '@shikijs/core': 1.6.2 signal-exit@3.0.7: {} diff --git a/metadata/en-US/changelogs/107.txt b/metadata/en-US/changelogs/107.txt index ae78d8a0e7bc..32a4154a9419 100644 --- a/metadata/en-US/changelogs/107.txt +++ b/metadata/en-US/changelogs/107.txt @@ -1,4 +1,6 @@ -* Fix file changing in webdav on root folder +* Show no elements message when document search is empty +* Fix file changing in webdav on root folder ([#714](https://github.com/LinwoodDev/Butterfly/pull/714)) +* Fix layer not set on automatic shapes ([#717](https://github.com/LinwoodDev/Butterfly/pull/717)) * Fix x icon button in navigator page on mobile * Fix page not saved after creating a new page