Add Compose editor + migrate core architecture to CodeEditorDelegate (breaking) - #839
Draft
itsvks19 wants to merge 23 commits into
Draft
Add Compose editor + migrate core architecture to CodeEditorDelegate (breaking)#839itsvks19 wants to merge 23 commits into
CodeEditorDelegate (breaking)#839itsvks19 wants to merge 23 commits into
Conversation
itsvks19
marked this pull request as draft
May 1, 2026 12:53
itsvks19
marked this pull request as ready for review
May 3, 2026 13:10
Contributor
Author
|
@Rosemoe merge when? |
Owner
|
I'll review this probably this weekend. It's quite a big change. |
Conflicts: editor/src/main/java/io/github/rosemoe/sora/widget/CodeEditor.java gradle/libs.versions.toml
Conflicts: gradle/libs.versions.toml
Contributor
Author
|
I think I need to recreate PR, as this PR is messed up. |
itsvks19
marked this pull request as draft
August 8, 2026 04:30
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.
This PR adds a new
editor-composemodule and rewires a big part of the editor so it can run in Compose without depending on the Android View (CodeEditor).To make that work, the core logic now goes through
CodeEditorDelegateinstead of the View. The old View-based editor still works, but it’s no longer the center of everything.Also fixes a bunch of annoying interop issues along the way (gesture conflicts, IME weirdness, some leaks, etc.).
Breaking changes
Events no longer return
CodeEditor.They now return
CodeEditorDelegate.Before:
After:
If you were using the View directly from events, you’ll need to update that.
Helper for migration
Added this:
CodeEditorif you're in View modenullif you're using ComposeExample:
Compose doesn’t have a View, so passing
CodeEditoraround in events doesn’t make sense anymore.CodeEditorDelegatebecomes the common layer that works for both:CodeEditor)editor-compose)Compose usage
This is a big change, but it should make future work (especially Compose stuff) much cleaner.