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

Remove "WebView" from the Mobile App Entirely #357

Closed
chelseatroy opened this issue Dec 13, 2020 · 5 comments
Closed

Remove "WebView" from the Mobile App Entirely #357

chelseatroy opened this issue Dec 13, 2020 · 5 comments

Comments

@chelseatroy
Copy link
Contributor

What are we doing?

We are removing all of the WebView functionality from the app.

Why are we doing it?

  • Webview, imported directly from react-native as we currently use in the app, is deprecated in lieu of the react native community version. As such, the deprecated one has some issues that won't be fixed.

Additional Context

We initially used Webviews to display projects that were only designed for the browser, back when the app was new and we didn't have many "mobile-friendly" workflows available. That is no longer the case, and we no longer display browser-based projects in the mobile app (removed in this commit). So all views that were designed to show those can be removed. We should also make sure we're not using WebViews anywhere else in the app.

@lcjohnso lcjohnso moved this to Medium Priority in Mobile Effort Oct 4, 2023
@lcjohnso
Copy link
Member

lcjohnso commented Oct 4, 2023

Noting this relevant thread in #458

#458 (comment)

@coryzoon FYI re: 0b0e2d7
Totally OK to bump WebView library, but see #357 -- there shouldn't be any need to keep WebView anymore, as we don't support browser-based classification from within the app.

@lcjohnso It's currently still in the app being used to "Provide Beta Feedback For This Project". Currently on the production version of the app it is crashing if the user clicks this button. This library update will prevent the crash but I will add that it doesn't actually work properly but at least it won't crash. It attempts to open a link to a google doc and fill out form. It doesn't seem to work so I could possibly just remove the feedback button all together or figure out how to make it work. The google doc link is "https://docs.google.com/forms/d/e/1FAIpQLScq85a1bh9QRgSsKpUOfXB0B-o1y5llJx3AyWhxGyq--LtCrw/viewform?usp=pp_url"

Screenshot 2023-10-04 at 12 33 50 PM

#458 (comment)

Thanks for the details re: WebView and beta feedback button, that's very helpful. Sorry for sidetracking PR re: this specific topic. Totally OK to move this conversation to #357 or elsewhere if you wish to defer this side conversation.

Successful use of a "Provide Beta Feedback" button would be to point to the project-specific form that is manually created when we send out the project for testing. That link is created and distributed in the beta invite email and posted in the project announcement banner. There's no automated way of getting this link, so I see no way to make the current button in the app work.

Please remove the button for now -- we can discuss with a broader group possible solutions, but none of them would use the feature as currently implemented:

  1. remove the beta group from the app all together

    • not sure we have ever specifically solicited feedback on projects in mobile
  2. add functionality to show announcement banner in the app (where correct feedback link is provided)

    • in this case, consider opening link in browser on device, not in browser window within app, so we can drop support for that unused functionality

@lcjohnso lcjohnso moved this from Medium Priority to High Priority in Mobile Effort Nov 9, 2023
@coryzoon
Copy link
Contributor

coryzoon commented Nov 9, 2023

The decision is to remove the "Provide Beta Feedback For This Project" button and because it's the only thing using the WebView to also remove the WebView library.

@coryzoon
Copy link
Contributor

@lcjohnso, I removed the "Provide Beta Feedback For This Project" button and the library react-native-webview. However, I did find additional uses of WebView in the mobile app. The additional uses were not using the react-native-webview library, instead they are using the React Native WebView which is deprecated in favor of the react-native-webview libray (see Chelsea's original comment about this).

  1. Field guide, it takes the markdown and converts it to HTML and then displays in a WebView (as seen in screenshot).
  2. Used as a fallback. When you click a project title it goes through this process: 1) If multiple workflows, show "Please choose a workflow". 2) If there is one workflow, open the project in that workflow. 3) If there is no workflow and the project has a "redirect", open the phone web browser to that redirect 4) As a last resort if none of the above happens, open the project slug in a webview.

If these uses are still needed, I would recommend keeping the library and using that instead of the deprecated React Native WebView. I will note that it doesn't seem like anything is breaking so if you wanted to leave as is, I would understand that too.

Simulator Screenshot - iPhone 14 Pro - 2023-11-10 at 07 07 49

@lcjohnso
Copy link
Member

Hi @coryzoon -- Great to see these additional details.

Regarding the additional uses:

Field guide, it takes the markdown and converts it to HTML and then displays in a WebView (as seen in screenshot).

OK, we def want to keep this functionality. Therefore, we're keeping the react-native-webview library and updating the Field Guide to make use of that supported library so we can deprecate the older React Native WebView library.

Used as a fallback. When you click a project title it goes through this process: 1) If multiple workflows, show "Please choose a workflow". 2) If there is one workflow, open the project in that workflow. 3) If there is no workflow and the project has a "redirect", open the phone web browser to that redirect 4) As a last resort if none of the above happens, open the project slug in a webview.

As noted at the top of this issue, we made the decision to stop supporting projects that would need to open in Webview. I'm happy with that decision, so following suggestion in the inline comments added via this commit (referenced at top of issue), I suggest we rip out remaining code related to displaying these fallback cases (your Case 3 and Case 4).

Re: Case 4 -- The idea here: we shouldn't be showing these projects in the mobile app if they are just going to open in a browser window. If volunteers want to engage with this projects while on their mobile device, they can access the web FE directly via a browser, but no need to facilitate that through the app.

FYI re: Case 3 -- the "redirect" option for projects is a relic of the transition from an older backend (Ouroboros) to our current backend (Panoptes) to enable linking to projects that were still hosted on the old backend. There is only one "redirect" project that isn't finished (Old Weather), but it is not nor will ever be mobile friendly, so the filtering of "Finished" project out of the projects list makes Case 3 no longer relevant and makes removing its associated code safe to remove.

@coryzoon coryzoon moved this from High Priority to Underway in Mobile Effort Nov 15, 2023
@lcjohnso
Copy link
Member

Closed by #484

While the final result was to keep WebView for use in beneficial components (i.e., Field Guide), the app was cleaned up to remove WebView's previous use to facilitate non-mobile friendly project participation. Also, the upgrade to a supported library (one of the original drivers in opening this issue) is now complete.

@github-project-automation github-project-automation bot moved this from Underway to Low Priority in Mobile Effort Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

3 participants