Repository navigation
Search backups by their note - #1064
Closed
MitsuhaMone wants to merge 1 commit into
Closed
MitsuhaMone wants to merge 1 commit into
MitsuhaMone wants to merge 1 commit into
Conversation
- applySearch also matches the per-backup note - filter the backups list in the app page and in the restore page by the active note search, so the right backup can be found quickly among dozens The original indices of backupsNewestFirst are preserved when filtering, as they address the backup to restore. If no backup note matches the query (e.g. the app was found by its name), the full backups list is shown as before.
Member
|
LLM-generated code won't be accepted. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The per-backup note (introduced with #1037) is the most specific piece of information a user can attach to a backup — but it is currently not searchable. This PR makes the existing search feature cover it end to end:
singularBackupRestore): each app's backup list is filtered the same way, so the matching backup can be checked and restored directly.Use case
Many users keep a long history of backups for the same app (scheduled + manual), which are hard to tell apart by timestamp alone. Notes like
work account,before factory resetorstable 2.3.1are the natural way to identify what a backup contains — the original request in #1037 was exactly about identifying which account a backup belongs to.Right now, finding a specific backup means opening each app and scanning through its long backups list manually. With this PR:
factory resetin the search bar → only apps that have a backup noted "before factory reset" remain in the listImplementation
FilterUtils.applySearch(): additionally matchesBackup.noteof any backup of the package (case-insensitivecontains, consistent with the existing matching of label / package name / app-level note / tags).FilterUtils.applyNoteSearch(): new helper that filters a backup list by note match, falling back to the full list when no note matches — e.g. when the app was found by its name, its backups list must not suddenly appear empty.AppPageaccepts the activesearchQuery(passed fromHomePage, so it stays live while the search bar is expanded) and filtersbackupsNewestFirstwith it.RestorePackageItemfilters the per-app backup list by the same rule, preserving the originalbackupsNewestFirstindices — those indices address the backup to restore inAppActionWork(pi.backupsNewestFirst[backupIndex]), so a restore always targets exactly the backup the user selected, even when the displayed list is filtered.Behavior notes
Testing
assembleReleasebuilds cleanly (also verified via CI on a fork: fork release build)A follow-up idea (not part of this PR to keep it minimal): highlighting the matched note text in the backup items.