Closed Bug 1908003 Opened 7 months ago Closed 2 months ago

[Menu Redesign] Fix the line height of the text on the menu item and header.

Categories

(Fenix :: Toolbar, defect, P3)

All
Android
defect

Tracking

(firefox135 fixed)

RESOLVED FIXED
135 Branch
Tracking Status
firefox135 --- fixed

People

(Reporter: aarjav, Assigned: petru)

References

(Blocks 1 open bug)

Details

(Whiteboard: [fxdroid][group3][menu-redesign-release-blocker])

Attachments

(7 files)

Steps to reproduce

  1. Open the menu

Expected behavior

Actual behavior

  • The line height looks short in height compared to the designs.

Device information

  • Firefox version:
  • Android device model:
  • Android OS version:

Any additional information?

Bug shown in figma - https://www.figma.com/design/RFz9fYtotQCQuinwcZujZt/Menu-Redesign?node-id=16634-319553&t=AkMU1d3vNoAMLjzX-4.

Severity: -- → S4
Priority: -- → P2

Aarjav says fixing this line height bug doesn't need to block our Nightly milestone.

gl says our code uses sp sizing, but design system uses dp sizing. This is a code bug related to Compose text styling and not something the design system team can fix.

Whiteboard: [fxdroid][group3]

Does the line height use sp or dp sizing?

Flags: needinfo?(giorga)
Priority: P2 → P3

Line Height is in sp.:
subtitle1 = TextStyle(
fontSize = 16.sp,
fontWeight = FontWeight.W400,
letterSpacing = 0.15.sp,
lineHeight = 24.sp,
),
body2 = TextStyle(
fontSize = 14.sp,
fontWeight = FontWeight.W400,
letterSpacing = 0.25.sp,
lineHeight = 20.sp,
),

Flags: needinfo?(giorga)

It depends on font size from phone settings. If the font size bar is in the middle, like in the first print screen, 24.sp will be 26.285715.dp. If the font size bar is like in the second photo, 24.sp will be 24.dp.

Attached image first.png
Attached image second.png
Whiteboard: [fxdroid][group3] → [fxdroid][group3][menu-redesign-release-blocker]
Assignee: nobody → petru
Status: NEW → ASSIGNED

(from to Aarjav [:aarjav] from comment #0)

Expected behavior

The Figma specs for body_2 are:

  • font size: 14
  • line height: 20
  • font weight: 400

which are mapped exactly as such in the app as body2 and then used for the menu item description


The Figma specs for subtitle_1 are:

  • font size: 18
  • line height: 24
  • font weight: 500

which are mapped differently in our app as subtitle1 with the following properties:

  • font size: 16
  • line height: 24
  • font weight: 400

and then used for the menu item label here.

@Aarjav I see though a comment in Figma saying

These are Figma only tokens and are not reflective of the current codebase

so maybe that's okay?
Note also that these same styles are used for the new compose based bookmarks (can be enabled in Secret Settings) - if we change the subtitle1 token inside the app more scenarios would be impacted, not just the menu.

There is a separate issue in that tokens from the app are not applied perfectly (we set the right value (for example for lineHeight in code but it is not respected), I need to investigate that more but in the meantime wanted to double check if we can have slightly different values for the font size and weight for the subtitle1 token.

Flags: needinfo?(apandya)

Hey Petru, I am not sure where I have mentioned that last comment, but the intention is to say that it hasn't been correctly reflected in the implemented feature. But eventually, the implementation needs to match the designs.

And regarding bookmarks, it would be okay if they were also implemented there as it would be correct. It just needs to follow the details mentioned in the design system file.

Bookmarks and Menu uses the same design tokens.

Flags: needinfo?(apandya)

Seems like there is an issue in the Compose framework where TextStyles are not applied correctly - this would affect the entire application (and of others also) where we make heavy use of TextStyles and the fonts may be smaller than expected.
Opened an issue @Compose https://issuetracker.google.com/issues/382453600 .

In the meantime I'll look into slight updates for our usecase here.

Added here a comparison of possible outcomes.
Using the Figma specs for the subtitle_1 token results in quite a big UI difference so I recommend just increasing the line height for now.

@Aarjav any recommendations for what should the result be in this conditions?

Flags: needinfo?(apandya)

The second image seems fine, but I can see that the text + icon is losing horizontal alignment. Would you mind sharing an apk and I can share the exact comparison of that implementation and designs? This will help us get an understanding of how this new slightly better implementation differs from the designs.

Flags: needinfo?(apandya)
Attached image Updated Menu Fonts.jpg

Adjusted the implementation for the second approach to avoid the issue Aarjav pointed.
Here is an apk to testdrive the result.

Attachment #9442400 - Attachment description: Bug 1908003 - Force a bigger line height for list items r=#android-reviewers → Bug 1908003 - includeFontPadding for list items r=#android-reviewers
See Also: → 1936346
Attachment #9442400 - Attachment description: Bug 1908003 - includeFontPadding for list items r=#android-reviewers → Bug 1908003 - part 1 - includeFontPadding for list items r=#android-reviewers

This change helps complete having the needed line height for everything
in the new menu.

XML uses font padding by default.
Compose not.
See https://medium.com/androiddevelopers/fixing-font-padding-in-compose-text-768cd232425b
for more details.

Pushed by plingurar@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a1f35d6f71f0 part 1 - includeFontPadding for list items r=android-reviewers,007,tchoh,sfamisa,harrisono
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 135 Branch
Pushed by plingurar@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/4205e9fbce67 part 2 - includeFontPadding for the menu header r=android-reviewers,sfamisa
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: