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

fix: Remote editor exceptions #109

Draft
wants to merge 21 commits into
base: trunk
Choose a base branch
from
Draft

Conversation

dcalhoun
Copy link
Member

@dcalhoun dcalhoun commented Mar 7, 2025

Related:

What?

Fix breakages and expand the robustness of the remote, site-specific editor implementation.

Why?

Prepare the prototype to be an experimental feature available for some users.

How?

  • Fix breakages related to fetching and loading resources.
  • Expand WebView globals implementation to allow setting arbitrary values required by some resources.
  • Refactor Android configuration to align with the iOS configuration structure.

Testing Instructions

See the iOS and Android PRs:

Accessibility Testing Instructions

N/A, no user-facing changes.

Screenshots or screencast

N/A

@dcalhoun dcalhoun added the [Type] Bug An existing feature does not function as intended label Mar 7, 2025
Base automatically changed from refactor/avoid-private-use-block-editor-settings to trunk March 26, 2025 13:04
dcalhoun added 19 commits March 26, 2025 09:04
The URL checking was added to ensure tapping links within the editor
opened in the OS browser, rather than the WebView. However, basing this
upon the URL is problematic, as JavaScript can also trigger navigation
events. Instead, we now open the URL in the browser if it is
user-initiated--i.e., a user tapped a link.
Filtering by path is brittle and complex. It began failing recently,
presumably due to an inaccurate RegEx pattern or server path change.
Some APIs offer multiple namespace patterns--e.g, site domain or site
ID--so we must receive both to accurately detect the presence of either
in an API request.
Allow the host app to configure the URL used for fetching editor assets.
Some APIs server both global and site-specific paths.
The editor WebView should not navigate for user-initiated navigation
(link taps) or script navigation (window.location), as it will lead to
odd experiences rendering full web pages in the editor view.
Some WordPress plugins rely upon environment globals. Allowing the host
to set these enables support for these plugins.
Allow a development environment where both the bundled (local) and
site-specific (remote) editor is available, so that the host app may
load either editor based on flags or configuration.
This is necessary to detect the namespace when the host can use more
than one format. E.g., `site/<id>` or `site/<domain>`.
Some endpoints are global, not site specific.
Make editor configuration more readable. Mirror the iOS implementation.
Some editor scripts rely upon global properties for configuration.
Replace the "pull" approach with "push", as this new approach seems to
work consistently. This "pull" was originally implemented in:

9d1600a
Inlined CSS was incorrectly externalized, causing breakages.
Avoid intermittent errors:

```
Explain: FATAL EXCEPTION: main Process: com.jetpack.android. prealpha,  PID: 13279 java.lang.IllegalArgumentException:  Parcel: unknown type for value WebViewGlobal(name=_ currentSiteType,  value=StringValue(value= simple) )  at android.os.Parcel.getValueType( Parcel. java: 2421)  at android.os.Parcel.writeValue( Parcel. java: 2320)  with tag AndroidRuntime
```
Ensure the WebView manages all editor-centric requests, and sends
everything else to the OS browser.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant