Modern-Apps.git
Publicgit clone https://git.maproj.org/Modern-Apps.gitModern-Apps.git / files / AGENTS.md
| 1 | # AGENTS.md — files/ (':files') |
| 2 | |
| 3 | > Scoped supplement. Global rules in root `AGENTS.md` apply. Stay inside `files/` + allowed shared modules. Do not root-scan. |
| 4 | |
| 5 | _Install: ./install files (dev by default)._ |
| 6 | <!-- last-reviewed: 2026-10-16 --> |
| 7 | - Gradle: :files / dir: files/ |
| 8 | - Package roots present: ui, data, platform |
| 9 | - Entry files: MainActivity.kt, Route.kt, Navigation.kt (FilesApplication.kt was deleted by the shared-boilerplate migration — do NOT re-add) |
| 10 | - Deps: :library:image |
| 11 | - Metadata: metadata_data/files.md (present) |
| 12 | - Rust: no / screenshotTest: yes |
| 13 | |
| 14 | ## Overview |
| 15 | **Purpose:** Offline file manager — browse/move/copy/rename/delete across the device, built-in text editor, system file-picker provider, background long operations. |
| 16 | **Key features:** |
| 17 | - Directory listing with breadcrumbs, grid/list items, properties dialogs, clipboard (cut/copy/paste) and home screen |
| 18 | - Built-in text editor (`TextEditorActivity` + `TextEditorViewModel`); zip/unzip via workers with progress notifications |
| 19 | - SAF surfaces (`DocumentPickerActivity`, `StorageUris`) so other apps can pick files here |
| 20 | **Architecture / data-flow:** `ui/FilesShell` + directory pages → `platform/FilesViewModel` (+ `FilesUiContract`) → `platform/FilesListing` over SAF/MediaStore; long ops run in `ZipWorker`/`UnzipWorker` with `ProgressNotificationWorker` surfacing progress. |
| 21 | **Entry points + reading order:** `Route` → `MainActivity.kt` → `Navigation.kt` → `ui/FilesShell.kt` → `platform/FilesViewModel.kt` → `platform/FilesListing.kt`. |
| 22 | **Gotchas:** |
| 23 | - File ops must survive process death — they belong in workers, never in the ViewModel |
| 24 | - Persistable SAF URI permissions are required for non-owned trees; losing them silently breaks listing |
| 25 | |
| 26 | ## Key files |
| 27 | ### Root — entry + navigation |
| 28 | - com/vayunmathur/files/MainActivity.kt |
| 29 | - com/vayunmathur/files/Navigation.kt |
| 30 | - com/vayunmathur/files/Route.kt |
| 31 | ### data/saf/ — picker + URI bookkeeping |
| 32 | - com/vayunmathur/files/data/saf/DocumentPickerActivity.kt |
| 33 | - com/vayunmathur/files/data/saf/StorageUris.kt |
| 34 | ### platform/ — ViewModel, listing, clipboard, workers |
| 35 | - com/vayunmathur/files/platform/FilesViewModel.kt |
| 36 | - com/vayunmathur/files/platform/FilesUiContract.kt |
| 37 | - com/vayunmathur/files/platform/FilesListing.kt |
| 38 | - com/vayunmathur/files/platform/FilesClipboard.kt |
| 39 | - com/vayunmathur/files/platform/TextEditorViewModel.kt |
| 40 | - com/vayunmathur/files/platform/ZipWorker.kt |
| 41 | - com/vayunmathur/files/platform/UnzipWorker.kt |
| 42 | - com/vayunmathur/files/platform/ProgressNotificationWorker.kt |
| 43 | - com/vayunmathur/files/platform/ArchiveLimits.kt |
| 44 | ### ui/ + ui/components/ + ui/dialogs/ — shell, listing, editor |
| 45 | - com/vayunmathur/files/ui/FilesShell.kt |
| 46 | - com/vayunmathur/files/ui/FilesNavActions.kt |
| 47 | - com/vayunmathur/files/ui/DirectoryScreen.kt |
| 48 | - com/vayunmathur/files/ui/DirectoryPage.kt |
| 49 | - com/vayunmathur/files/ui/DirectoryListing.kt |
| 50 | - com/vayunmathur/files/ui/DirectoryBreadcrumbs.kt |
| 51 | - com/vayunmathur/files/ui/DirectoryLeading.kt |
| 52 | - com/vayunmathur/files/ui/DirectoryMenus.kt |
| 53 | - com/vayunmathur/files/ui/DirectoryDialogs.kt |
| 54 | - com/vayunmathur/files/ui/DirectoryParentPane.kt |
| 55 | - com/vayunmathur/files/ui/HomeScreen.kt |
| 56 | - com/vayunmathur/files/ui/HomeScreenBinder.kt |
| 57 | - com/vayunmathur/files/ui/TextEditorActivity.kt |
| 58 | - com/vayunmathur/files/ui/components/DirectoryItem.kt |
| 59 | - com/vayunmathur/files/ui/components/GridItem.kt |
| 60 | - com/vayunmathur/files/ui/dialogs/PropertiesDialog.kt |
| 61 | |
| 62 | ## Verify (this module only) |
| 63 | ``` |
| 64 | ./gradlew :files:compileDevKotlin |
| 65 | ./gradlew :files:lint |
| 66 | ./gradlew :files:checkMetadata |
| 67 | ``` |