App icon indicating copy to clipboard operation
App copied to clipboard

[HOLD for payment 2024-04-05 / #39226] [$500] Workspace - Error message is left and bottom aligned in WS menus

Open lanitochka17 opened this issue 1 year ago β€’ 40 comments

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 1.4.47-2 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: Email or phone of affected tester (no customers): [email protected] Logs: https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by: Applause - Internal Team Slack conversation:

Action Performed:

  1. Access staging.new.expensify.com
  2. Sign into [email protected] account
  3. Go to WS settings and turn off internet
  4. Remove "[email protected]" user and then turn the internet back on Another way to simulate this error message is by simply turning on "Simulate failing network requests" in Troubleshooting. This will work on any account and is much simpler to reproduce

Expected Result:

User expects the error message to match the rest of the UI

Actual Result:

The error message seems too much aligned to the left and also aligned to the bottom

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • [ ] Android: Native
  • [ ] Android: mWeb Chrome
  • [ ] iOS: Native
  • [ ] iOS: mWeb Safari
  • [x] MacOS: Chrome / Safari
  • [x] MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6402951_1709652827058!Error_message_is_left_and_bottom_aligned

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~015595ed66487a0e2e
  • Upwork Job ID: 1765366719409008640
  • Last Price Increase: 2024-04-05

lanitochka17 avatar Mar 05 '24 16:03 lanitochka17

Triggered auto assignment to @laurenreidexpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

melvin-bot[bot] avatar Mar 05 '24 16:03 melvin-bot[bot]

@laurenreidexpensify FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

lanitochka17 avatar Mar 05 '24 16:03 lanitochka17

Proposal

Please re-state the problem that we are trying to solve in this issue.

Error message is left and bottom aligned in WS menus

What is the root cause of that problem?

We always add bottom margin to the list item:

https://github.com/Expensify/App/blob/a50923478ce163873c905e3566ccdc22f5284ce1/src/styles/index.ts#L4270-L4279

although the bottom margin should be on the outermost OfflineWithFeedback here.

What changes do you think we should make in order to solve the problem?

We should introduce a new prop in BaseListItem which allows passing custom style to the underneath OfflineWithFeedback component and move the marginBottom to that new prop (define a separate style key for that as well).

By this, we can make sure the error looks "stick" to its corresponding item and the error looks more horizontally aligned with the item.

Before

Screenshot 2024-03-05 at 23 28 18

After

Screenshot 2024-03-07 at 11 49 50

What alternative solutions did you explore? (Optional)

NA

gijoe0295 avatar Mar 05 '24 16:03 gijoe0295

Proposal

Please re-state the problem that we are trying to solve in this issue.

Workspace - Error message is left and bottom aligned in WS menus

What is the root cause of that problem?

We have margin bottom applied to BaseListItem pressable inside TableListItem. https://github.com/Expensify/App/blob/a50923478ce163873c905e3566ccdc22f5284ce1/src/styles/index.ts#L4276

What changes do you think we should make in order to solve the problem?

We need to remove bottom margin from selectionListPressableItemWrapper style object and then introduce new prop (containerStyle)inside BaseListItem for passing a style object to OfflineWithFeedback. From TableListItem, now we need to pass containerStyle={styles.pb3} to BaseListItem. And from BaseListItem we will pass the style prop to OfflineWithFeedback as style={containerStyle}. We will also apply styles.pt3 to errorRowStyles to align the error message to center.

We might also want to reduce padding horizontal from listHeaderWrapperStyle because the first item will have some padding top. https://github.com/Expensify/App/blob/5199604ac28f9db9fdcdc8bf7e8b4ce4e406ded8/src/pages/workspace/WorkspaceMembersPage.tsx#L518

PS: I think the left alignment is fine, we have similar alignment in multiple places, we might want to just centre or move to top those error messages.

If we need some more margin, it can be added to errorRowStyle, but that can be handled in the PR after final decision is made by the design team

Result

Monosnap New Expensify 2024-03-05 22-15-09

Alternatively

We will remove bottom margin from selectionListPressableItemWrapper and check if the item has error or not and based on that we will add styles.m3, we will only add styles.m3 when we don't have any errors. Otherwise error message container is enough for spacing. Or we can also introduce a new prop for passing errorRowStyles to BaseListItem > OfflineWithFeedback for minor vertical margin.

const hasErrors = !isEmptyObject(item.errors);
pressableStyle={[[...otherstyles, !hasErrors && styles.mb3]]}
Monosnap New Expensify 2024-03-05 22-55-05

Result with vertical margin of 4px on error row:

image

Bug 2

There is also a bug in WorkspacesListPage, in that component we have nested OfflineWithFeedback inside PressableWithoutFeedback and due to that when we hover on error message it shows hand cursor and if we click it takes to workspace details page. https://github.com/Expensify/App/blob/e3b10f7da5a6935a0fe461f7acf950129d6a04f0/src/pages/workspace/WorkspacesListPage.tsx#L173-L187

https://github.com/Expensify/App/assets/85894871/d1d8a781-84e3-423f-aa7c-3ee0e4a6e9cd

Solution for bug 2

I prefer to use my alternative solution fir this bug stylings also, apart from that we need to move OfflineWithFeedback outside PressableWithoutFeedback as a parent component of PressableWithoutFeedback. Then we need to add styles.mb3 only if there is no error & add some vertical spacing for errorRowStyles.

After fix

https://github.com/Expensify/App/assets/85894871/55e1cc37-8d16-4623-9dfb-485d17553780

Krishna2323 avatar Mar 05 '24 16:03 Krishna2323

Proposal Update

  • Added alternative solution
  • Found similar bug and added solution for it

Krishna2323 avatar Mar 05 '24 17:03 Krishna2323

Job added to Upwork: https://www.upwork.com/jobs/~015595ed66487a0e2e

melvin-bot[bot] avatar Mar 06 '24 13:03 melvin-bot[bot]

Triggered auto assignment to Contributor-plus team member for initial proposal review - @rushatgabhane (External)

melvin-bot[bot] avatar Mar 06 '24 13:03 melvin-bot[bot]

@Expensify/design can you confirm this is a bug and not expected behaviour? It definitely sounds like an inconsistency

laurenreidexpensify avatar Mar 06 '24 13:03 laurenreidexpensify

@lanitochka17 can you elaborate more on your bug report, specifically this part here:

Expected result: User expects the error message to match the rest of the UI

Just want to clarify what "match the rest of the UI" means, and if this might have failed a certain test, etc?

shawnborton avatar Mar 06 '24 13:03 shawnborton

I agree though, we could probably just add some bottom margin to the error message and we should be good to go here. Do we want to have this as an external bug fix, or @luacmartins should we just have this fixed by whoever implemented it in the first place?

shawnborton avatar Mar 06 '24 13:03 shawnborton

This view was introduced as part of ideal nav a few weeks ago and it's past the regression period, so I think we can keep it external.

luacmartins avatar Mar 06 '24 14:03 luacmartins

@shawnborton Now we have two approaches for the error message to show as you can see in our proposal screenshots.I proposed to make the error more "stick" to the corresponding item. The other proposed to keep the space evenly between the items and errors.

gijoe0295 avatar Mar 06 '24 16:03 gijoe0295

I think this style makes sense: CleanShot 2024-03-06 at 11 43 42@2x

But maybe with slightly more margin below the error message so it feels more attached to the row above. Curious if @Expensify/design has any differing opinions though!

shawnborton avatar Mar 06 '24 16:03 shawnborton

But maybe with slightly more margin below the error message so it feels more attached to the row above

I think this is what you're looking for (from my proposal:

Screenshot 2024-03-05 at 23 23 31

gijoe0295 avatar Mar 06 '24 16:03 gijoe0295

Not quite - I think the width of the error message in the other proposal might be better. I see where this one aligns with the content a little more, but I feel like we should avoid trying to be too crafty with these messages and just use the same standard style everywhere.

shawnborton avatar Mar 06 '24 16:03 shawnborton

Updated my proposal to reflect the latest expectation since the solutions in both proposals are the same, just differ in CSS styling.

gijoe0295 avatar Mar 07 '24 04:03 gijoe0295

PS: Initially, I identified the correct styles, aiming to ensure consistency with the rest of the UI. Consequently, I invested time in exploring the similar UIs to determine the appropriate stylings, resulting in the addition of multiple different styles for demo. Additionally, during this exploration, I uncovered another bug that requires attention. I've included a fix for this issue in the 'Bug 2' section of my proposal.

Krishna2323 avatar Mar 07 '24 10:03 Krishna2323

Initially, I identified the correct styles

That's not completely correct as per feedback here. My styles cover one aspect of the expectation while yours cover the other. We both had incomplete styles but the implementation idea was similar. Let's see what C+ weigh in here.

gijoe0295 avatar Mar 07 '24 11:03 gijoe0295

Next step: @rushatgabhane to review

laurenreidexpensify avatar Mar 11 '24 10:03 laurenreidexpensify

@gijoe0295's proposal was first and it looks fine. @Krishna2323 has given a more detailed solution.

I think we should hire @Krishna2323 because they have explained the implementation in more details πŸŽ€ πŸ‘€ πŸŽ€

rushatgabhane avatar Mar 11 '24 22:03 rushatgabhane

Triggered auto assignment to @Gonals, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

melvin-bot[bot] avatar Mar 11 '24 22:03 melvin-bot[bot]

Please use plain English, be brief and avoid jargon. Do not post large multi-line diffs or write walls of text.

Keep the language simple - Reduce every word down to its most plain and straightforward manner.

ALL NEW PROPOSALS MUST BE DIFFERENT FROM EXISTING PROPOSALS. The difference should be important, meaningful or considerable.

(Quoted from contributingGuides)

I think just paraphrasing words isn't ideal and "detailed" πŸ˜• if the ideas are the same, implementation is straightforward and there's no specific notes.

gijoe0295 avatar Mar 12 '24 01:03 gijoe0295

@gijoe0295, it's not paraphrasing words. I provided all the implementation details and also invested time in exploring other components to ensure correct styling, rather than applying random styles. Additionally, in my proposal, I'm addressing another bug in WorkspacesListPage, specifically concerning error message alignment. It's important we address all the similar bugs in the same PR. Please checkout Bug 2 section in proposal.

Krishna2323 avatar Mar 12 '24 07:03 Krishna2323

@Gonals bump for assignment thanks

laurenreidexpensify avatar Mar 14 '24 10:03 laurenreidexpensify

❌ There was an error making the offer to @Krishna2323 for the Contributor role. The BZ member will need to manually hire the contributor.

melvin-bot[bot] avatar Mar 14 '24 10:03 melvin-bot[bot]

@Gonals bump for assignment thanks

On it

Gonals avatar Mar 14 '24 10:03 Gonals

@rushatgabhane, PR ready for review.

Krishna2323 avatar Mar 17 '24 20:03 Krishna2323

@rushatgabhane, friendly bump for review.

Krishna2323 avatar Mar 21 '24 03:03 Krishna2323

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

melvin-bot[bot] avatar Mar 27 '24 17:03 melvin-bot[bot]

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

melvin-bot[bot] avatar Mar 28 '24 13:03 melvin-bot[bot]