Skip to content

Nav bar back label is not clipped mid-transition - #168194

Merged
auto-submit[bot] merged 6 commits into
flutter:masterfrom
victorsanni:back-label-flicker
May 12, 2025
Merged

auto-submit[bot] merged 6 commits into
flutter:masterfrom
victorsanni:back-label-flicker

Conversation

@victorsanni

@victorsanni victorsanni commented May 2, 2025 •

Copy link
Copy Markdown
Contributor

Before

before.back.label.clip.mov

After

nav.bar.back.label.spacing.mov

Fixes CupertinoNavigationBar flickers when previousPageTitle more than 4 characters

@github-actions github-actions Bot added framework flutter/packages/flutter repository. See also f: labels. p: cupertino_ui cupertino_ui package in flutter/packages labels May 2, 2025
@victorsanni
victorsanni requested review from LongCatIsLooong, MitchellGoodwin and dkwingsmt and removed request for LongCatIsLooong May 2, 2025 02:19
@dkwingsmt

dkwingsmt commented May 6, 2025 •

Copy link
Copy Markdown
Contributor

Looking closely at the after video, I think the label is still shortened?
image

It seems that the label is freed from the constraint, or starts to have a larger constraint midway, since the back label changes from "Back..." to "BackB..." to "BackBack".

I doubt if this is the correct behavior. Have you checked the native behavior?

@victorsanni

victorsanni commented May 6, 2025 •

Copy link
Copy Markdown
Contributor Author

It seems that the label is freed from the constraint, or starts to have a larger constraint midway, since the back label changes from "Back..." to "BackB..." to "BackBack".

Native behavior: #40583
With native it should never get clipped. It either is always fully extended or it gets replaced with 'Back'.
I agree, the label should always have enough space or get replaced.

@dkwingsmt

Copy link
Copy Markdown
Contributor

Yeah, that's what I typically observe as well. Do you think something like this is achievable?

@victorsanni

Copy link
Copy Markdown
Contributor Author

Yeah, that's what I typically observe as well. Do you think something like this is achievable?

Yes, this is fixed now.

.drive(CurveTween(curve: curve))
.drive(anchorMovementInTransitionBox),
size: fromBox.size,
width: fromNavBarBox.size.width,

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.

Does it mean that the width is allowed to as wide as the entire screen? What happens natively if the title will be clipped after the transition?

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.

Does it mean that the width is allowed to as wide as the entire screen?

Yes, but elsewhere the back label is replaced with 'Back' if it is more than a certain number of characters. So it never actually takes up that whole space. Natively, the back label gets replaced if the title/middle doesn't have enough space.

The title/middle starts where the back label ends, and wraps if its too long. So when the back label is also very long, there isn't an overlap:

long back label and middle

@victorsanni
victorsanni requested a review from dkwingsmt May 9, 2025 21:43
Comment thread packages/flutter/test/cupertino/nav_bar_transition_test.dart Outdated

@dkwingsmt dkwingsmt 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

@MitchellGoodwin MitchellGoodwin 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 as well

@victorsanni victorsanni added the autosubmit Merge PR when tree becomes green via auto submit App label May 12, 2025
@auto-submit
auto-submit Bot added this pull request to the merge queue May 12, 2025
Merged via the queue into flutter:master with commit b772c17 May 12, 2025
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label May 12, 2025
@victorsanni
victorsanni deleted the back-label-flicker branch May 12, 2025 20:36
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 13, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 13, 2025
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request May 13, 2025
flutter/flutter@54de32d...336a7ec

2025-05-13 [email protected] Add assert for index parameter in IndexedStack. (flutter/flutter#167757)
2025-05-13 [email protected] Fixed Android Lint Errors (flutter/flutter#168613)
2025-05-13 [email protected] Tab bar theme and dialog theme documentation cleanup (flutter/flutter#168724)
2025-05-13 [email protected] Roll Fuchsia Linux SDK from 6vjKe0bfYDVaECqBL... to 6J81agNhuK4q255Jj... (flutter/flutter#168712)
2025-05-12 [email protected] Make the barrier panel on the Material Drawer non-dismissible (flutter/flutter#164810)
2025-05-12 [email protected] Roll ICU from c9fb4b3a6fb5 to b929596baebf (5 revisions) (flutter/flutter#168691)
2025-05-12 [email protected] Fix DropdownButtonFormField icon not vertically centered (flutter/flutter#163205)
2025-05-12 [email protected] Android home/end keyboard shortcut support (flutter/flutter#168184)
2025-05-12 [email protected] Update `TESTOWNERS` for Android PV tests (flutter/flutter#168694)
2025-05-12 [email protected] Roll Dart SDK from 0bea6379f654 to 645d04a7a964 (14 revisions) (flutter/flutter#168679)
2025-05-12 [email protected] [Impeller] libImpeller: Allow setting text decorations. (flutter/flutter#168408)
2025-05-12 [email protected] Error when trying to use old HC mode when HCPP is enabled (flutter/flutter#168027)
2025-05-12 [email protected] Nav bar back label is not clipped mid-transition (flutter/flutter#168194)
2025-05-12 [email protected] Add test for stack trace mapping and test expression eval tests using DDC library bundle format (flutter/flutter#168017)
2025-05-12 [email protected] Remove CupertinoSliverNavigationBar background box when large title is extended (flutter/flutter#168407)
2025-05-12 [email protected] Label platform view modes using the unified naming scheme (flutter/flutter#168670)
2025-05-12 [email protected] Roll Packages from 7814fab to 6a28ad9 (2 revisions) (flutter/flutter#168669)
2025-05-12 [email protected] Update `Engine-artifacts.md` to reflect the new `engine.version` verifier (flutter/flutter#168413)
2025-05-12 [email protected] Roll Skia from 9f9e1f37917e to c97451da059f (1 revision) (flutter/flutter#168671)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
FMorschel pushed a commit to FMorschel/packages that referenced this pull request Jun 9, 2025
flutter/flutter@54de32d...336a7ec

2025-05-13 [email protected] Add assert for index parameter in IndexedStack. (flutter/flutter#167757)
2025-05-13 [email protected] Fixed Android Lint Errors (flutter/flutter#168613)
2025-05-13 [email protected] Tab bar theme and dialog theme documentation cleanup (flutter/flutter#168724)
2025-05-13 [email protected] Roll Fuchsia Linux SDK from 6vjKe0bfYDVaECqBL... to 6J81agNhuK4q255Jj... (flutter/flutter#168712)
2025-05-12 [email protected] Make the barrier panel on the Material Drawer non-dismissible (flutter/flutter#164810)
2025-05-12 [email protected] Roll ICU from c9fb4b3a6fb5 to b929596baebf (5 revisions) (flutter/flutter#168691)
2025-05-12 [email protected] Fix DropdownButtonFormField icon not vertically centered (flutter/flutter#163205)
2025-05-12 [email protected] Android home/end keyboard shortcut support (flutter/flutter#168184)
2025-05-12 [email protected] Update `TESTOWNERS` for Android PV tests (flutter/flutter#168694)
2025-05-12 [email protected] Roll Dart SDK from 0bea6379f654 to 645d04a7a964 (14 revisions) (flutter/flutter#168679)
2025-05-12 [email protected] [Impeller] libImpeller: Allow setting text decorations. (flutter/flutter#168408)
2025-05-12 [email protected] Error when trying to use old HC mode when HCPP is enabled (flutter/flutter#168027)
2025-05-12 [email protected] Nav bar back label is not clipped mid-transition (flutter/flutter#168194)
2025-05-12 [email protected] Add test for stack trace mapping and test expression eval tests using DDC library bundle format (flutter/flutter#168017)
2025-05-12 [email protected] Remove CupertinoSliverNavigationBar background box when large title is extended (flutter/flutter#168407)
2025-05-12 [email protected] Label platform view modes using the unified naming scheme (flutter/flutter#168670)
2025-05-12 [email protected] Roll Packages from 7814fab to 6a28ad9 (2 revisions) (flutter/flutter#168669)
2025-05-12 [email protected] Update `Engine-artifacts.md` to reflect the new `engine.version` verifier (flutter/flutter#168413)
2025-05-12 [email protected] Roll Skia from 9f9e1f37917e to c97451da059f (1 revision) (flutter/flutter#168671)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Ortes pushed a commit to Ortes/packages that referenced this pull request Jun 25, 2025
flutter/flutter@54de32d...336a7ec

2025-05-13 [email protected] Add assert for index parameter in IndexedStack. (flutter/flutter#167757)
2025-05-13 [email protected] Fixed Android Lint Errors (flutter/flutter#168613)
2025-05-13 [email protected] Tab bar theme and dialog theme documentation cleanup (flutter/flutter#168724)
2025-05-13 [email protected] Roll Fuchsia Linux SDK from 6vjKe0bfYDVaECqBL... to 6J81agNhuK4q255Jj... (flutter/flutter#168712)
2025-05-12 [email protected] Make the barrier panel on the Material Drawer non-dismissible (flutter/flutter#164810)
2025-05-12 [email protected] Roll ICU from c9fb4b3a6fb5 to b929596baebf (5 revisions) (flutter/flutter#168691)
2025-05-12 [email protected] Fix DropdownButtonFormField icon not vertically centered (flutter/flutter#163205)
2025-05-12 [email protected] Android home/end keyboard shortcut support (flutter/flutter#168184)
2025-05-12 [email protected] Update `TESTOWNERS` for Android PV tests (flutter/flutter#168694)
2025-05-12 [email protected] Roll Dart SDK from 0bea6379f654 to 645d04a7a964 (14 revisions) (flutter/flutter#168679)
2025-05-12 [email protected] [Impeller] libImpeller: Allow setting text decorations. (flutter/flutter#168408)
2025-05-12 [email protected] Error when trying to use old HC mode when HCPP is enabled (flutter/flutter#168027)
2025-05-12 [email protected] Nav bar back label is not clipped mid-transition (flutter/flutter#168194)
2025-05-12 [email protected] Add test for stack trace mapping and test expression eval tests using DDC library bundle format (flutter/flutter#168017)
2025-05-12 [email protected] Remove CupertinoSliverNavigationBar background box when large title is extended (flutter/flutter#168407)
2025-05-12 [email protected] Label platform view modes using the unified naming scheme (flutter/flutter#168670)
2025-05-12 [email protected] Roll Packages from 7814fab to 6a28ad9 (2 revisions) (flutter/flutter#168669)
2025-05-12 [email protected] Update `Engine-artifacts.md` to reflect the new `engine.version` verifier (flutter/flutter#168413)
2025-05-12 [email protected] Roll Skia from 9f9e1f37917e to c97451da059f (1 revision) (flutter/flutter#168671)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 14, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 14, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 15, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 15, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 16, 2025
creatorpiyush pushed a commit to creatorpiyush/packages that referenced this pull request Jun 10, 2026
flutter/flutter@54de32d...336a7ec

2025-05-13 [email protected] Add assert for index parameter in IndexedStack. (flutter/flutter#167757)
2025-05-13 [email protected] Fixed Android Lint Errors (flutter/flutter#168613)
2025-05-13 [email protected] Tab bar theme and dialog theme documentation cleanup (flutter/flutter#168724)
2025-05-13 [email protected] Roll Fuchsia Linux SDK from 6vjKe0bfYDVaECqBL... to 6J81agNhuK4q255Jj... (flutter/flutter#168712)
2025-05-12 [email protected] Make the barrier panel on the Material Drawer non-dismissible (flutter/flutter#164810)
2025-05-12 [email protected] Roll ICU from c9fb4b3a6fb5 to b929596baebf (5 revisions) (flutter/flutter#168691)
2025-05-12 [email protected] Fix DropdownButtonFormField icon not vertically centered (flutter/flutter#163205)
2025-05-12 [email protected] Android home/end keyboard shortcut support (flutter/flutter#168184)
2025-05-12 [email protected] Update `TESTOWNERS` for Android PV tests (flutter/flutter#168694)
2025-05-12 [email protected] Roll Dart SDK from 0bea6379f654 to 645d04a7a964 (14 revisions) (flutter/flutter#168679)
2025-05-12 [email protected] [Impeller] libImpeller: Allow setting text decorations. (flutter/flutter#168408)
2025-05-12 [email protected] Error when trying to use old HC mode when HCPP is enabled (flutter/flutter#168027)
2025-05-12 [email protected] Nav bar back label is not clipped mid-transition (flutter/flutter#168194)
2025-05-12 [email protected] Add test for stack trace mapping and test expression eval tests using DDC library bundle format (flutter/flutter#168017)
2025-05-12 [email protected] Remove CupertinoSliverNavigationBar background box when large title is extended (flutter/flutter#168407)
2025-05-12 [email protected] Label platform view modes using the unified naming scheme (flutter/flutter#168670)
2025-05-12 [email protected] Roll Packages from 7814fab to 6a28ad9 (2 revisions) (flutter/flutter#168669)
2025-05-12 [email protected] Update `Engine-artifacts.md` to reflect the new `engine.version` verifier (flutter/flutter#168413)
2025-05-12 [email protected] Roll Skia from 9f9e1f37917e to c97451da059f (1 revision) (flutter/flutter#168671)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
bisor0627 pushed a commit to bisor0627/packages that referenced this pull request Jun 19, 2026
flutter/flutter@54de32d...336a7ec

2025-05-13 [email protected] Add assert for index parameter in IndexedStack. (flutter/flutter#167757)
2025-05-13 [email protected] Fixed Android Lint Errors (flutter/flutter#168613)
2025-05-13 [email protected] Tab bar theme and dialog theme documentation cleanup (flutter/flutter#168724)
2025-05-13 [email protected] Roll Fuchsia Linux SDK from 6vjKe0bfYDVaECqBL... to 6J81agNhuK4q255Jj... (flutter/flutter#168712)
2025-05-12 [email protected] Make the barrier panel on the Material Drawer non-dismissible (flutter/flutter#164810)
2025-05-12 [email protected] Roll ICU from c9fb4b3a6fb5 to b929596baebf (5 revisions) (flutter/flutter#168691)
2025-05-12 [email protected] Fix DropdownButtonFormField icon not vertically centered (flutter/flutter#163205)
2025-05-12 [email protected] Android home/end keyboard shortcut support (flutter/flutter#168184)
2025-05-12 [email protected] Update `TESTOWNERS` for Android PV tests (flutter/flutter#168694)
2025-05-12 [email protected] Roll Dart SDK from 0bea6379f654 to 645d04a7a964 (14 revisions) (flutter/flutter#168679)
2025-05-12 [email protected] [Impeller] libImpeller: Allow setting text decorations. (flutter/flutter#168408)
2025-05-12 [email protected] Error when trying to use old HC mode when HCPP is enabled (flutter/flutter#168027)
2025-05-12 [email protected] Nav bar back label is not clipped mid-transition (flutter/flutter#168194)
2025-05-12 [email protected] Add test for stack trace mapping and test expression eval tests using DDC library bundle format (flutter/flutter#168017)
2025-05-12 [email protected] Remove CupertinoSliverNavigationBar background box when large title is extended (flutter/flutter#168407)
2025-05-12 [email protected] Label platform view modes using the unified naming scheme (flutter/flutter#168670)
2025-05-12 [email protected] Roll Packages from 00e9cb9 to b71a018 (2 revisions) (flutter/flutter#168669)
2025-05-12 [email protected] Update `Engine-artifacts.md` to reflect the new `engine.version` verifier (flutter/flutter#168413)
2025-05-12 [email protected] Roll Skia from 9f9e1f37917e to c97451da059f (1 revision) (flutter/flutter#168671)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

framework flutter/packages/flutter repository. See also f: labels. p: cupertino_ui cupertino_ui package in flutter/packages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CupertinoNavigationBar flickers when previousPageTitle more than 4 characters

3 participants