Open
Conversation
Signed-off-by: Raymond Lai <airwave209gt@gmail.com>
There was a problem hiding this comment.
Pull Request Overview
Adds rename support across storage providers, updates documentation, unit tests, and the sample app UI to demonstrate file renaming.
- Introduce a
renamemethod in the core interface and implement it for Google Drive and Dropbox - Add a unit test for Dropbox renaming and update CLI scripts and wrapper properties
- Extend sample app: new rename dialog, view model logic, events/actions, docs, and README
Reviewed Changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/core/.../OmhStorageClient.kt | Added abstract rename method and docs |
| packages/plugin-googledrive-gms/.../GoogleDriveGmsOmhStorageClient.kt | Override rename in Google Drive client |
| packages/plugin-dropbox/.../DropboxFileRepository.kt | Add rename method delegation |
| packages/plugin-dropbox/.../DropboxOmhStorageClient.kt | Override rename in Dropbox client |
| packages/plugin-dropbox/.../DropboxFileRepositoryTest.kt | Add unit test for renaming |
| docs/markdown/getting-started.md | Document rename usage |
| apps/storage-sample/.../strings.xml | New strings for rename |
| apps/storage-sample/.../dialog_rename_file.xml | Layout for rename dialog |
| apps/storage-sample/.../dialog_file_menu.xml | Include rename option in file menu |
| apps/storage-sample/.../rename_outline.xml | Icon resource for rename |
| apps/storage-sample/.../FileViewerViewEvent.kt | New RenameFile and RenameFileClicked |
| apps/storage-sample/.../FileViewerViewAction.kt | New ShowRename action |
| apps/storage-sample/.../FileMenuDialog.kt | Wire up rename menu item |
| apps/storage-sample/.../FileViewerViewModel.kt | Handle rename events and dispatch rename |
| apps/storage-sample/.../FileViewerFragment.kt | Show rename dialog and wiring |
| README.md | Update capabilities table with rename |
| gradlew, gradlew.bat, gradle-wrapper.properties | Bump Gradle version and script improvements |
Comments suppressed due to low confidence (4)
docs/markdown/getting-started.md:108
- The client API defines
rename(...), notrenameFile(...). Update docs to callomhStorageClient.rename(...)for consistency.
val renamedFile = omhStorageClient.renameFile(
packages/plugin-dropbox/src/test/java/com/openmobilehub/android/storage/plugin/dropbox/data/repository/DropboxFileRepositoryTest.kt:1130
- This test only stubs and verifies
repository.renameitself, not the underlyingrenameFileAPI call. Consider mockingapiServiceor invoking the realrenameFileimplementation to validate correct behavior.
fun `Test renaming a file`() {
apps/storage-sample/src/main/java/com/openmobilehub/android/storage/sample/presentation/file_viewer/model/FileViewerViewAction.kt:24
- [nitpick] Consider renaming this action to
ShowRenameDialogorShowFileRenameto match otherShow*actions and clarify its intent.
object ShowRename: FileViewerViewAction()
apps/storage-sample/src/main/java/com/openmobilehub/android/storage/sample/presentation/file_viewer/dialog/menu/FileMenuDialog.kt:110
- [nitpick] The variable
renameshadows the method name and is ambiguous; consider renaming it torenameMenuItemor similar.
rename.icon.setImageResource(R.drawable.rename_outline)
packages/core/src/main/java/com/openmobilehub/android/storage/core/OmhStorageClient.kt
Outdated
Show resolved
Hide resolved
...java/com/openmobilehub/android/storage/sample/presentation/file_viewer/FileViewerFragment.kt
Outdated
Show resolved
Hide resolved
...ava/com/openmobilehub/android/storage/sample/presentation/file_viewer/FileViewerViewModel.kt
Show resolved
Hide resolved
Grammar fix (chore) Null check before rename dialog pops up Signed-off-by: Raymond Lai <airwave209gt@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implement rename function for storage providers.
At its initial implementation, no filename duplication checking is implemented since Google allows same filenames even in the same folder. Comments welcomed to see if filename duplication check should be the default.
Manual test OK on Google, Dropbox and Onedrive, using storage-sample app.
Demo
Rename function had been added to storage-sample app.
Screen_recording_20250604_230303.webm
Checklist: