Skip to content

Conversation

@MacroLens
Copy link
Contributor

@MacroLens MacroLens commented May 12, 2025

Explanation of Change

Add an optional default property enableMultiGestureCanvas to allow for swipe down gestures on icons in the workspace user avatar and the custom workspace avatar. This only affects devices that have a touchscreen or when the touchscreen is enabled.

Fixed Issues

$ #61313
PROPOSAL: #61313 (comment)

Tests

Preconditions:

  • must be on a device with touch support (mWeb / Native / HybridApp)
  • must have a workspace with custom avatar (any picture) and user must have the default generated avatar
  1. Open workspace chat and tap on the header to open report details page.
  2. On the details page, tap the 2 profile avatars of workspace and user.
  3. Verify that both custom avatar and default generated avatar modal will be closed when swiping down on the avatar.
  • Verify that no errors appear in the JS console

Offline tests

After logging on repeat all tests in Tests.

QA Steps

Same as tests.

  • 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: 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 verified there are no new alerts related to the canBeMissing param for useOnyx
  • 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 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 used JaimeGPT to get English > Spanish translation. I then posted it 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 either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
    • 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.ts 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 UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design 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.
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • 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_native_61313.mp4
Android: mWeb Chrome
android_mobile_web_61313.mp4
iOS: Native
ios_native.mov
iOS: mWeb Safari
ios_mweb.mov
MacOS: Chrome / Safari
macos_chrome_safari-1.mov
MacOS: Desktop
macos_desktop-1.mov

@MacroLens MacroLens requested a review from a team as a code owner May 12, 2025 21:30
@melvin-bot melvin-bot bot requested a review from ikevin127 May 12, 2025 21:30
@melvin-bot
Copy link

melvin-bot bot commented May 12, 2025

@ikevin127 Please 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]

@melvin-bot melvin-bot bot removed the request for review from a team May 12, 2025 21:30
@github-actions
Copy link
Contributor

github-actions bot commented May 12, 2025

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@MacroLens
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

CLABotify added a commit to Expensify/CLA that referenced this pull request May 12, 2025
@ikevin127
Copy link
Contributor

@MacroLens Thanks for opening the PR, please apply the following changes in order for me to be able to start reviewing:

  1. For the Tests section, please simplify the steps since this will make things easier for QA as well:

Tip

You can copy & paste the markdown directly in the PRs description.

**Preconditions**:
- must be on a device with touch support (mWeb / Native / HybridApp)
- must have a workspace with custom avatar (any picture) and user must have the default generated avatar

1. Open workspace chat and tap on the header to open report details page.
3. On the details page, tap the 2 profile avatars of workspace and user.
4. Verify that both custom avatar and default generated avatar modal will be closed when swiping down on the avatar.
  1. Please complete the [x] I ran the tests on all platforms & verified they passed on: tests on all platforms, making sure to attach the video proof in the Screenshots/Videos section as this is crucial for ensuring the fix behaves as expected on all platforms where it's supported 👍

@MacroLens
Copy link
Contributor Author

@ikevin127 I fixed the test section. Thanks for the feedback. I'll finish testing on MacOS, IOS today.

@MacroLens
Copy link
Contributor Author

@ikevin127 I've added the other screen recordings. All set for review.

Copy link
Contributor

@ikevin127 ikevin127 left a comment

Choose a reason for hiding this comment

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

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible 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 checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified tests pass on all platforms & I tested again on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
    • MacOS: Desktop
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (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
    • 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 either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
    • 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 verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • 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
  • 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
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • 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(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 UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design 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 reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: HybridApp
android-hybrid.mp4
Android: mWeb Chrome
android-mweb.mp4
iOS: HybridApp
ios-hybrid.MP4
iOS: mWeb Safari
ios-mweb.MP4
MacOS: Chrome / Safari
web.mov
MacOS: Desktop
desktop.mov

@melvin-bot melvin-bot bot requested a review from Gonals May 14, 2025 01:24
@ikevin127
Copy link
Contributor

Note

Note for QA

You've probably noticed that the issue mentions Offline message missing, which was decided upon by design team that we shouldn't add.

@Gonals
Copy link
Contributor

Gonals commented May 14, 2025

@MacroLens, we have some lint errors

@MacroLens
Copy link
Contributor Author

@ikevin127 @Gonals
I've added the canBeMissing param to the only useOnyx code in our changed files. I should note I am putting canBeMissing: true based on my best understanding of the component. This lint issue existed before I made changes so I was unsure if we wanted this to be addressed in the PR.

@ikevin127
Copy link
Contributor

@Gonals All good with the checks now ?

@Gonals
Copy link
Contributor

Gonals commented May 16, 2025

Still some lint errors!

@ikevin127
Copy link
Contributor

🤔 This is weird, all lint errors originate from files that this PR doesn't even touch.

And reassure also doesn't seem related (some conflicts in the reassure flow).

@Gonals Do you think we can merge given that the failing checks are not related to this PRs changes ?

@Gonals
Copy link
Contributor

Gonals commented May 16, 2025

🤔 This is weird, all lint errors originate from files that this PR doesn't even touch.

And reassure also doesn't seem related (some conflicts in the reassure flow).

@Gonals Do you think we can merge given that the failing checks are not related to this PRs changes ?

We shouldn't really merge with failing tests. The better question is why they are failing for unrelated files. Can you pull and merge main and see wht happens, @MacroLens?

@MacroLens
Copy link
Contributor Author

Sure let me pull and merge.

@MacroLens
Copy link
Contributor Author

@Gonals try running the workflows again? I believe the related lint errors are based on this section from the README.

The linter error is there till we add the param to all callers, once that happens we can make the param mandatory and remove the linter.

So I am unsure if I should be making the changes on the other lint errors unrelated to this (making the change to the lint error I already did seemed out-of-scope IMO).

@MacroLens
Copy link
Contributor Author

MacroLens commented May 16, 2025

Looking at the failed lint job:

This will just fetch the latest commit from main
From https://github.com/Expensify/App
 * branch            main       -> FETCH_HEAD
 * [new branch]      main       -> origin/main

> new.expensify@9.1.45-14 lint-changed
> NODE_OPTIONS=--max_old_space_size=[8](https://github.com/Expensify/App/actions/runs/15025106418/job/42355822010#step:4:9)192 eslint --max-warnings=0 --config ./.eslintrc.changed.js $(git diff --diff-filter=AM --name-only origin/main HEAD -- "*.ts" "*.tsx")

This is not a desktop build, adding babel-plugin-annotate-react
babel.config.js
  - api.version: 7.26.10
  - api.env: development
  - process.env.NODE_ENV: undefined
  - process.env.BABEL_ENV: undefined
  - running in:  undefined

/home/runner/work/App/App/src/components/Attachments/AttachmentCarousel/Pager/index.tsx
Error:   20:[9](https://github.com/Expensify/App/actions/runs/15025106418/job/42355822010#step:4:10)  error  'NativeViewGestureHandlerProps' is deprecated. NativeViewGestureHandler will be removed in the future version of Gesture Handler. Use `Gesture.Native()` instead  deprecation/deprecation

These lint errors are from main checking for deprecation warnings?

@MacroLens
Copy link
Contributor Author

@Gonals
Could you trigger the workflows? I don't feel like the issues stem from our changes I've seen other pull requests that have the same deprecation warnings on main.

@Gonals
Copy link
Contributor

Gonals commented May 19, 2025

Some lint errors

Add an optional default property enableMultiGestureCanvas
to allow for swipe down gestures on icons.
@MacroLens MacroLens requested a review from a team as a code owner May 19, 2025 17:52
@github-actions
Copy link
Contributor

⚠️ This PR is possibly changing native code and/or updating libraries, it may cause problems with HybridApp. Please check if any patch updates are required in the HybridApp repo and run an AdHoc build to verify that HybridApp will not break. Ask Contributor Plus for help if you are not sure how to handle this. ⚠️

@MacroLens MacroLens force-pushed the bug_61313_swipe_down_avatar branch from 4ab19ea to 812cfed Compare May 19, 2025 17:55
@MacroLens
Copy link
Contributor Author

MacroLens commented May 19, 2025

Did a push in error. Resulted in adding commits from main, force pushed to revert to changes made by the PR.

⚠️ This PR is possibly changing native code and/or updating libraries, it may cause problems with HybridApp. Please check if any patch updates are required in the HybridApp repo and run an AdHoc build to verify that HybridApp will not break. Ask Contributor Plus for help if you are not sure how to handle this. ⚠️

Edited to add context.

@MacroLens
Copy link
Contributor Author

@Gonals @ikevin127,

I am unsure what is causing the lint issue to occur. I just ran the git diff that the lint-changed runs:

git diff --diff-filter=AM --name-only origin/main HEAD -- "*.ts" "*.tsx"

And I only return the changed files.

@ikevin127
Copy link
Contributor

Right now, the workflows should run automatically after you merge main

@Gonals Looks like this is not working as expected after latest main sync. But hopefully we can get this merged soon since the previously failing lint tests were not related to this PRs changes.

@MacroLens
Copy link
Contributor Author

MacroLens commented May 22, 2025

@Gonals Would you be willing to trigger the workflows at 10 am, 11 am, or 12 pm EDT? You can pick as long as you let me know by 9:30 am EDT?

I don't know what time zone you are working with so you can compare here.

I'll do a merge commit around a minute before the time you specify.

@Gonals
Copy link
Contributor

Gonals commented May 22, 2025

here

I'm OOO for the next few days, so I won't be able to trigger these until around Tuesday, but I'm looking into why we are seeing this lint issues at all.

@MacroLens
Copy link
Contributor Author

@Gonals
Have you looked at my tests? I believe there are files that are being changed by people on main that still have lint errors in them in combination with the issue I described. I thought that explained the why?
See this commit f496dec. This was committed to main with files that were changed that still had lint errors. One file affected was src/libs/TransactionUtils/index.ts with getTransaction deprecation lint errors. This is the same file that shows up in the latest failure with our workflow fail.

Because this file was changed on main, when we run our workflows this file shows up as a changed file as I described in the git diff. We didn't change the file but it was changed on main so it gets added to the ES Lint check. Because it failed when it was added, it failed when we ran it. The workflow is running the linter on extraneous files because of this issue.

I think we should open this as an issue and apply the change I gave.

@MacroLens
Copy link
Contributor Author

For reassure I am investigating as well.

@MacroLens
Copy link
Contributor Author

@Gonals let me know if you can schedule a time for us to do the merge commit and run workflows right after.

@Gonals Would you be willing to trigger the workflows at 10 am, 11 am, or 12 pm EDT?

I can do any time in between or later.

@Gonals
Copy link
Contributor

Gonals commented May 27, 2025

Hey! I'm finally back. I will trigger this at 10 EDT

@MacroLens
Copy link
Contributor Author

Hey! I'm finally back. I will trigger this at 10 EDT

Sorry I didn't get that notification can you do again at 10:30 EDT?

@MacroLens
Copy link
Contributor Author

@Gonals

@MacroLens
Copy link
Contributor Author

I have a PR open on my fork that tests the workflows. When I am up to date with the main branch on there I did not have any workflow issues with the linter.

I have opened up an issue related to the linter as well.

@Gonals
Copy link
Contributor

Gonals commented May 27, 2025

Got to it now! Let's see

@MacroLens
Copy link
Contributor Author

🎉 It passed the changed files lint check this time.

@Gonals Gonals merged commit 900c474 into Expensify:main May 27, 2025
16 checks passed
@MacroLens
Copy link
Contributor Author

All tests passed! I have suspicions that the perf tests failed previously due to a merge error. This is likely due to a similar merge issue that we encounter in the lint issues.

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

@github-actions
Copy link
Contributor

🚀 Deployed to staging by https://github.com/Gonals in version: 9.1.53-0 🚀

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

@github-actions
Copy link
Contributor

🚀 Deployed to staging by https://github.com/Gonals in version: 9.1.53-0 🚀

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

@github-actions
Copy link
Contributor

🚀 Deployed to production by https://github.com/Beamanator in version: 9.1.53-7 🚀

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

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants