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

fix: truncate text adding ellipsis after certain length #24831

Closed
wants to merge 17 commits into from
Closed

fix: truncate text adding ellipsis after certain length #24831

wants to merge 17 commits into from

Conversation

Manuel-Suarez-Abascal
Copy link
Contributor

After the changes:

Screenshot 2022-11-27 at 5 29 16 PM

Screenshot 2022-11-27 at 5 24 33 PM

User facing changelog

It truncates the browser name in the UI after a determined length(16) in order to avoid layout issues when the browser name is too long.

Additional details

N/A

Steps to test

  • Install Firefox Developer Edition browser.
  • Launch Cypress.

How has the user experience changed?

An ellipsis will be added if the browser name is too long. Ellipsis will be added if the browser name is more than 16 characters.

PR Tasks

  • Have tests been added/updated?
  • Has the original issue (or this PR, if no issue exists) been tagged with a release in ZenHub? (user-facing changes only)
  • Has a PR for user-facing changes been opened in cypress-documentation?
  • Have API changes been updated in the type definitions?

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Nov 27, 2022

Thanks for taking the time to open a PR!

@CLAassistant
Copy link

CLAassistant commented Nov 27, 2022

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
3 out of 4 committers have signed the CLA.

✅ Manuel-Suarez-Abascal
✅ emilyrohrbough
✅ lmiller1990
❌ Manuel Abascal


Manuel Abascal seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@marktnoonan
Copy link
Contributor

Thanks for the PR @Manuel-Suarez-Abascal! This strikes me as something that needs a review from our design team before we make the change. The linked issue is quite vague "maybe can truncate...". It probably should not have been labelled a "good first issue" since it's not a clearly defined task.

My initial concern is that the full browser name may sometimes be important & we should probably live with wrapping, or if we don't, we should offer a tooltip with full text. Users can define custom browsers and may give them all kinds of names that might be useful to see.

If we go with truncating, my suggestion would be that we should not do it with JavaScript but use the truncate utility class from Tailwind.

That said, it looks to me like one of the problems reported in the issue has already been solved differently - the dropdown no longer has the weird centering/wrapping that was in that screenshot, it looks like this, which seems fine:

Screen Shot 2022-11-27 at 9 16 02 PM

@elevatebart would you mind giving some feedback on whether there's more to do here? Should we close that old issue, or do the truncating -- or do you and team have some other design guidance?

@elevatebart
Copy link
Contributor

Thank you @Manuel-Suarez-Abascal

Good PR indeed. On a rather hard issue.
I think doing the truncation using text-overflow: ellipsis is a better idea.

<div class="ellipsis overflow-hidden whitespace-nowrap" />

@elevatebart
Copy link
Contributor

Also, don't forget to rebase this Branch with only commits signed with GitHub.

Copy link
Contributor

@elevatebart elevatebart left a comment

Choose a reason for hiding this comment

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

Please use CSS to truncate the browser name.

@Manuel-Suarez-Abascal
Copy link
Contributor Author

@elevatebart thanks, it seems that I complicated things for no reason. I have addressed the PR comments. That being said, I use the truncate class from Tailwind as per the docs here. Do you want to use this instead? class="ellipsis overflow-hidden whitespace-nowrap"

Also, don't forget to rebase this Branch with only commits signed with GitHub.

I am not sure what you mean about this. Hopefully, I complied with this requirement 😬

@elevatebart
Copy link
Contributor

Thank you @Manuel-Suarez-Abascal, I like this new fix.

By rebasing your branch with only signed commit I was trying to get rid of the Red Cross here.

Screenshot 2022-12-05 at 11 55 06 AM

This unsigned commit prevents us from merging your PR.

@elevatebart
Copy link
Contributor

I believe also that the initial problem mentioned in the ticket was fixed another way.

@marktnoonan could you confirm that so that @Manuel-Suarez-Abascal does not have to needlessly rebase his PR?

@marktnoonan
Copy link
Contributor

Hi @elevatebart , sorry for my delay here. I was referring to this:

That said, it looks to me like one of the problems reported in the issue has already been solved differently - the dropdown no longer has the weird centering/wrapping that was in that screenshot, it looks like this, which seems fine:

Screen Shot 2022-11-27 at 9 16 02 PM

I don't personally think we still need this ticket as I would prefer the full browser name to be shown, but I'll defer to you on the design.

