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

Add GutenbergKit #21223

Open
wants to merge 25 commits into
base: trunk
Choose a base branch
from
Open

Add GutenbergKit #21223

wants to merge 25 commits into from

Conversation

geriux
Copy link
Member

@geriux geriux commented Sep 10, 2024

Related PRs:

This PR adds GutenbergKit behind a feature flag. Due to the complexity of the editor setup in the app, I incorporated the new code into existing files, which made it difficult to work with the mixed Java and Kotlin files.

Most of the editor's functionality should be working, although I disabled some UI elements, such as the undo/redo buttons and certain menu items, until we add support for them.

Current feature support:

  • Create posts and pages
  • Use page layouts from the picker
  • Blogging prompts
  • Share a website into the editor
  • Copy/paste an image into the editor
  • Restore the editor's state if the activity is closed
  • Upload media from the device’s files within the editor
  • Preview posts/pages
  • Sync content changes as you type
  • Auto-save when closing the editor
  • Discard creating a draft if the post is empty (title and content)

To Test:

Note

Precondition: Enable the feature flag, Go to the Me tab > Debug settings > experimental_block_editor

Testing cases

Creating an empty post

  • Open the app
  • Create a new post
  • Type a title and some content
  • Tap on the back arrow
  • Expect: The editor to close and the post to autosave and to be uploaded to the server

Editing an existing post

  • Open the app
  • Go to the posts section
  • Open a post
  • Expect the post content to be in the editor
  • Edit the content
  • Close the editor
  • Open the post
  • Expect the content to be updated

Create an empty page

  • Open the app
  • Go to Pages
  • Add a page
  • Select "Create blank page"
  • Add some content
  • Close the editor
  • Expect the page to be created with the new content

Create a page from a layout

  • Open the app
  • Go to Pages
  • Add a page
  • Select a layout
  • Expect the layout to be added into the editor

Blogging prompts

  • Open the app
  • Scroll to the "Prompts" section
  • Tap on "Answer prompt"
  • Expect the editor to open with the content of the prompt

Sharing a site

  • Open your browser
  • Go to a site
  • Open the sharing window
  • Tap on the Jetpack/WordPress app
  • Expect the app to open and the title and link added into the post

Media upload

  • Open the editor
  • Add an Image/Gallery block
  • Select an image
  • Expect the media to be uploaded

Smoke test the current editor

To make sure no regressions were added, smoke testing the current editor would be great, adding some texts and media to make sure it works as expected.


Regression Notes

  1. Potential unintended areas of impact

    • It should only affect the new editor but smoke testing the production version would be good too.
  2. What I did to test those areas of impact (or what existing automated tests I relied on)

    • Manual testing
  3. What automated tests I added (or what prevented me from doing so)

    • No new tests were added.

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)

@geriux geriux added Gutenberg Editing and display of Gutenberg blocks. Do Not Merge In PRs with this label, our automation will fail a require check, preventing accidental merging labels Sep 10, 2024
@dangermattic
Copy link
Collaborator

dangermattic commented Sep 10, 2024

1 Warning
⚠️ This PR is larger than 300 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.
1 Message
📖 This PR is still a Draft: some checks will be skipped.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Sep 10, 2024

Jetpack📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack Jetpack
FlavorJalapeno
Build TypeDebug
Versionpr21223-57ed1f5
Commit57ed1f5
Direct Downloadjetpack-prototype-build-pr21223-57ed1f5.apk
Note: Google Login is not supported on these builds.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Sep 10, 2024

WordPress📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress WordPress
FlavorJalapeno
Build TypeDebug
Versionpr21223-57ed1f5
Commit57ed1f5
Direct Downloadwordpress-prototype-build-pr21223-57ed1f5.apk
Note: Google Login is not supported on these builds.

Copy link

codecov bot commented Sep 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.51%. Comparing base (80cf2cd) to head (7d7f743).
Report is 34 commits behind head on trunk.

Additional details and impacted files
@@             Coverage Diff             @@
##            trunk   #21223       +/-   ##
===========================================
+ Coverage   40.46%   82.51%   +42.05%     
===========================================
  Files        1530       15     -1515     
  Lines       69826      532    -69294     
  Branches    11443       50    -11393     
===========================================
- Hits        28255      439    -27816     
+ Misses      39124       75    -39049     
+ Partials     2447       18     -2429     
Flag Coverage Δ
82.51% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@wpmobilebot
Copy link
Contributor

Found 1 violations:

The PR caused some dependency changes (expand to see details)

++--- project :libs:editor
+|    \--- org.wordpress.gutenbergkit:android:23-7f3f9409de9531d7ed8d69e63365dd7dfe9bafcd
+|         +--- androidx.core:core-ktx:1.13.1 (*)
+|         +--- androidx.appcompat:appcompat:1.7.0 (*)
+|         +--- com.google.android.material:material:1.12.0 (*)
+|         +--- androidx.webkit:webkit:1.11.0 -> 1.12.0 (*)
+|         \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.0 -> 1.9.10 (*)
+\--- org.wordpress.gutenbergkit:android:23-7f3f9409de9531d7ed8d69e63365dd7dfe9bafcd (*)

Please review and act accordingly

Copy link

sonarcloud bot commented Sep 23, 2024

@geriux geriux marked this pull request as ready for review September 23, 2024 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Do Not Merge In PRs with this label, our automation will fail a require check, preventing accidental merging Gutenberg Editing and display of Gutenberg blocks.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants