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

[InternalQA] Bring in Settle Up feature for workspace feeds on monthly settlement frequency #55607

Merged

Conversation

koko57
Copy link
Contributor

@koko57 koko57 commented Jan 22, 2025

Explanation of Change

Fixed Issues

$ #55158
PROPOSAL: -

Tests

  1. Go to a Workspace that has Expensify Card with Monthly settlement setting
  2. You should see a "Settle balance" button next to the current balance
  3. Clicking it should call Domain_QueueExpensifyCardForBilling request
  4. After the request is sent we should display an informational text that the balance will be cleared the next day. Verify that the text is below the Current Balance
  • Verify that no errors appear in the JS console

Offline tests

QA Steps

// TODO: These must be filled out, or the issue title must include "[No QA]."

same as above

  • Verify that no errors appear in the JS console

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 / Chrome
    • iOS / native
    • iOS / 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 a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • If we are not using the full Onyx data that we loaded, I've added the proper selector in order to ensure the component only re-renders when the data it is using changes
      • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • 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(themeColors.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.
  • I have checked off every checkbox in the PR author checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: Native
Android: mWeb Chrome

Screenshot_1737623995
Screenshot_1737623948

iOS: Native

Simulator Screenshot - iPhone 15 Pro - 2025-01-22 at 19 21 59
Simulator Screenshot - iPhone 15 Pro - 2025-01-22 at 19 21 40

iOS: mWeb Safari

Simulator Screenshot - iPhone 15 Pro - 2025-01-22 at 19 23 43
Simulator Screenshot - iPhone 15 Pro - 2025-01-22 at 19 23 17

MacOS: Chrome / Safari Screenshot 2025-01-22 at 18 37 06 Screenshot 2025-01-22 at 18 36 53 Screenshot 2025-01-22 at 18 35 56 Screenshot 2025-01-22 at 18 35 47
MacOS: Desktop Screenshot 2025-01-22 at 18 41 51 Screenshot 2025-01-22 at 18 41 06 Screenshot 2025-01-22 at 18 40 32 Screenshot 2025-01-22 at 18 40 22

@koko57 koko57 marked this pull request as ready for review January 23, 2025 16:09
@koko57 koko57 requested a review from a team as a code owner January 23, 2025 16:09
@melvin-bot melvin-bot bot requested review from dubielzyk-expensify and Ollyws and removed request for a team January 23, 2025 16:09
Copy link

melvin-bot bot commented Jan 23, 2025

@dubielzyk-expensify @Ollyws 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]

@koko57 koko57 marked this pull request as draft January 23, 2025 16:09
@koko57
Copy link
Contributor Author

koko57 commented Jan 23, 2025

@mountiny I wasn't able to test this flow - I have no Workspace with monthly settlement settings and I couldn't change this setting to monthly for any of my workspaces. The screenshots were made using mocks

@koko57 koko57 marked this pull request as ready for review January 23, 2025 16:18
@mountiny
Copy link
Contributor

@koko57 Thanks, I think we might have to do internalQA

@mountiny mountiny added InternalQA This pull request required internal QA Ready To Build labels Jan 23, 2025
Copy link
Contributor

🚧 @mountiny has triggered a test build. You can view the workflow run here.

Copy link
Contributor

🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪

Android 🤖 iOS 🍎
https://ad-hoc-expensify-cash.s3.amazonaws.com/android/55607/index.html ❌ FAILED ❌
Android The QR code can't be generated, because the iOS build failed
Desktop 💻 Web 🕸️
https://ad-hoc-expensify-cash.s3.amazonaws.com/desktop/55607/NewExpensify.dmg https://55607.pr-testing.expensify.com
Desktop Web

👀 View the workflow run that generated this build 👀

@koko57
Copy link
Contributor Author

koko57 commented Jan 30, 2025

@shawnborton does it mean to change the whole design for this case? So when the button is not displayed should the columns be also the same width and take 1/3 of the screen?

These are the breakpoints that we currently support.
Screenshot 2025-01-30 at 09 11 33

The button goes down at 1317px width, if the value has more or less digits it'll be different.

I can try once again to achieve the results you expect, but if this particular case means introducing some breaking changes to the code, tbh I'm not sure it's worth it.

@shawnborton
Copy link
Contributor

Hmm I'm not really suggesting to change much. Can you show me what the columns currently look like before all of these changes? I have a feeling they currently take 1/3 width each.

Again, if we go back to the Figma mocks, we are still trying to make the columns use 1/3 width:
image

Maybe this helps illustrate what I would like to accomplish:

CleanShot.2025-01-30.at.09.31.43.mp4

@koko57
Copy link
Contributor Author

koko57 commented Jan 30, 2025

staging
Screenshot 2025-01-30 at 09 38 24

vs current changes
Screenshot 2025-01-30 at 09 40 52

for 1920 px width

if you need some more screenshots I can make some with other values/different resolutions so you can decide on the best outcome

@shawnborton
Copy link
Contributor

Okay, why is there all of that negative space on the right? Does something eventually show up there? I haven't seen a 4th column in any of our Figma mocks so I feel like this was an implementation error. Either way, are you able to make this look like the video I just shared?

@koko57
Copy link
Contributor Author

koko57 commented Jan 30, 2025

@shawnborton yeah of course! I can implement it this way.

The space on the right was from the beginning (it was implemented that way back then when the feature was introduced), so yeah it must be an implementation error.

@shawnborton
Copy link
Contributor

Okay great! Thanks for hearing me out and for helping me out with the screenshots.

@koko57
Copy link
Contributor Author

koko57 commented Jan 30, 2025

I'm not calling it quits yet, but I'm afraid that we would need to agree on some trade-offs:

Here is how it looks like the columns are even (1/3) width:

Screen.Recording.2025-01-30.at.11.01.36.mp4

the button moves down at ~1107px. The next breakpoint is 1024

I could possibly apply min-width for the first column when the button is present, but as it doesn't have a fixed position the ideal min-width may vary.

@koko57
Copy link
Contributor Author

koko57 commented Jan 30, 2025

here's how it would look when we have min-width on the first column

Screen.Recording.2025-01-30.at.11.07.49.mp4

@dannymcclain
Copy link
Contributor

I'm not calling it quits yet, but I'm afraid that we would need to agree on some trade-offs:
Here is how it looks like the columns are even (1/3) width:

I actually think this looks pretty good—curious what Shawn has to say! I know at that one specific size we run into the button being pretty close to the column next to it, but I think it generally feels better than the previous implementation.

@koko57
Copy link
Contributor Author

koko57 commented Jan 30, 2025

I also think that it won't be occurring many times, only when resizing the web, as the range were the button will move under the value will be 1024 to around 1107px (depending on the value's length)

@shawnborton
Copy link
Contributor

Yeah, I think having the button wrap below the amount when the screen gets smaller is totally expected. I think the first video looks great personally!

@koko57
Copy link
Contributor Author

koko57 commented Jan 30, 2025

Nice! Thanks @shawnborton and @dannymcclain! I will make these changes shortly

@koko57 koko57 requested a review from mountiny January 30, 2025 15:51
@koko57
Copy link
Contributor Author

koko57 commented Jan 30, 2025

changes added

@shawnborton
Copy link
Contributor

Woo thanks!

Copy link
Contributor

@mountiny mountiny left a comment

Choose a reason for hiding this comment

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

It was tested and works well, just gotta sync with main now to fix the flaky test

@koko57
Copy link
Contributor Author

koko57 commented Jan 31, 2025

@mountiny merged with main

@koko57 koko57 requested a review from mountiny January 31, 2025 10:29
@mountiny mountiny changed the title Feat/55158 settle up feature Bring in Settle Up feature for workspace feeds on monthly settlement frequency Jan 31, 2025
@mountiny mountiny changed the title Bring in Settle Up feature for workspace feeds on monthly settlement frequency [InternalQA] Bring in Settle Up feature for workspace feeds on monthly settlement frequency Jan 31, 2025
@mountiny mountiny merged commit 12254ea into Expensify:main Jan 31, 2025
18 checks passed
@OSBotify
Copy link
Contributor

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

Copy link
Contributor

github-actions bot commented Feb 3, 2025

🚀 Deployed to staging by https://github.com/mountiny in version: 9.0.94-0 🚀

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

@joekaufmanexpensify
Copy link
Contributor

@koko57 I just tested this on staging and it largely worked. Only issue was it took a few minutes for the Settle now button to update to Balance will be settled on 2025-02-05 (even after refreshing the page).

@mountiny mentioned we queue it was a pusher update. Is it possible to immediately update the UI to reflect the balances as queued? Otherwise, it's a bit confusing.

@mountiny
Copy link
Contributor

mountiny commented Feb 4, 2025

Will follow up on this one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
InternalQA This pull request required internal QA Ready To Build
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants