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

Issue/21180-fixed incorrect working state of 'Three-dots' icon #21352

Merged
merged 20 commits into from
Oct 29, 2024

Conversation

Agoni-0
Copy link
Contributor

@Agoni-0 Agoni-0 commented Oct 24, 2024

Fixes #


Description:

This PR is related to issue#21180.
This issue shows a problem that After blocking the blog, clicking the 'Three-dot' icon has a click effect but does not open the menu.

1.mp4

The issue also mentioned that the spacing between Reading References button and other buttons is incorrect.


Solution:

  1. Solve the incorrect spacing
The two lines of code I deleted caused this error. I'am not sure what they are used for. They are the `Spacer` and not used in other code. So, I delete them. And it works.
  1. Solve the incorrect reaction of Three-dots icon
    In my opinion, after blocking the current blog, the icon is supposed not to work as it used to. I think it is either disabled or change to another icon, which used to undo the blocking action. That's because if the blog is blocked, the buttons in the drop-down menu are not suitable.
    I choose to change the icon to undo when current blog is blocked. If the display time of the undo pop-up is exceeded, there will be no way to undo the blocking action, which I think is inconvenient. Maybe I eventually fall in love with a blog despite I block it at first.
    And my modification works well.
2.mp4

I found that the reason of Clicking the 'Three-dot' icon after blocking a blog does not open the menu, despite the click effect is that the result of function findPost is null.

I created a state variable in ReaderPostDetailViewModel and an observer in ReaderPostDetailFragment. I created a function in the file that makes it possible to modify the value of _postBlocked in the file. This will update _postBlocked when the Block the blog button is clicked, triggering changes in the UI interface. Also, I created variables source and blockedBlogResult to undo the blocking action.


To Test:


Regression Notes

  1. Potential unintended areas of impact

I made some changes to the program to ensure testing successfully. It leads to a bad result that even if the blocking action is revoked, the current blog will still disappear after exiting current blog. I have no way to test this. So, I want to know if this is caused by my changes to ensure testing successfully.

  1. What I did to test those areas of impact (or what existing automated tests I relied on)

    None.

  2. What automated tests I added (or what prevented me from doing so)

    • TODO

PR Submission Checklist:

  • I have completed the Regression Notes.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

Testing Checklist (strike-out the not-applying and unnecessary ones):

  • WordPress.com sites and self-hosted Jetpack sites.
  • Portrait and landscape orientations.
  • Light and dark modes.
  • Fonts: Larger, smaller and bold text.
  • High contrast.
  • Talkback.
  • Languages with large words or with letters/accents not frequently used in English.
  • Right-to-left languages. (Even if translation isn’t complete, formatting should still respect the right-to-left layout)
  • Large and small screen sizes. (Tablet and smaller phones)
  • Multi-tasking: Split screen and Pop-up view. (Android 10 or higher)

@nbradbury
Copy link
Contributor

@Agoni-0 This is really nice work but I'm wondering if there's a better solution than changing the More menu to an undo icon? I'm thinking instead we should change the "Block this blog" menu item to "Unblock this blog."

@Agoni-0
Copy link
Contributor Author

Agoni-0 commented Oct 25, 2024

@Agoni-0 This is really nice work but I'm wondering if there's a better solution than changing the More menu to an undo icon? I'm thinking instead we should change the "Block this blog" menu item to "Unblock this blog."

The current solution is not a perfect solution. However, I think that change the "Block this blog" menu item to "Unblock this blog" is not a good idea.

Because if the blog is blocked, I believe the menu items like "Report this post", "Report this user", "Block this user" and "Subscribe" are unnecessary. And the menu items like "Reading References", "Visit site" and "Share" can be find in the top toolbar.

@Agoni-0
Copy link
Contributor Author

Agoni-0 commented Oct 25, 2024

How about just change the 'undo' icon to a new icon which means 'unblock the blog'?

@nbradbury
Copy link
Contributor

How about just change the 'undo' icon to a new icon which means 'unblock the blog'?

To me changing the More icon to something else just seems odd, and it's nothing we do elsewhere in the app (we don't even do it for the "Block user" feature on that same screen). I could imagine scenarios where the user blocks the blog and then wants to report it, but my guess is that's an edge case.

I would think a better solution would be to either hide or disable the More menu.

@Agoni-0
Copy link
Contributor Author

Agoni-0 commented Oct 25, 2024

I want to use a icon like this. Although it looks a little odd. hhh

SVID_20241025_215533_1.mp4

I think the undo button is necessary because the dialog to undo the blocking action only lasts a short time. Maybe I can just make the menu items unable to use while blocking the post.

Either hiding or disable the More menu is also a good idea. I want to know what you think is the best.

@nbradbury
Copy link
Contributor

Either hiding or disable the More menu is also a good idea. I want to know what you think is the best.

I think hiding it would be better, but either is fine.

@Agoni-0
Copy link
Contributor Author

Agoni-0 commented Oct 25, 2024

I think hiding it would be better, but either is fine.

I finished the hiding change.

@nbradbury
Copy link
Contributor

I finished the hiding change.

Thanks, I do think that's better. Note that there are a couple of unused imports now:

detekt

@Agoni-0
Copy link
Contributor Author

Agoni-0 commented Oct 25, 2024

detekt

I deleted the unused sentences.

@nbradbury
Copy link
Contributor

Unfortunately, there are now failing tests.

ci

Copy link

@Agoni-0
Copy link
Contributor Author

Agoni-0 commented Oct 26, 2024

Unfortunately, there are now failing tests.

I have corrected my code.
The first four errors were caused by me ignoring calls to the ReaderPostCardActionsHandler class in other classes, resulting in the updateBlockedStateFunction function not being initialized. So, I just changed the function to be voidable.
As for the fifth error, I'm so confused.
{DEF67C12-D4CB-47F2-8EA8-4F954E40FDB2}

The above is the detection code that caused the fifth error. It seems that it requires at least a SpacerNoAction menu item, which I think is useless. I read the related codes and still have no idea about what it used for. So I decide to revoke my modifications. This results in the spacing between 'Reader References' and other menu items not equal, just as it used to.

Copy link
Contributor

@nbradbury nbradbury left a comment

Choose a reason for hiding this comment

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

@Agoni-0 Thanks for working on this! :shipit:

@nbradbury nbradbury merged commit 95088f2 into wordpress-mobile:trunk Oct 29, 2024
24 checks passed
Copy link

sentry-io bot commented Nov 5, 2024

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ ApplicationNotResponding: ANR for at least 5000 ms. org.wordpress.android.ui.reader.ReaderPostDetai... View Issue

Did you find this useful? React with a 👍 or 👎

@Agoni-0 Agoni-0 deleted the issue/21180 branch November 6, 2024 01:27
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