Skip to content

Conversation

@LongCatIsLooong
Copy link
Contributor

@LongCatIsLooong LongCatIsLooong commented Sep 21, 2022

Another one extracted from #110966.

When maxLines == 1 RenderEditable can't be scrolled vertically to reveal clipped contents so it must report its real height (instead of the estimated height preferredLineHeight). I'll try to fix #112123 after this and removes the hack in a later pull request.

Running TGP. TGP passed with no scuba changes.

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@flutter-dashboard flutter-dashboard bot added a: text input Entering text in a text field or keyboard related problems f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. labels Sep 21, 2022
@LongCatIsLooong LongCatIsLooong force-pushed the render-editable-maxLine-1 branch from 11e22ae to 8725a6b Compare September 21, 2022 02:01
@LongCatIsLooong LongCatIsLooong force-pushed the render-editable-maxLine-1 branch from 8725a6b to cfab6de Compare September 21, 2022 03:40
@LongCatIsLooong LongCatIsLooong marked this pull request as ready for review September 21, 2022 03:47
@flutter-dashboard
Copy link

Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change).

If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review.

For more guidance, visit Writing a golden file test for package:flutter.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

Changes reported for pull request #112029 at sha cfab6de

@flutter-dashboard flutter-dashboard bot added the will affect goldens Changes to golden files label Sep 21, 2022
@LongCatIsLooong LongCatIsLooong marked this pull request as draft September 21, 2022 06:20
@flutter-dashboard
Copy link

This pull request has been changed to a draft. The currently pending flutter-gold status will not be able to resolve until a new commit is pushed or the change is marked ready for review again.

For more guidance, visit Writing a golden file test for package:flutter.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@LongCatIsLooong LongCatIsLooong force-pushed the render-editable-maxLine-1 branch from e54fad9 to 0d15d46 Compare September 22, 2022 20:26
@LongCatIsLooong LongCatIsLooong marked this pull request as ready for review September 22, 2022 20:27
@flutter-dashboard
Copy link

Golden file changes are available for triage from new commit, Click here to view.

For more guidance, visit Writing a golden file test for package:flutter.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

Changes reported for pull request #112029 at sha 57292e0

@flutter-dashboard
Copy link

Golden file changes are available for triage from new commit, Click here to view.

For more guidance, visit Writing a golden file test for package:flutter.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

Changes reported for pull request #112029 at sha 395aab1

@LongCatIsLooong LongCatIsLooong force-pushed the render-editable-maxLine-1 branch from c33fd3b to a72723b Compare September 26, 2022 19:54
@flutter-dashboard
Copy link

Golden file changes are available for triage from new commit, Click here to view.

For more guidance, visit Writing a golden file test for package:flutter.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

Changes reported for pull request #112029 at sha a72723bfb607a2e9747327cf0a882515ce3a63d5

@LongCatIsLooong LongCatIsLooong force-pushed the render-editable-maxLine-1 branch from a72723b to 933b32c Compare September 26, 2022 20:40
@flutter-dashboard
Copy link

Golden file changes are available for triage from new commit, Click here to view.

For more guidance, visit Writing a golden file test for package:flutter.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

Changes reported for pull request #112029 at sha 933b32c

Copy link
Contributor

@justinmc justinmc left a comment

Choose a reason for hiding this comment

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

LGTM 👍 but take a look at your TODO below that you might want to still handle in this PR.

Thanks for fixing this and for splitting it out of your other PR.

List<ui.LineMetrics> computeLineMetrics() {
assert(_debugAssertTextLayoutIsValid);
return _lineMetricsCache ??= _paragraph!.computeLineMetrics();
return _lineMetricsCache ??= _paragraph!.computeLineMetrics();
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

int count = 0;
for (int index = 0; index < text.length; index += 1) {
// TODO(LongCatIsLooong): account for other line terminators, or get it
// from ui.Paragraph.
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you mean to handle this in this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added other line breakers in. But still it would be better to let skparagraph handle that.

for (int index = 0; index < text.length; index += 1) {
// TODO(LongCatIsLooong): account for other line terminators, or get it
// from ui.Paragraph.
count += text.codeUnitAt(index) == 0x0A ? 1 : 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Maybe make 0x0A a constant for clarity about what it is, depending on your TODO above.

return child!.getMaxIntrinsicHeight(width);
}
return 0.0;
return child?.getMaxIntrinsicHeight(width) ?? 0.0;
Copy link
Contributor

Choose a reason for hiding this comment

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

👏

@LongCatIsLooong LongCatIsLooong force-pushed the render-editable-maxLine-1 branch from 0c2fae6 to 8faf248 Compare September 28, 2022 20:36
@LongCatIsLooong LongCatIsLooong force-pushed the render-editable-maxLine-1 branch from 8faf248 to b07ef1e Compare September 28, 2022 20:43
@LongCatIsLooong LongCatIsLooong added the autosubmit Merge PR when tree becomes green via auto submit App label Sep 28, 2022
@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Sep 28, 2022
@auto-submit
Copy link
Contributor

auto-submit bot commented Sep 28, 2022

auto label is removed for flutter/flutter, pr: 112029, due to - The status or check suite ci.yaml validation has failed. Please fix the issues identified (or deflake) before re-applying this label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: text input Entering text in a text field or keyboard related problems autosubmit Merge PR when tree becomes green via auto submit App f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. will affect goldens Changes to golden files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SkParagraph doesn't account for applyHeightToFirstAscent applyHeightToLastDescent on empty paragraphs with strut enabled

2 participants