Repository navigation
[ai] properties: Show total size for local selections. - #4748
carrerasdarren-cell wants to merge 1 commit into
Conversation
| .positiveColor(themedActivity.getAccent()) | ||
| .build(); | ||
|
|
||
| AsyncTask<Void, Void, Long> task = |
There was a problem hiding this comment.
IMO it would be nice if you can use RxJava over the no longer recommended AsyncTask.
May check our codebase for examples, or simply check the use of com.amaze.filemanager.asynchronous.asynctasks.Task if it fits your usecase.
Add contextual Properties for ordinary local multi-selection. Snapshot the selection, calculate the total on the RxJava I/O scheduler, and deliver it on the main thread only while the dialog is showing. Dispose the calculation when the dialog closes. Keep the existing single-item dialog and unsupported-backend behavior. Addresses TeamAmaze#4266. Incorporates the RxJava review on TeamAmaze#4748. Validated with 24 focused Robolectric cases, spotlessCheck, and assembleDebug for F-Droid and Play. Codex assisted with the change and tests; no new device or human validation is claimed.
0fcaa35 to
63fbdff
Compare
|
@carrerasdarren-cell how did you land on that design? the UI is already pretty filled with elements, and I am not sure that adding a "properties" item to a selection dropdown is the most intuitive. |
|
Hi Emmanuel, I put Properties in the selection overflow because #4266 asks for the combined size of the files and folders already selected. I kept it in the overflow to avoid adding another toolbar icon, and kept the existing Properties dialog for a single item. For a selection of multiple local items, the dialog shows the item count and combined size. Do you have a placement in mind that would make this easier to find? I’m happy to adjust it. |
Addresses #4266.
Description
Add Properties to the selection action menu for ordinary local files and folders. Multiple selected entries show their item count and combined recursive size, calculated asynchronously using the existing size utility. Snapshot the selection before action mode closes, and discard the displayed result if the dialog is dismissed while calculation is queued.
This addresses
OpenMode.FILEselections. Other batch backends remain unavailable. The single-item action retains its established Properties dialog. This PR deliberately does not claim batch support for remote/document backends.Issue tracker
Addresses #4266.
Automatic tests
Test plan:
The selection menu must contain Properties. This is one actual assertion failure; no full original SDK matrix is claimed../gradlew :app:testFdroidDebugUnitTest --tests com.amaze.filemanager.adapters.BatchPropertiesActionModeTest: all 24 actual cases pass, with zero failures, errors or skips.These headless tests seed the real selection model, then exercise the owner's action-mode/menu/callback and asynchronous dialog. The separate emulator run below exercises actual row selection.
Manual tests
Done — physical-device testing and human manual review are not claimed.
Device: AOSP arm64 emulator, AVD
amaze3040_api29.OS: Android 10 / API 29, verified from the running image.
UI evidence
The external Espresso test long-presses a real folder row, selects a real file row, opens the contextual Properties command and checks the actual dialog. Its three synthetic files total 229,376 bytes including nested files; the dialog displays
2 itemsandTotal: 229 kB. All fixture bytes remain unchanged. Result:OK (1 test).Screenshots show the actual selection and resulting dialog:
Build tasks success
Successfully ran the following owner tasks locally:
./gradlew assembleDebug— FDroid and Play debug APKs rebuilt with changed hashes../gradlew spotlessCheck.Validation used an external SSD resource/report init script with owner tasks, dependencies and fail-fast behavior retained. No permanent build/dependency configuration changed. The entire application test suite was not run.
Generative code
This PR used generative code tools (GenAI, LLMs, etc.).
Model: OpenAI Codex; the exact model identifier is not exposed in this session.
Version: Not exposed; no specific version is claimed.
Provider: OpenAI.
Codex assisted with source inspection, implementation, tests and evidence review. AI review is not presented as human validation.