-
Notifications
You must be signed in to change notification settings - Fork 85
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
TF2 floating cursor #1598
TF2 floating cursor #1598
Conversation
@alexzhirkevich , is the MR still in a draft state, or we should review it? |
Hi. You can review this, it is quite small and just enables cursor from the old text field
Sounds awesome, is there an active branch? |
LGTM. Actually, this fix is useful despite the textfield experiment: it forwards TextLayoutResult, which is required for many UITextInput methods, it would help to support native iOS text input experience in BTF2 @m-sasha, could you please also review Skiko part? |
...ui/src/skikoMain/kotlin/androidx/compose/ui/platform/PlatformTextInputMethodRequest.skiko.kt
Outdated
Show resolved
Hide resolved
…m/PlatformTextInputMethodRequest.skiko.kt Co-authored-by: Andrei Salavei <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've been passing data from platformSpecificTextInputSession
to the PlatformTextInputService
s via direct calls on PlatformTextInputSession
(e.g. notifyFocusedRect
), but I think doing it with a flow instead is better, because it means in cases where the data isn't needed, it won't be computed.
@@ -112,6 +114,7 @@ internal actual suspend fun PlatformTextInputSession.platformSpecificTextInputSe | |||
onEditCommand = ::onEditCommand, | |||
onImeAction = onImeAction, | |||
editProcessor = editProcessor, | |||
textLayoutResult = snapshotFlow(layoutState::layoutResult).filterNotNull(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure we don't want to forward null
s to the text input service? I'm not entirely sure when the layout can be null
, but isn't it possible the text input service will remain stuck with a stale non-null value if we're filtering null
s?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not completely sure, but notifyFocusedRect
you mentioned above does also ignore null rects. And PlatformTextInputService for TF1 is not notified about null layouts too
Let's run the CI, and I think we can merge if it passes. |
@@ -34,4 +36,6 @@ actual interface PlatformTextInputMethodRequest { | |||
val onImeAction: ((ImeAction) -> Unit)? | |||
@ExperimentalComposeUiApi | |||
val editProcessor: EditProcessor? | |||
@ExperimentalComposeUiApi | |||
val textLayoutResult: Flow<TextLayoutResult> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this change you need to update API dump. Please run ./gradlew desktopApiDump
and commit changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
@m-sasha , could you please re-approve API updates?
…ich/compose-multiplatform-core into btf2-floating-cursor
This should be enough for iOS TF2 floating cursor to work.
Release Notes
iOS - Features