Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch Messages choose folder and create doc to Activity Result API #8753

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

marcRDZ
Copy link
Contributor

@marcRDZ marcRDZ commented Jan 16, 2025

Change related to #7758

Migrate choose folder and create doc results to new API on message screens

@marcRDZ marcRDZ force-pushed the task-7758_messages-result-api branch from a6c7dd1 to 626cb75 Compare January 20, 2025 09:44
@marcRDZ marcRDZ force-pushed the task-7758_messages-result-api branch 2 times, most recently from 3c850af to 3fc0a0e Compare January 21, 2025 14:19
@cketti
Copy link
Member

cketti commented Jan 21, 2025

Please note that you can run the detekt Gradle task locally to be notified of the code quality issues that will fail the CI build if not addressed.

@marcRDZ
Copy link
Contributor Author

marcRDZ commented Jan 22, 2025

Yes, I ran spotless but not detekt, I just remove a unused enum class but for the too large class problem I have to consider options.
I've extracted MessageViewFragmentListener on a different file but the task is still failing.

@marcRDZ marcRDZ force-pushed the task-7758_messages-result-api branch from 3fc0a0e to 49b78bc Compare January 22, 2025 07:07
@cketti
Copy link
Member

cketti commented Jan 22, 2025

MessageViewFragment was too large before. This was ignored via detekt's baseline mechanism. Fixing this detekt error by splitting apart MessageViewFragment is outside the scope of this pull request. Please suppress the error by using @Suppress("LargeClass").

In general, please try to focus a pull request on one thing. If you have to do some refactoring to make the actual change easier, that's fine, but make it a separate commit. If it's a lot of refactoring, that should be split out to a separate pull request (or even multiple). That will both make it easier to review and easier to understand what was going on should the need arise to look at the Git history at some point in the future.

My suggestion for this pull request:

  • A commit for the renaming of launcher properties (this is a pure refactoring without behavior change). Ideally, this would have happened in a different pull request. It's unrelated to the immediate focus of the pull request.
  • A commit for the CreateDocumentResultContract change
  • A commit for the ChooseFolderResultContract changes
  • A commit for extracting MessageViewFragmentListener. Although you could also drop this. It's a good refactoring. But without the context from the comments in this pull request the question "why was this seemingly unrelated change part of that pull request" would be immediately on my mind.

Having small commits makes it easier to review changes and spot e.g. unintentional behavior changes. Especially in this case where e.g. the CreateDocumentResultContract and ChooseFolderResultContract code consist of multiple interspersed changes in the files.
Of course it's always a balance. You could have separate commits for picking the folder for copy and move operations. But since those two are closely related and share some code, it's better to change them both at the same time. So aim for small commits, but not too small 😄

You've already spent quite some time on this. If the requested changes require more time than you'd like to spend, please let me know and I'll break the commit apart for you.

@marcRDZ marcRDZ force-pushed the task-7758_messages-result-api branch from 49b78bc to df7a7a8 Compare January 22, 2025 13:00
@marcRDZ
Copy link
Contributor Author

marcRDZ commented Jan 22, 2025

No problem at all, next PR will require less time to be resolved as I'm learning your rules and practices. If I was busier on my job I couldn't spend any time here. 😄
The only strange question I find it's why detekt doesn't complain on MessageViewFragment before my PR.

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.

2 participants