From 869b2cc5c7ef31724a15afc6278e9d977f7dabd6 Mon Sep 17 00:00:00 2001 From: Robbie Cooper Date: Tue, 27 Aug 2024 19:08:57 -0400 Subject: [PATCH 1/5] Fix debouncing not working on first search character Should partially address #1729 and #769. Signed-off-by: Robbie Cooper --- .../owncloud/notes/edit/SearchableBaseNoteFragment.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/src/main/java/it/niedermann/owncloud/notes/edit/SearchableBaseNoteFragment.java b/app/src/main/java/it/niedermann/owncloud/notes/edit/SearchableBaseNoteFragment.java index 12d0cf2d..6814e4c0 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/edit/SearchableBaseNoteFragment.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/edit/SearchableBaseNoteFragment.java @@ -228,8 +228,7 @@ public abstract class SearchableBaseNoteFragment extends BaseNoteFragment { handler.removeCallbacksAndMessages(null); } delayQueryTask = new DelayQueryRunnable(newText); - // If there is only one char in the search pattern, we should start the search immediately. - handler.postDelayed(delayQueryTask, newText.length() > 1 ? delay : 0); + handler.postDelayed(delayQueryTask, delay); } class DelayQueryRunnable implements Runnable { From a7859e1faa58055206751534092cec830a5fcd8a Mon Sep 17 00:00:00 2001 From: Robbie Cooper Date: Tue, 27 Aug 2024 20:04:30 -0400 Subject: [PATCH 2/5] Use a longer debounce delay for short search strings This gives the user more time to type in their whole query before a search blocks the main thread. Searches for short strings often have many results that aren't really useful to the user. They also take much longer to process. This commit increases the debounce delay to 200ms for short strings three characters long or less. Longer strings still have the 50ms delay. Hopefully, this is a good balance between avoiding slowdowns for short strings and providing a snappy interactive experience for long strings. --- .../owncloud/notes/edit/SearchableBaseNoteFragment.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/it/niedermann/owncloud/notes/edit/SearchableBaseNoteFragment.java b/app/src/main/java/it/niedermann/owncloud/notes/edit/SearchableBaseNoteFragment.java index 6814e4c0..54d9f4e5 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/edit/SearchableBaseNoteFragment.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/edit/SearchableBaseNoteFragment.java @@ -48,6 +48,8 @@ public abstract class SearchableBaseNoteFragment extends BaseNoteFragment { private SearchView searchView; private String searchQuery = null; private static final int delay = 50; // If the search string does not change after $delay ms, then the search task starts. + private static final int shortStringDelay = 200; // A longer delay for short search strings. + private static final int shortStringSize = 3; // The maximum length of a short search string. private boolean directEditRemotelyAvailable = false; // avoid using this directly, instead use: isDirectEditEnabled() @ColorInt @@ -228,7 +230,8 @@ public abstract class SearchableBaseNoteFragment extends BaseNoteFragment { handler.removeCallbacksAndMessages(null); } delayQueryTask = new DelayQueryRunnable(newText); - handler.postDelayed(delayQueryTask, delay); + // If there are few chars in the search pattern, we should start the search later. + handler.postDelayed(delayQueryTask, newText.length() > shortStringSize ? delay : shortStringDelay); } class DelayQueryRunnable implements Runnable { From 5ea92eeaf5d4c851050d657d1bc576c227e0e3ff Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 19 Sep 2024 10:55:49 +0000 Subject: [PATCH 3/5] chore(deps): update github/codeql-action action to v3.26.8 --- .github/workflows/codeql.yml | 4 ++-- .github/workflows/scorecard.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 3b92074e..f1baac39 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -39,7 +39,7 @@ jobs: with: swap-size-gb: 10 - name: Initialize CodeQL - uses: github/codeql-action/init@8214744c546c1e5c8f03dde8fab3a7353211988d # v3.26.7 + uses: github/codeql-action/init@294a9d92911152fe08befb9ec03e240add280cb3 # v3.26.8 with: languages: ${{ matrix.language }} - name: Set up JDK 17 @@ -53,4 +53,4 @@ jobs: echo "org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError" > "$HOME/.gradle/gradle.properties" ./gradlew assembleDebug - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@8214744c546c1e5c8f03dde8fab3a7353211988d # v3.26.7 + uses: github/codeql-action/analyze@294a9d92911152fe08befb9ec03e240add280cb3 # v3.26.8 diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index fa125392..e5e6986d 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -42,6 +42,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@8214744c546c1e5c8f03dde8fab3a7353211988d # v3.26.7 + uses: github/codeql-action/upload-sarif@294a9d92911152fe08befb9ec03e240add280cb3 # v3.26.8 with: sarif_file: results.sarif From b9f2ef96108cde0ae7ddfa0ab2cd9a4c65561748 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 20 Sep 2024 17:25:52 +0000 Subject: [PATCH 4/5] chore(deps): update dependency fastlane to v2.222.0 --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index bfae8103..41501832 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -39,7 +39,7 @@ GEM dotenv (2.8.1) emoji_regex (3.2.3) excon (0.111.0) - faraday (1.10.3) + faraday (1.10.4) faraday-em_http (~> 1.0) faraday-em_synchrony (~> 1.0) faraday-excon (~> 1.1) From a7ea654aa63b298576204675ae9b8edd96a6e7ae Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 23 Sep 2024 22:40:44 +0000 Subject: [PATCH 5/5] chore(deps): update dependency gradle to v8.10.2 --- gradle/wrapper/gradle-wrapper.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 0aaefbca..df97d72b 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME