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

Learning activity bar truncation and alignment fixes #8747

Merged

Conversation

MisRob
Copy link
Member

@MisRob MisRob commented Nov 19, 2021

Summary

Fixes a couple of truncation and alignment problems in the learning activity bar.

(1) Replaces TextTruncator with TextTruncatorCss on this opportunity to avoid investigating issues in the environment using a component that may soon be obsolete as we agreed to move towards TextTruncatorCss everywhere.
(2) Fixes ellipsis not being applied when it should and being applied when it shouldn't. Some issues occurred in all browsers, some were IE specific. See commit messages and code comments for details.
(3) Fixes an issue with overflowing controls on the right side of the bar when a resource title is very long:

rect122-3-7

References

Fixes #8678

Reviewer guidance

Peek 2021-11-19 11-11

In all browsers

  • all icons, buttons, and a resource title are aligned properly
  • a resource title truncation works well

Please double-check in Internet Explorer. Note that some icons may not be visible all the time, e.g. the progress and completion icons become visible only after a resource has been started.


Testing checklist

  • Contributor has fully tested the PR manually
  • If there are any front-end changes, before/after screenshots are included
  • Critical user journeys are covered by Gherkin stories
  • Critical and brittle code paths are covered by unit tests

PR process

  • PR has the correct target branch and milestone
  • PR has 'needs review' or 'work-in-progress' label
  • If PR is ready for review, a reviewer has been added. (Don't use 'Assignees')
  • If this is an important user-facing change, PR or related issue has a 'changelog' label
  • If this includes an internal dependency change, a link to the diff is provided

Reviewer checklist

  • Automated test coverage is satisfactory
  • PR is fully functional
  • PR has been tested for accessibility regressions
  • External dependency files were updated if necessary (yarn and pip)
  • Documentation is updated
  • Contributor is in AUTHORS.md

to make it cooperate with truncation via text ellipsis
The text truncator component is sometimes used in <span>s
and it's not valid to have block elements inside of inline elements.
`KLabeledIcon`s calculation of label's max-width
seems to be the main cause of the resource title being
truncated all the time in Internet Explorer 11 (reported
as part of learningequality#8678)
`width: auto` was breaking the title truncation
in Internet Explorer 11 since with this width settings
the title was overflowing the container even when it should
already be truncated and ellipsis was never displayed.

It seems that the main reason of using `width: auto`
was displaying the progress icon right to the title
without any gap in between. For that purpose using
`flex-grow: 0` works too and it doesn't break truncation
in IE.
Fixes an issue when controls were displayed
outside of the toolbar when a resource had
a very long title
@MisRob MisRob added this to the 0.15.0 milestone Nov 19, 2021
@MisRob MisRob requested a review from nucleogenesis November 19, 2021 10:13
@radinamatic
Copy link
Member

Truncation of long titles is looking much better! 👍🏽

FF Chrome IE11
ff chrome2 ie11

Copy link
Member

@radinamatic radinamatic left a comment

Choose a reason for hiding this comment

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

Tested also on Firefox and Chrome clients on Android 9, looking great! Thank you 🙂

Copy link
Member

@rtibbles rtibbles left a comment

Choose a reason for hiding this comment

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

Code changes make sense to me, and the cross browser experience looks solid!

@rtibbles rtibbles merged commit 6342e4d into learningequality:release-v0.15.x Nov 19, 2021
@MisRob MisRob deleted the bar-title-truncation-fix branch December 1, 2021 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IE11 - Truncated and misaligned resource title
3 participants