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

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.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant