Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
2.99k stars 2.5k forks source link

fix: Fix scrollable elements in Policy pages. #38719

Open Krishna2323 opened 1 month ago

Krishna2323 commented 1 month ago

Details

Fixed Issues

$ https://github.com/Expensify/App/issues/37782 PROPOSAL: https://github.com/Expensify/App/issues/37782#issuecomment-1984112170

Tests

For devices with width greater than 800px

  1. Open collect workspace from workspaces page
  2. Open Members, Distance rates, Categories, Tags and Taxes page.
  3. On each page scroll the options list and verify it does scroll correctly

For devices with width less than 800px

  1. Open collect workspace from workspaces page
  2. Open Members, Distance rates, Categories, Tags and Taxes page.
  3. On each page scroll the options list
  4. Verify the page description on top and the thead scrolls and buttons are fixed.

Offline tests

For devices with width greater than 800px

  1. Open collect workspace from workspaces page
  2. Open Members, Distance rates, Categories, Tags and Taxes page.
  3. On each page scroll the options list and verify it does scroll correctly

For devices with width less than 800px

  1. Open collect workspace from workspaces page
  2. Open Members, Distance rates, Categories, Tags and Taxes page.
  3. On each page scroll the options list
  4. Verify the page description on top and the thead scrolls and buttons are fixed.

QA Steps

For devices with width greater than 800px

  1. Open collect workspace from workspaces page
  2. Open Members, Distance rates, Categories, Tags and Taxes page.
  3. On each page scroll the options list and verify it does scroll correctly

For devices with width less than 800px

  1. Open collect workspace from workspaces page
  2. Open Members, Distance rates, Categories, Tags and Taxes page.
  3. On each page scroll the options list
  4. Verify the page description on top and the thead scrolls and buttons are fixed.

PR Author Checklist

Screenshots/Videos

Android: Native https://github.com/Expensify/App/assets/85894871/de69a238-d56e-45b7-a21e-9ab7b48dfc5b
Android: mWeb Chrome https://github.com/Expensify/App/assets/85894871/dc281d4c-3197-4aec-a49b-9866b6ff26d9
iOS: Native https://github.com/Expensify/App/assets/85894871/b2ec120a-dac9-42e4-aac1-771a2fa5eb8e
iOS: mWeb Safari https://github.com/Expensify/App/assets/85894871/633268c7-30ca-4a43-8ca8-bc80b6e7b6ee
MacOS: Chrome / Safari https://github.com/Expensify/App/assets/85894871/568a4a90-201e-4be1-8e42-a24c01761f0c
MacOS: Desktop https://github.com/Expensify/App/assets/85894871/630d2bb7-4495-40ef-9b37-83a49ee2f4ff
melvin-bot[bot] commented 1 month ago

@akinwale 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]

Krishna2323 commented 1 month ago

@shawnborton https://github.com/Expensify/App/issues/37782#issuecomment-2009382463, do you have something to suggest here? it would be great if we clear things before I start implementing it on other pages since we need to handle multiple pages, eg: tags, categories, taxes, distance, etc etc.

https://github.com/Expensify/App/assets/85894871/058bb4ad-279d-40d7-a9bf-9b8ee714bc5d

shawnborton commented 1 month ago

Thanks for the video! cc @Expensify/design for visibility

One thing that would be nice, but would be more difficult - it would be cool if the entire page was able to scroll below the header area, but as soon as the table column header row (thead) was about to scroll out of view, it would stay fixed to the top. This way the description can scroll away so you get a little more viewport height to use. Does that make sense, and is that doable?

Krishna2323 commented 1 month ago

@shawnborton, my apologies for the delay. I encountered some difficulties over the past few days while attempting to implement your suggestions. However, I believe I've finally managed to grasp it. Could you please confirm if this is what you meant?

https://github.com/Expensify/App/assets/85894871/d18f64a3-0a8c-4961-8a8e-daeb45123c77

shawnborton commented 1 month ago

Exactly! Though it looks like the thead has an incorrect BG color?

Krishna2323 commented 1 month ago

@shawnborton, Yep, I just added white as bg for testing because it was transparent and hard to see in demo video. Will update that. Thanks.

One more thing I would suggest is that we should scroll to the top when the user selects all by using the checkbox in the thead. This way, they can see the dropdown button to delete/disable/enable categories/tags/etc.

Monosnap (59) New Expensify 2024-03-28 22-19-54
Krishna2323 commented 1 month ago

@shawnborton, could you please tell me what background to use for the sticky header? The application's background is set to darkMode: rgba(6,27,9,0.92) and lightMode: rgba(252, 251, 249, 0.92). I applied the same background to the header, but the options are still visible when the header overlaps them because of the opacity set to.92.

https://github.com/Expensify/App/assets/85894871/a89f9b4c-906f-497a-9603-919a8e52fd99

shawnborton commented 1 month ago

Whoa - no idea why the opacity is reduced. Can we just remove that and make it so that it uses a 100% opacity background?

Krishna2323 commented 1 month ago

yep, we can create a new variable for that to use the same bg color with full opacity, will share screenshots after making changes.

shawnborton commented 1 month ago

Do we need a new variable? It should just be the same as the appBG right?

Krishna2323 commented 1 month ago

