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

Override max width in Workspace List page #14040

Merged
merged 2 commits into from
Jan 6, 2023

Conversation

luacmartins
Copy link
Contributor

Details

Makes Workspace name take full width in the list page

Fixed Issues

$ #14007

Tests

  1. Create a Workspace with a really long name, e.g. Dm's Workspace 21234123134123123412341234123412412341234
  2. Navigate to the Settings > Workspaces
  3. Resize the browser window and verify that the name is truncated only when it gets close to the right caret, otherwise it should display fully.
  • Verify that no errors appear in the JS console

Offline tests

N/A

QA Steps

Same as test steps

  • 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 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 correct English and 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
    • 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(themeColors.componentBG)
  • 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 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 have checked off every checkbox in the PR author checklist, including those that don't apply to this PR.

Screenshots/Videos

Web
web.mov
Mobile Web - Chrome

chrome

Mobile Web - Safari

safari

Desktop
desktop.mov
iOS

ios

Android

android

@luacmartins luacmartins self-assigned this Jan 5, 2023
@luacmartins luacmartins marked this pull request as ready for review January 5, 2023 23:08
@luacmartins luacmartins requested a review from a team as a code owner January 5, 2023 23:08
@melvin-bot melvin-bot bot requested review from joelbettner and mananjadhav and removed request for a team January 5, 2023 23:09
@melvin-bot
Copy link

melvin-bot bot commented Jan 5, 2023

@mananjadhav @joelbettner 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]

@mananjadhav
Copy link
Collaborator

mananjadhav commented Jan 6, 2023

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 / Chrome
    • iOS / native
    • iOS / 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 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 correct English and 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 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(themeColors.componentBG)
  • 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 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 have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Web
web-workspace-name-truncate.mov
web-sidebar-truncate.mov
Mobile Web - Chrome mweb-chrome-workspace-name-truncate mweb-chrome-sidebar-truncate
Mobile Web - Safari mweb-safari-workspace-name-truncate mweb-safari-sidebar-truncate
Desktop
desktop-workspace-name-truncate.mov
desktop-sidebar-truncate.mov
iOS ios-workspace-name-truncate ios-sidebar-truncate
Android android-workspace-name-truncate android-sidebar-truncate

@luacmartins @joelbettner I had issues with my IP, so I've used an emulator for the mobile web. I think for styling this should be good enough. Straight forward change and tests well.

mananjadhav
mananjadhav previously approved these changes Jan 6, 2023
@luacmartins
Copy link
Contributor Author

All yours @joelbettner!

@luacmartins
Copy link
Contributor Author

@mananjadhav I just tested removing the fixed width in MenuItem and I didn't see any breaking changes. Mind testing this PR again?

Copy link
Contributor

@joelbettner joelbettner left a comment

Choose a reason for hiding this comment

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

Nice. LGTM

@mananjadhav
Copy link
Collaborator

I tested the details page and few screens where we have the MenuItem. Uploading the screenshots shortly.

@mananjadhav
Copy link
Collaborator

@luacmartins @joelbettner I've added additional screenshots in the previous checklist itself. All looks good here.

@luacmartins
Copy link
Contributor Author

Cool! Merging this since we have the approvals! Thank you both!

@luacmartins luacmartins merged commit a1eece9 into main Jan 6, 2023
@luacmartins luacmartins deleted the cmartins-fixTruncatedWorkspaceName branch January 6, 2023 19:55
@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2023

Performance Comparison Report 📊

Significant Changes To Duration

Name Duration
TTI 813.768 ms → 699.491 ms (-114.277 ms, -14.0%) 🟢
Show details
Name Duration
TTI Baseline
Mean: 813.768 ms
Stdev: 33.868 ms (4.2%)
Runs: 741.9985229996964 760.6940069999546 761.0989929996431 761.6469719996676 773.2573049999774 781.817797999829 787.4785669995472 788.5364129999653 791.1773340003565 796.0688169999048 800.5557519998401 803.2889489997178 807.2985049998388 812.3042040001601 813.5887789996341 814.0545950001106 819.5135819995776 823.9023759998381 828.3310380000621 829.5771500002593 829.8066560002044 831.6131379995495 833.417795999907 834.3797180000693 836.4706629998982 844.9325400004163 846.3247349997982 859.6792529998347 860.7892100000754 866.2789690000936 886.9140799995512

Current
Mean: 699.491 ms
Stdev: 29.821 ms (4.3%)
Runs: 643.597237999551 646.0871850000694 652.2906400002539 655.9551649997011 675.004197999835 681.099887999706 684.3840229995549 684.6935440003872 684.9134400002658 685.259327000007 686.1598910000175 688.2898460002616 689.0718740001321 689.6300280001014 690.4276339998469 695.6816640002653 700.0610929997638 700.2472350001335 700.7541789999232 702.6181680001318 703.4468830004334 715.3312550000846 715.5481160003692 721.4699419997633 722.3521170001477 725.4165839999914 736.2096090000123 738.5541129997 745.8341070003808 757.7466010004282 766.0739259999245

Meaningless Changes To Duration

Show entries
Name Duration
runJsBundle 185.156 ms → 193.094 ms (+7.938 ms, +4.3%)
regularAppStart 0.015 ms → 0.015 ms (+0.001 ms, +5.6%)
nativeLaunch 10.656 ms → 9.867 ms (-0.790 ms, -7.4%)
Show details
Name Duration
runJsBundle Baseline
Mean: 185.156 ms
Stdev: 18.509 ms (10.0%)
Runs: 150 158 160 161 165 168 169 171 172 176 176 177 178 178 179 182 184 186 187 188 190 190 195 197 200 204 207 210 210 215 219 223

Current
Mean: 193.094 ms
Stdev: 21.391 ms (11.1%)
Runs: 160 166 170 171 172 172 172 174 174 174 176 178 179 184 187 188 192 192 198 203 205 206 207 208 209 213 215 215 217 219 234 249
regularAppStart Baseline
Mean: 0.015 ms
Stdev: 0.001 ms (5.4%)
Runs: 0.012899000197649002 0.013183999806642532 0.013468999415636063 0.013631000183522701 0.013794000260531902 0.013916000723838806 0.014078999869525433 0.014159999787807465 0.014161000028252602 0.014240999706089497 0.014282000251114368 0.014282000251114368 0.014322999864816666 0.01444500032812357 0.014485999941825867 0.014485999941825867 0.014566999860107899 0.01464799977838993 0.014649000018835068 0.0147299999371171 0.014852000400424004 0.014891999773681164 0.014933000318706036 0.014973999932408333 0.015177000313997269 0.0152580002322793 0.015339999459683895 0.015421000309288502 0.01550300046801567 0.016071999445557594 0.016642999835312366

Current
Mean: 0.015 ms
Stdev: 0.002 ms (10.6%)
Runs: 0.013101999647915363 0.01314299926161766 0.013305999338626862 0.013306000269949436 0.013631000183522701 0.0138349998742342 0.013915999792516232 0.013996999710798264 0.013996999710798264 0.0139979999512434 0.014038000255823135 0.014485999941825867 0.01460800040513277 0.01476999931037426 0.014771000482141972 0.015137000009417534 0.01534000039100647 0.015340999700129032 0.015584000386297703 0.01574699953198433 0.015828999690711498 0.015990999527275562 0.016154000535607338 0.01623500045388937 0.0167239997535944 0.017171000130474567 0.01761799957603216 0.0176189998164773 0.017740999348461628 0.018106999807059765 0.018147999420762062 0.018636000342667103
nativeLaunch Baseline
Mean: 10.656 ms
Stdev: 2.768 ms (26.0%)
Runs: 7 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 9 10 10 11 11 11 12 12 12 13 13 14 16 16 17 17

Current
Mean: 9.867 ms
Stdev: 1.648 ms (16.7%)
Runs: 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 9 9 10 11 11 11 11 11 12 12 12 12 13 14

@github-actions github-actions bot added the DeployBlockerCash This issue or pull request should block deployment label Jan 6, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2023

@Expensify/mobile-deployers 📣 Please look into this performance regression as it's a deploy blocker.

@luacmartins
Copy link
Contributor Author

We actually have a large decrease in TTI time due to us now mocking the API ⚡ Andrew will work on the tests to fix the noisy comments.

@luacmartins luacmartins removed the DeployBlockerCash This issue or pull request should block deployment label Jan 6, 2023
@OSBotify
Copy link
Contributor

OSBotify commented Jan 6, 2023

🚀 Deployed to staging by @luacmartins in version: 1.2.50-2 🚀

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

@OSBotify
Copy link
Contributor

OSBotify commented Jan 9, 2023

🚀 Deployed to production by @Julesssss in version: 1.2.50-14 🚀

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

@luacmartins luacmartins mentioned this pull request Jan 13, 2023
53 tasks
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