Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Presets: remember and show last used presets #3026

Merged
merged 1 commit into from
Oct 7, 2022

Conversation

limonspb
Copy link
Member

@limonspb limonspb commented Sep 22, 2022

Simply remembers the last 50 used presets and shows them above other presets in the search results if any are matching with the search parameters.

Allows users to quickly reuse the presets without the actual search.

Sorts favorite presets by the last date/time they were applied.

Remembers presets by the full relative path in the repo without the repo url.
So all presets repos are sharing the same "favorite" presets list.

To test: pick and save one or a few presets.
Check if they appear above the other presets in the search results.

@limonspb limonspb requested review from chmelevskij and removed request for chmelevskij September 22, 2022 08:44
@limonspb limonspb marked this pull request as draft September 22, 2022 08:54
Copy link
Member

@chmelevskij chmelevskij left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy to add more suggestions once it's not draft 😉

src/tabs/presets/presets.js Show resolved Hide resolved
src/tabs/presets/presets.js Show resolved Hide resolved
}

_purgeOldPresets() {
this._favoritePresetsList.splice(s_maxFavoritePresetsCount, this._favoritePresetsList.length);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not this._favoritePresetsList = [];

Copy link
Member Author

@limonspb limonspb Sep 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this does not clean the list, it just makes sure it does not have more elements than s_maxFavoritePresetsCount
so it removes all elements starting from s_maxFavoritePresetsCount + 1. (i just added + 1)
Max number of elements to be removed is this._favoritePresetsList.length.

src/tabs/presets/FavoritePresets.js Outdated Show resolved Hide resolved
@limonspb limonspb marked this pull request as ready for review September 22, 2022 09:48
@sonarcloud
Copy link

sonarcloud bot commented Sep 22, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@github-actions
Copy link
Contributor

Do you want to test this code? Here you have an automated build:
Betaflight-Configurator-Android
Betaflight-Configurator-Linux
Betaflight-Configurator-macOS
Betaflight-Configurator-Windows
WARNING: It may be unstable and result in corrupted configurations or data loss. Use only for testing!

@blckmn
Copy link
Member

blckmn commented Sep 22, 2022

AUTOMERGE: (FAIL)

  • github identifies PR as mergeable -> FAIL
  • assigned to a milestone -> PASS
  • cooling off period lapsed -> PASS
  • commit count less or equal to three -> PASS
  • Don't merge label NOT found -> PASS
  • at least one RN: label found -> PASS
  • Tested label found -> FAIL
  • assigned to an approver -> PASS
  • approver count at least three -> FAIL

@limonspb limonspb added this to the 10.9.0 milestone Sep 23, 2022
@limonspb limonspb self-assigned this Sep 23, 2022
@blckmn blckmn merged commit edd5edd into betaflight:master Oct 7, 2022
@limonspb limonspb deleted the fav_presets branch October 7, 2022 02:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants