Repository navigation
task: mirror host autosave in the demo apps - #743
Merged
Merged
Conversation
The demo ignored content-change events, so it could not reveal when they stopped firing. Mirroring a host app's autosave makes Save track unsaved changes and lets an editor reload restore them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A55JP8ZvqUAq4yct9nzckD
`getTitleAndContent` returns the `originalContent` it is given when nothing changed since the previous read. Passing the configuration's content meant a second save without new edits sent the post's original content. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A55JP8ZvqUAq4yct9nzckD
The demo ignored content-change events, so it could not reveal when they stopped firing. Mirroring a host app's autosave makes Save track unsaved changes and lets an editor reload restore them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A55JP8ZvqUAq4yct9nzckD
dcalhoun
force-pushed
the
task/demo-app-host-autosave
branch
from
September 29, 2026 15:00
5138f0a to
3544e5f
Compare
XCFramework BuildThis PR's XCFramework is available for testing. Add the following to your .package(url: "https://github.com/wordpress-mobile/GutenbergKit", branch: "pr-build/743")Built from c20c86c |
1 task done
Save's task ran off the main thread and wrote state SwiftUI reads on the main thread. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A55JP8ZvqUAq4yct9nzckD
Undoing back to the opened content sends no content-change event, so Save stayed enabled after saving that state and a reload restored the undone text. The Android demo already refreshes its copy on save. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A55JP8ZvqUAq4yct9nzckD
dcalhoun
marked this pull request as ready for review
September 29, 2026 17:14
crazytonyli
approved these changes
Sep 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Implement an in-memory persistence for content changes in the demo app.
Why?
Simplify testing content change events to host apps. Without this, broken communication is likely to go unnoticed—e.g., #744.
How?
Hook into the existing content change bridge events to capture change in memory. Configure the editor with a latest content provider to allow the editor to restore in-memory changes after reloads.
Testing Instructions
This is not testable on its own as #744 fixes broken content change bridge communication. Test that instead.
Accessibility Testing Instructions
N/A, no user-facing changes.
Screenshots or screencast
N/A, no user-facing changes.
AI-generated details
Why: The demo apps ignored
onEditorContentChanged, so the regression from #691 (the event stopped firing) went unnoticed until testing WordPress-Android. Unlike the host apps, the demos kept no host-side copy of the content.What:
getTitleAndContent()on each content-change event into an in-memory copy, as a host app's autosave would.getTitleAndContentreturns theoriginalContentit is given when nothing changed since the previous read.🤖 Generated with Claude Code
https://claude.ai/code/session_01A55JP8ZvqUAq4yct9nzckD