wikipedia-ios icon indicating copy to clipboard operation
wikipedia-ios copied to clipboard

add logic to show introduction paragraph is presented differently in the editing view

Open rajparad opened this issue 11 months ago • 7 comments

Phabricator: https://phabricator.wikimedia.org/T212318

Notes

  • This PR covers logic to show alert when clicking on edit introduction. Alert has been shown only once, when clicked "Yes".
  • This is my first PR to WIKI. Need suggestions to confirm the localize string implementation is correct or not. also ticket only mentions to have something so the user knows the order is different. based on that I have used alert to show only once.

Test Steps

  1. Open any article.
  2. Click on pencil in right.
  3. Click on "Edit introduction"
  4. the new alert will appear.
  5. Click "Yes" to proceed, click "cancel" and the repeat the flow again to show Alert.
  6. If clicked "Yes" and want to see Alert again, uninstall app and re-install again.

Screenshots/Videos

  • Eye (Alexander McQueen
  • Eye (Alexander McQueen
  • The ordering of elements will

rajparad avatar Mar 24 '24 16:03 rajparad

Hi @rajparad! Apologies for the review delay on this one. This all looks good from a code perspective - nice work! I will ask our designers to review further in case they have any additional behavior or copy tweaks before merging. Thanks!

tonisevener avatar Apr 16 '24 13:04 tonisevener

Hi @rajparad! Apologies for the review delay on this one. This all looks good from a code perspective - nice work! I will ask our designers to review further in case they have any additional behavior or copy tweaks before merging. Thanks!

No worries, Thanks for the reply!! let me know if there is any feedback from designers :)

rajparad avatar Apr 19 '24 18:04 rajparad

Hello @tonisevener, There was a feedback from design to show alert. there are 2 ways.

Let me know what is your preference from code perspective. I can update accordingly :).

Design feedback is here: https://phabricator.wikimedia.org/T212318

rajparad avatar Apr 23 '24 23:04 rajparad

Hello @tonisevener, There was a feedback from design to show alert. there are 2 ways.

Let me know what is your preference from code perspective. I can update accordingly :).

Design feedback is here: https://phabricator.wikimedia.org/T212318

Hi @rajparad - apologies for the delay. I think we can get pretty close to option #1. You'll want to put in in the correct places in PageEditorViewController. We have a toast component that can be triggered like this:

WMFAlertManager.sharedInstance.showWarningAlert("Text here", sticky: false, dismissPreviousAlerts: true)

The design won't match up exactly, but that is okay.

screenshot

You can trigger within loadContent once all the content is loaded in this method, if no issues have cropped up (i.e. no blocked error, no edit notice is displayed, etc.).

If an edit notice modal is automatically presented, you also want to try triggering it after that edit notice modal is dismissed. Usually the featured article of the day has an edit notice, if you want to test that and see how it behaves.

Hope this helps. Let us know if you have any other questions, thanks!

tonisevener avatar May 24 '24 17:05 tonisevener

Hello @tonisevener, Thanks for the feedback. I have updated the code to show warning. For now it's only show one time for a user.

image

Here is the link: https://github.com/wikimedia/wikipedia-ios/pull/4790/files

Only thing I am curious is it's now only work with English. I am not how to work with localization in project. Let me know if it's fine or not.

rajparad avatar May 29 '24 01:05 rajparad

@rajparad Thanks! A few more changes needed. Also our project changed a bit with some recent merges (a git submodule was deleted, and the name of PageEditorViewController changed to EditorViewController. Hopefully this doesn't cause issues when you pull in the latest from main.

There were no major conflicts apart from having conflict in Localizable string. I still have that and when I try to resolve I don't see any changes coming from my local machine or from Above resolve conflict option in github.

rajparad avatar Jun 28 '24 17:06 rajparad

There were no major conflicts apart from having conflict in Localizable string. I still have that and when I try to resolve I don't see any changes coming from my local machine or from Above resolve conflict option in github.

@rajparad Yeah, that could be because git treats the files in iOS Native Localizations as binary. Generally when I run into strings conflicts, locally I choose the changes from main. Then the next time I build, our build script will automatically regenerate the strings file and cause git to show changes. Then I commit the new changes. Let me know if that works for you, thanks!

tonisevener avatar Jul 03 '24 22:07 tonisevener