Sorry for the confusion, I was lost in elements tab. We are using 252, 251, 249 with full opacity for the app. You can ignore the issue I mentioned above.

Krishna2323 commented 1 month ago

Code changes are completed, will do final testing and add recordings for review.

Krishna2323 commented 1 month ago

Facing a weird issue :(, the LHS is not displayed when visiting any policy settings page. Will try again later.

https://github.com/Expensify/App/assets/85894871/45af4c52-5c83-4fc3-9d81-b27037d294ca

shawnborton commented 1 month ago

Looks like we have some conflicts.

Krishna2323 commented 1 month ago

@akinwale, you can start reviewing this, I'm facing some issues while building the app for iOS. I'm working on fixing the build issue and will add screenshots for both Android and iOS shortly. All other recordings have been added.

akinwale commented 1 month ago

@Krishna2323 Please fix merge conflicts.

Krishna2323 commented 1 month ago

@akinwale, conflicts resolved.

Krishna2323 commented 1 month ago

@akinwale, please hold off on reviewing this. While recording the video for Android, I noticed that the thead doesn't stick to the top in the Android native app, whereas it does in the iOS native app. Please wait until I find a solution for this, I'm currently working on it.

Krishna2323 commented 3 weeks ago

I still haven't found any solution for Android native development :( However, I did notice one weird behavior, when I initially visit any policy page with a selection list, the table header doesn't stick to the top. But when I navigate to another page from the policy page and then return, the table header starts working correctly and sticks to the top.

I'm planning to test this on a physical Android device, maybe it will work there. @akinwale, do you have any suggestions on how to set up running the app on a physical device? I haven't tried it yet.

https://github.com/Expensify/App/assets/85894871/304e803c-2520-4185-85ee-ef2911f2fce8

akinwale commented 3 weeks ago

@Krishna2323 https://expensify.enterprise.slack.com/archives/C01GTK53T8Q/p1707982610262429?thread_ts=1707982610.262429&cid=C01GTK53T8Q

Krishna2323 commented 2 weeks ago

@akinwale @shawnborton, I spent a lot of time finding a solution for android native thead stick issue but hasn't found any solution yet. Should I try workaround. I found few: medium, stackoverflow

shawnborton commented 2 weeks ago

Curious what @akinwale thinks there

akinwale commented 2 weeks ago

@Krishna2323 I think it would make sense as long as it's implemented as a platform-specific component for Android-native only.

Krishna2323 commented 1 week ago

@akinwale @shawnborton, I've tried implementing both solutions, but unfortunately, they aren't working as expected. There's a noticeable lag while scrolling.

https://github.com/Expensify/App/assets/85894871/2330833e-63c9-4dcb-b48e-52f5575a9cc8

shawnborton commented 1 week ago

Hmm I am out of ideas then. At this point, maybe we should just make this part of the view fixed: CleanShot 2024-05-06 at 07 57 51@2x

And everything else can scroll under it. Thoughts?

Krishna2323 commented 1 week ago

@shawnborton, IMO making the buttons stick to the top, instead of select all rows thead, makes more sense for a few reasons:

  1. If a user wants to select all, they can easily do so without scrolling.
  2. Consider this scenario: If a user wants to check if a category/option is present, they can scroll and search. If they want to add it, they can use the fixed buttons instead of scrolling all the way back up (if the buttons aren't fixed).
shawnborton commented 1 week ago

Yeah, that makes sense to me and I think it's a good compromise.

Krishna2323 commented 1 week ago

@akinwale, code is updated according to the discussion above, you can start the review. Recordings will be updated in few moments.

Krishna2323 commented 1 week ago

@akinwale recordings are updated. @shawnborton can you pls verify the behaviour in the recording below.

https://github.com/Expensify/App/assets/85894871/de69a238-d56e-45b7-a21e-9ab7b48dfc5b

shawnborton commented 1 week ago

That feels pretty good to me. Thoughts @Expensify/design?

dannymcclain commented 1 week ago

Yeah I think that feels pretty good.

dubielzyk-expensify commented 1 week ago

LGTM too!

Krishna2323 commented 6 days ago

@akinwale, bump for review.

akinwale commented 5 days ago

Reviewing today.

akinwale commented 5 days ago

Reviewer Checklist

Screenshots/Videos

Android: Native https://github.com/Expensify/App/assets/4160319/00a36e9f-ed92-4481-980f-b5790546414b
Android: mWeb Chrome https://github.com/Expensify/App/assets/4160319/ddab64ee-c91f-4eb5-ab30-5a5cbcec7a34
iOS: Native https://github.com/Expensify/App/assets/4160319/592716a7-73fd-46d6-a289-01392e1bd5c2
iOS: mWeb Safari https://github.com/Expensify/App/assets/4160319/d0ad8e4e-900d-4ca4-90d2-1b2464348060
MacOS: Chrome / Safari https://github.com/Expensify/App/assets/4160319/66c23ea2-e042-4c73-ab96-65058fde58a5
MacOS: Desktop https://github.com/Expensify/App/assets/4160319/ab67d864-8c99-4c9c-b3d5-175e077ec9b3
Krishna2323 commented 1 day ago

@flodnv, friendly bump to merge this.