Skip to content

[ai] properties: Show total size for local selections. - #4748

Open
carrerasdarren-cell wants to merge 1 commit into
TeamAmaze:release/4.0from
carrerasdarren-cell:feature/batch-properties-4266
Open

carrerasdarren-cell wants to merge 1 commit into
TeamAmaze:release/4.0from
carrerasdarren-cell:feature/batch-properties-4266

Conversation

@carrerasdarren-cell

Copy link
Copy Markdown
Contributor

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.FILE selections. 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

  • Added unit tests for specific individual functions (the regression is exercised through the actual activity/action mode).
  • Added headless tests for new app functionality: 24 passing Robolectric cases across eight methods configured for API 21, 28 and 30.
  • Ran a real emulator UI workflow using an external Espresso evidence harness (not committed to the PR).

Test plan:

  • On original production sources, one explicitly selected primary regression method fails with 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.
  • Check nested folders, mixed files/folders, zero-size selections, selection snapshots after action-mode cleanup, the existing single-item dialog, empty selections, unsupported batch modes and dismissal while calculation is queued. Synthetic input file bytes remain unchanged.

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 items and Total: 229 kB. All fixture bytes remain unchanged. Result: OK (1 test).

Screenshots show the actual selection and resulting dialog:

amaze4266-ui-api29-selection amaze4266-ui-api29-properties

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.

.positiveColor(themedActivity.getAccent())
.build();

AsyncTask<Void, Void, Long> task =

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.
@carrerasdarren-cell
carrerasdarren-cell force-pushed the feature/batch-properties-4266 branch from 0fcaa35 to 63fbdff Compare November 7, 2026 13:14
@VishnuSanal VishnuSanal added the PR-Requested-Changes this PR is awaiting an update from the author label Nov 8, 2026
@EmmanuelMess

Copy link
Copy Markdown
Member

@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.

@EmmanuelMess EmmanuelMess added Needs-OPResponse Needs original poster to respond and removed PR-Requested-Changes this PR is awaiting an update from the author labels Nov 13, 2026
@carrerasdarren-cell

Copy link
Copy Markdown
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs-OPResponse Needs original poster to respond

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants