Skip to content

Positioning IME bars on iOS - #61981

Merged
fluttergithubbot merged 6 commits into
flutter:masterfrom
LongCatIsLooong:ime-tooltip
Sep 23, 2020
Merged

fluttergithubbot merged 6 commits into
flutter:masterfrom
LongCatIsLooong:ime-tooltip

Conversation

@LongCatIsLooong

@LongCatIsLooong LongCatIsLooong commented Jul 21, 2020 •

Copy link
Copy Markdown
Contributor

Description

Engine: flutter-team-archive/engine#19929

Keep sending marked text rect / caret rect information for the iOS text input plugin to consume.
Turning this into a real PR when #61940 is merged .

ime

Related Issues

Depends on #61940
Fixes #9344

Tests

I added the following tests:

  • the "setMarkedTextRect" group

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I signed the [CLA].
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Did any tests fail when you ran them? Please read [Handling breaking changes].

@justinmc justinmc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, super excited for this.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is a 1 frame delay needed here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The information is sent to the platform every frame if needed.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// No composing text so the width should not be too wide becomes
// No composing text so the width should not be too wide because

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this lag cause jitter when the true information is received? 1 frame swapping between an estimate and true info may be a source of jank.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "true" information does not trigger a UI update of any sort when it's sent to the platform. It will be used as an estimate the next time iOS requests this information.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For multiline text, first and last may not get you the bounding boxes you expect for the left and right positions

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add a test for this case as well.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you elaborate a bit on this? I would expect the marked text to be continuous and has a consistent writing direction, because it's produced by the same IME. Is it because the text within the given TextRange could be using different fonts so they might be grouped in different TextBoxes even if they are on the same line?

@LongCatIsLooong LongCatIsLooong Aug 13, 2020 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the line can have more than 1 run.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

@LongCatIsLooong

Copy link
Copy Markdown
Contributor Author

@GaryQian @justinmc updated. Should be ready for review now.

@justinmc justinmc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// invalid range.
// Invalid range.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// collapsed range.
// Collapsed range.

@GaryQian GaryQian left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@Piinks Piinks added a: fidelity Matching the OEM platforms better a: internationalization Supporting other languages or locales. (aka i18n) a: text input Entering text in a text field or keyboard related problems labels Sep 2, 2020
@LongCatIsLooong

Copy link
Copy Markdown
Contributor Author

Waiting for the release to be cut.

@skia-gold

Copy link
Copy Markdown

Gold has detected about 3 untriaged digest(s) on patchset 16.
View them at https://flutter-gold.skia.org/cl/github/61981

@LongCatIsLooong
LongCatIsLooong force-pushed the ime-tooltip branch 3 times, most recently from 38e3b15 to d9e9759 Compare September 18, 2020 05:15

@justinmc justinmc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New changes LGTM 👍

/// This property is typically used to notify the renderer of input gestures
/// when [RenderEditable.ignorePointer] is true.
RenderEditable? get renderEditable => _editableKey.currentContext!.findRenderObject() as RenderEditable?;
RenderEditable get renderEditable => _editableKey.currentContext!.findRenderObject()! as RenderEditable;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice way of getting rid of all of the exclamation marks elsewhere in the file. I'm still figuring out all of the NNBD stuff but it's looking pretty slick.

@fluttergithubbot

Copy link
Copy Markdown
Contributor

This pull request is not suitable for automatic merging in its current state.

  • The status or check suite Mac framework_tests has failed. Please fix the issues identified (or deflake) before re-applying this label.

@fluttergithubbot

Copy link
Copy Markdown
Contributor

This pull request is not suitable for automatic merging in its current state.

  • The status or check suite Linux web_tests has failed. Please fix the issues identified (or deflake) before re-applying this label.

@fluttergithubbot
fluttergithubbot merged commit 525e76b into flutter:master Sep 23, 2020
@LongCatIsLooong
LongCatIsLooong deleted the ime-tooltip branch September 23, 2020 01:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: fidelity Matching the OEM platforms better a: internationalization Supporting other languages or locales. (aka i18n) a: text input Entering text in a text field or keyboard related problems framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Multi-step input candidate view position incorrect when using physical keyboard

7 participants