Skip to content
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

Styling fixes for ReportPreview/MoneyRequestPreview #36278

Merged
merged 25 commits into from
Mar 1, 2024

Conversation

grgia
Copy link
Contributor

@grgia grgia commented Feb 9, 2024

Details

ReportPreview
✅ Fixes Text line height
✅ Fixes Gaps
✅ Fixes Counter Highlight Color
imageimage

MoneyRequestPreview
✅ Fixes Text line height
✅ Fixes Gaps
image

ReportPreview Subtitle Copy Change
✅ Add support for displaying # of pending in the Report Preview
image

Fixed Issues

$ #33979
PROPOSAL:

Tests

  • Verify that no errors appear in the JS console

  • See QA steps
    Note for C+: to add a pending card transaction, simply set transaction.status to 'Pending' for a transaction on the report via onyx console

  • QA'd UI with design

Offline tests

QA Steps

  • Verify that no errors appear in the JS console

  • Create a report with 2 manual requests, go to the parent chat report and locate the report preview

  • Verify that copy reads "2 requests"

  • Add 1 Pending ECard transaction

  • Verify that copy reads "2 requests, 1 pending"

  • Add 1 Scanning transaction

  • Verify that copy reads "2 requests, 1 scanning, 1 pending"

  • Delete the ECard transaction

  • Verify that copy reads "2 requests, 1 scanning"

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
    • MacOS: Desktop
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that the left part of a conditional rendering a React component is a boolean and NOT a string, e.g. myBool && <MyComponent />.
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
      • If any non-english text was added/modified, I verified the translation was requested/reviewed in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is approved by marketing by adding the Waiting for Copy label for a copy review on the original GH to get the correct copy.
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label so the design team can review the changes.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop

@grgia grgia self-assigned this Feb 9, 2024
@grgia
Copy link
Contributor Author

grgia commented Feb 9, 2024

@shawnborton would you mind taking a look at the screenshots I added? Let me know if anything else needs changing!

@grgia grgia changed the title Fix text styling/gaps on ReportPreview/MoneyRequestPreview Styling fixes for ReportPreview/MoneyRequestPreview Feb 9, 2024
@shawnborton
Copy link
Contributor

Looking good! The only thing I see is that the green button feels just slightly far away from the text above it? How much space is there?

cc @Expensify/design for a quick review too!

@grgia
Copy link
Contributor Author

grgia commented Feb 9, 2024

@shawnborton there's a gap of 16 and it looks like the button has a margin-top of 12px

image

@shawnborton
Copy link
Contributor

Okay cool, I think we just want the 16px gap between text and button, so we can get rid of the extra 12px of padding above the button. This is what I'm seeing in Figma at least:
CleanShot 2024-02-12 at 08 42 40@2x

@dannymcclain
Copy link
Contributor

Agree with Shawn—but these are looking good!

@grgia
Copy link
Contributor Author

grgia commented Feb 12, 2024

@shawnborton @dannymcclain updated!

@grgia grgia marked this pull request as ready for review February 12, 2024 19:57
@grgia grgia requested a review from a team as a code owner February 12, 2024 19:57
@melvin-bot melvin-bot bot requested review from situchan and removed request for a team February 12, 2024 19:57
Copy link

melvin-bot bot commented Feb 12, 2024

@situchan @ One of you needs to copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@shawnborton
Copy link
Contributor

Feeling good to me! I just fired up a test build so we can test more easily as well.

@situchan
Copy link
Contributor

situchan commented Feb 13, 2024

@gedu please merge main

Build not posted 🤔 Please kick off adhoc build again Edit: there's bug below

Copy link
Contributor

@situchan situchan left a comment

Choose a reason for hiding this comment

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

There's no padding

Screen.Recording.2024-02-13.at.9.21.01.PM.mov

@grgia
Copy link
Contributor Author

grgia commented Feb 13, 2024

@situchan not sure what caused that bug- mine look alright

image

@grgia
Copy link
Contributor Author

grgia commented Feb 13, 2024

oof I pushed to my old branch, give me a sec!

@shawnborton
Copy link
Contributor

Cool cool, and before we merge, can we do a test build so we can take these for a spin with our account data first? Thanks!

@grgia
Copy link
Contributor Author

grgia commented Feb 14, 2024

Updated and triggered a test build

@grgia
Copy link
Contributor Author

grgia commented Feb 29, 2024

@shawnborton I actually was about to message you to double check on that lineheight, I'll push that now!

@grgia
Copy link
Contributor Author

grgia commented Feb 29, 2024

@shawnborton this is
styles.textHeadline


        textHeadline: {
            ...headlineFont,
            ...whiteSpace.preWrap,
            color: theme.heading,
            fontSize: variables.fontSizeXLarge,
            lineHeight: variables.lineHeightXXXLarge,
        },

image

I can switch to
textHeadlineH1

        textHeadlineH1: {
            ...headlineFont,
            ...whiteSpace.preWrap,
            color: theme.heading,
            fontSize: variables.fontSizeh1,
            lineHeight: variables.lineHeightSizeh1,
        },
image

@shawnborton
Copy link
Contributor

H1 sounds good, but I think the font size should be 22px based on our Figma designs. So we might need to update that globally too.

@dannymcclain
Copy link
Contributor

I'm good with those updates to the H1 even if they need to be made globally. @Expensify/design We should make sure our type styles in Figma have explicit line heights set so we all know what they should be (H1 & H2 styles currently have their line-heights set to Auto)

@shawnborton
Copy link
Contributor

Agree! I think we should do 28px line height for h1, and 24px line height for h2. I can push those changes to Figma quickly!

@Expensify Expensify deleted a comment from github-actions bot Feb 29, 2024
@Expensify Expensify deleted a comment from github-actions bot Feb 29, 2024

This comment was marked as outdated.

Copy link
Contributor

@hayata-suenaga hayata-suenaga left a comment

Choose a reason for hiding this comment

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

🟢 code looks okay
I'll wait for design team's final review of the latest build

@situchan
Copy link
Contributor

Here's video of visual difference (main vs this branch)

Screen.Recording.2024-03-01.at.12.14.21.AM.mov

@grgia
Copy link
Contributor Author

grgia commented Mar 1, 2024

Thank you everyone, going to merge this one!

@grgia grgia merged commit 39a257d into main Mar 1, 2024
16 checks passed
@grgia grgia deleted the georgia-reportPreviewStyling2 branch March 1, 2024 10:07
@OSBotify
Copy link
Contributor

OSBotify commented Mar 1, 2024

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@OSBotify
Copy link
Contributor

OSBotify commented Mar 4, 2024

🚀 Deployed to staging by https://github.com/grgia in version: 1.4.47-0 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 failure ❌
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@kavimuru
Copy link

kavimuru commented Mar 4, 2024

@grgia could you help with pending expensify card transaction?

@kavimuru
Copy link

kavimuru commented Mar 5, 2024

@roryabraham @situchan We are not sure how to have "pending expensify card transactions", It would be great if you could validate internally. Thanks!

@grgia
Copy link
Contributor Author

grgia commented Mar 6, 2024

QA
image
image
image

@OSBotify
Copy link
Contributor

OSBotify commented Mar 6, 2024

🚀 Deployed to production by https://github.com/roryabraham in version: 1.4.47-10 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

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

Successfully merging this pull request may close these issues.

8 participants