There are two things:

  1. Truncate in Launchpad cards so they look the same size always
  2. Truncate in dropdown menu (this is the one where that bad centering is already fixed & it's just about menu width)

I suggest we leave the drop down alone since there is no bad overflow, and that we only truncate in the launchpad. If it turns out in the future we need the full browser name back, we can have it back easily.

@Manuel-Suarez-Abascal if you can modify this to only make the change in OpenBrowserList.vue I will approve. Although as Bart said we will need to make sure all commits are associated with your github user that signed the CLA: #24831 (comment). It appears you have 2 users.

If it's simpler feel free to make a fresh PR with your one-line change and tag me there.

@Manuel-Suarez-Abascal
Copy link
Contributor Author

Hi @elevatebart , sorry for my delay here. I was referring to this:

That said, it looks to me like one of the problems reported in the issue has already been solved differently - the dropdown no longer has the weird centering/wrapping that was in that screenshot, it looks like this, which seems fine:
Screen Shot 2022-11-27 at 9 16 02 PM

I don't personally think we still need this ticket as I would prefer the full browser name to be shown, but I'll defer to you on the design.

There are two things:

  1. Truncate in Launchpad cards so they look the same size always
  2. Truncate in dropdown menu (this is the one where that bad centering is already fixed & it's just about menu width)

I suggest we leave the drop down alone since there is no bad overflow, and that we only truncate in the launchpad. If it turns out in the future we need the full browser name back, we can have it back easily.

@Manuel-Suarez-Abascal if you can modify this to only make the change in OpenBrowserList.vue I will approve. Although as Bart said we will need to make sure all commits are associated with your github user that signed the CLA: #24831 (comment). It appears you have 2 users.

If it's simpler feel free to make a fresh PR with your one-line change and tag me there.

@marktnoonan I have addressed the PR comments. However, I am not sure how to fix the issue of the CLA signature. If I open another branch/PR I am sure I will have the same issue. I got another PR opened & it's the same 😞

@lmiller1990
Copy link
Contributor

Looks good, let me try kick off CI.

@Manuel-Suarez-Abascal
Copy link
Contributor Author

@lmiller1990 I have been trying to fix this, but I haven't been lucky. I will give it a shot in the next few days again.

@lmiller1990
Copy link
Contributor

lmiller1990 commented Dec 22, 2022

No problem. You should be able to revert and re-commit and force push, that should be enough to get the CLA to pass. Let me know if you need any more assistance.

@Manuel-Suarez-Abascal
Copy link
Contributor Author

No problem. You should be able to revert and re-commit and force push, that should be enough to get the CLA to pass. Let me know if you need any more assistance.

Sorry, guys. I am not able to fix it. I have spent more time trying to fix this CLA thingy than contributing to the code 🤣 if we cannot move forward with it. I might just close the PR & reopen another in the future. Let me know what's best.

@Manuel-Suarez-Abascal Manuel-Suarez-Abascal marked this pull request as draft December 23, 2022 20:50
@Manuel-Suarez-Abascal Manuel-Suarez-Abascal marked this pull request as ready for review December 23, 2022 20:50
@cypress
Copy link

cypress bot commented Dec 23, 2022



Test summary

26393 0 1179 0Flakiness 35


Run details

Project cypress
Status Passed
Commit 1531508
Started Dec 26, 2022 12:22 AM
Ended Dec 26, 2022 12:41 AM
Duration 19:02 💡
OS Linux Debian -
Browser Multiple

View run in Cypress Dashboard ➡️


Flakiness

create-from-component.cy.ts Flakiness
1 ... > runs generated spec
2 ... > runs generated spec
commands/net_stubbing.cy.ts Flakiness
1 network stubbing > intercepting request > can delay and throttle a StaticResponse
2 network stubbing > intercepting request > can delay and throttle a StaticResponse
3 network stubbing > intercepting request > can delay and throttle a StaticResponse
This comment includes only the first 5 flaky tests. See all 35 flaky tests in the Cypress Dashboard.

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

@lmiller1990
Copy link
Contributor

Hi @Manuel-Suarez-Abascal

I think this issue is the CLA is not signed for another account you have, or you committed without a git user set, or something to that meaning.

image

The easiest way to fix this would be

  1. checkout a new branch from cypress/develop
  2. apply your change (only 1 file)
  3. do a force push to your current branch

That'll wipe out all those old commits that haven't signed the CLA. Then we can merge this.

@Manuel-Suarez-Abascal
Copy link
Contributor Author

@lmiller1990 I have closed this PR & reopened another with the same changes to get rid of the CLA issue here. It seems it has solved the issue.

@Manuel-Suarez-Abascal
Copy link
Contributor Author

Manuel-Suarez-Abascal commented Dec 26, 2022

Closed in favor of: #25270

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.

Browser icons and longer names in the dropdown menu don't display correctly
8 participants