feat: Path picker GUI - #21541
Conversation
Like runCatchingWithReport, but only logs the exception instead of also sending a crash report. The upcoming directory picker scans storage, where failures are routine and not worth reporting. Co-authored-by: ShaanNarendran <shaannaren06@gmail.com>
|
Important Maintainers: This PR contains Strings changes
|
criticalAY
left a comment
There was a problem hiding this comment.
The changes from original PR still look good to me
|
To address Brayan's comment:
By deleting the folder. There is no stored list to remove from: the dialog rescans storage each time it opens, and the only thing saved is the path you currently have selected. So switch to the directory you want first, then delete the old folder and it stops appearing. That covers all three of your cases. A delete button here would need to handle media, backups and the active collection, so I would rather keep it out of this PR, which replaces a free text field that had no list to remove from either. Happy to open a follow-up issue for it if you want one. |
Checks whether a directory contains a named file, resolving the canonical path first to guard against path traversal. The upcoming directory picker uses it to spot existing collections. Comes with a JVM test covering the edge cases. Co-authored-by: ShaanNarendran <shaannaren06@gmail.com> Assisted-by: Claude Opus 5
Scans the storage roots for AnkiDroid directories and lists them for one tap selection, so an SD card can be chosen without knowing its path. A neutral button still accepts a custom path, which is normalized, created and checked for writability before being applied. Co-authored-by: ShaanNarendran <shaannaren06@gmail.com>
Replaces the free text AnkiDroid directory field in Advanced settings with the picker. Fixes ankidroid#3114 Co-authored-by: ShaanNarendran <shaannaren06@gmail.com>
1b94e7b to
fc1dc5d
Compare
Scaffolding asked for in review: opens the dialog and checks the default and current directories are offered, and that every entry has a label. Written as a Robolectric test rather than androidTest: the instrumented suite runs against the release variant, where the host activity used by launchFragmentInContainer is missing, as it ships in a debug only manifest. Co-authored-by: ShaanNarendran <shaannaren06@gmail.com>
fc1dc5d to
6d6e921
Compare
Note
Assisted-by: Claude Opus 5
Purpose / Description
Fixes
Approach
See commits, i have broken down the original pr into cleaner commits and few more tests (that doesnt hurt)
How Has This Been Tested?
Everything stays same as original PR:

Learning (optional, can help others)
NA
Checklist
Please, go through these checks before submitting the PR.