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

Center align Workspace name on web and mobile web #4860

Closed
MitchExpensify opened this issue Aug 26, 2021 · 15 comments
Closed

Center align Workspace name on web and mobile web #4860

MitchExpensify opened this issue Aug 26, 2021 · 15 comments
Assignees
Labels
Daily KSv2 Help Wanted Apply this label when an issue is open to proposals by contributors

Comments

@MitchExpensify
Copy link
Contributor

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


Action Performed:

  1. Click "+" in new.expensify.com
  2. Click "Create Workspace"
  3. Workspace name is not aligned in the left hand pane

Expected Result:

I would expect the Workspace name to be center aligned under the workspace avatar

Actual Result:

Workspace name is not center aligned under the workspace avatar

Workaround:

Ignore

Platform:

Where is this issue occurring?

  • Web
  • Mobile Web

Version Number: v1.0.88-0
Notes/Photos/Videos:
image

IMG_962ABCE3FF01-1

View all open jobs on GitHub

@MitchExpensify MitchExpensify added AutoAssignerTriage Auto assign issues for triage to an available triage team member Daily KSv2 labels Aug 26, 2021
@MelvinBot
Copy link

Triggered auto assignment to @kevinksullivan (AutoAssignerTriage), see https://stackoverflow.com/c/expensify/questions/4749 for more details.

@MelvinBot MelvinBot removed the AutoAssignerTriage Auto assign issues for triage to an available triage team member label Aug 26, 2021
@kakajann
Copy link
Contributor

Proposal

add styles.textAlignCenter to Text in here:

<Tooltip text={policy.name}>
<Text
numberOfLines={1}
style={[
styles.displayName,
]}
>
{policy.name}
</Text>
</Tooltip>

@kevinksullivan
Copy link
Contributor

@MelvinBot MelvinBot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 27, 2021
@MelvinBot
Copy link

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

@akshayasalvi
Copy link
Contributor

Proposal

I feel there are two issues with the title of the Workspace name. One is the alignment, second is the fontSize. If you see the there's no difference in the title of the workspace and the menuItems.

We could do the following:

<Text
    numberOfLines={1}
    style={[
        styles.displayName,
        styles.textAlignCenter,  // to center align.
        {. // can be added to styles.js
            fontSize: variables.fontSizeMidLarge.  // this is size 22, we can even try fontSizeXLarge: 24
        }
    ]}
>
    {policy.name}
</Text>

image

@PrashantMangukiya
Copy link
Contributor

PrashantMangukiya commented Aug 28, 2021

Proposed Solution:

Updates: I just fetched recent version of the app (1.0.88-2), compiled and tested. Now my previous solution (to add styles.alignSelfCenter to text component ) not working as expected in all platform.

So now I suggest to add styles.textAlignCenter (instead of styles.alignSelfCenter) to Text component as other people also suggested before me. I will not mind if project awarded to them as they suggested before me.

So now code looks like below after changes: /src/pages/workspace/WorkspaceSidebar.js file.

          <Tooltip text={policy.name}>
              <Text
                  numberOfLines={1}
                  style={[
                      styles.displayName,
                      styles.textAlignCenter,    // Add this style
                  ]}
              >
                  {policy.name}
              </Text>
          </Tooltip>

Below are some screenshots I taken on latest version (1.0.88-2) by adding styles.textAlignCenter to Text component. It is working as expected for short and long workspace name.

Screenshots

Web

Web1

With workspace name too long
Web2

Mobile Web

MobileWeb1

With workspace name too long
MobileWeb2

Desktop

Desktop1

With workspace name too long
Desktop2

iOS

iOS1

With workspace name too long
iOS2

Android 7.1.1

Android1

With workspace name too long
Android2

If solution considered then kindly accept my Upwork proposal. Once proposal accepted, I will do final testing and submit pull request within 2 days.

My Upwork profile: https://www.upwork.com/freelancers/~01c718889ed7821f82

Best Regards,
Prashant Mangukiya

@gregorjoshua
Copy link

gregorjoshua commented Aug 28, 2021

Proposal

I think that this can be fixed by just changing
src\pages\workspace\WorkspaceSidebar.js line 133 from
styles.alignSelfCenter,
to
styles.alignItemsCenter,

Orignal:
centering_og

Fixed:
centering_fixed

@PrashantMangukiya
Copy link
Contributor

Hi @gregorjoshua Thanks for the suggestion. But It is not good idea to set styles.alignItemsCenter at line 133 for Pressable componnet, because It is disturbing the Tooltip child component behaviour under it. i.e. when workspace name too long then text touches left and right side and it is not expected behaviour.

See below screenshot that shows longs workspace name touched at left and right side when we set styles.alignItemsCenter to Pressable at line 133 , it is not expected behaviour.

Worksapcename-Disturb1

When workspace name too long it should truncate text and show ellipses at the end (i.e. three dots ...). I updated screenshot within my proposal, as you can see it shows expected behaviour when workspace name too long.

Thanks

@gregorjoshua
Copy link

gregorjoshua commented Aug 28, 2021

Thanks @PrashantMangukiya! This is my first time commenting/contributing so I appreciate any feedback.

i.e. when workspace name too long then text touches left and right side and it is not expected behaviour.

I think that the code that is in place already takes care of that (at least on Android).
centering_fixed_2

I tried to test on Web, but when I run npm run web my localhost runs the https://www.expensify.com/ site, and not the https://new.expensify.com/ site so I haven't figured out how to test on web.

Is your screenshot using the code that I suggested?

@PrashantMangukiya
Copy link
Contributor

Is your screenshot using the code that I suggested?

Hi @gregorjoshua , Thanks for the message. Yes I set styles.alignItemsCenter to Pressable component at line 133 and taken screenshot for web version that shows workspace name disturbed.

Now I just fetched recent version of the app (1.0.88-2), compiled and tested. Strange result, It looks like now changing styles.alignSelfCenter to styles.alignItemsCenter at line 133 Pressable component also working proper as per your suggestion. I think there was some glitch in previous version.

Now both solution i.e. changing styles.alignSelfCenter to styles.alignItemsCenter at line 133 as you suggest, and Other is to add styles.textAlignCenter to text component working as expected in all platform.

In fact now my previously suggested solution to add styles.alignSelfCenter to text component is not working as expected in all platform. I will prefer to add styles.textAlignCenter to text component instead of Pressable component.

Thanks.

@shawnborton
Copy link
Contributor

shawnborton commented Aug 29, 2021 via email

@akshayasalvi
Copy link
Contributor

akshayasalvi commented Aug 29, 2021

@shawnborton I can confirm this is my regression from PR #4835.

I'll fix it as soon as I am in front of the computer. PR raised

@shawnborton
Copy link
Contributor

Awesome, thank you!

@deetergp
Copy link
Contributor

@akshayasalvi thanks for owning up to the regression. Does that mean we are good to close this one?

@MelvinBot MelvinBot removed the Overdue label Aug 30, 2021
@deetergp
Copy link
Contributor

I'm going with "yes" feel free to reopen if anyone disagrees.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Daily KSv2 Help Wanted Apply this label when an issue is open to proposals by contributors
Projects
None yet
Development

No branches or pull requests

9 participants