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

Transcription and translation alignment fails at non-100% zoom levels #1680

Open
4 tasks
blms opened this issue Nov 21, 2024 · 0 comments
Open
4 tasks

Transcription and translation alignment fails at non-100% zoom levels #1680

blms opened this issue Nov 21, 2024 · 0 comments
Assignees
Labels
🐛 bug Something isn't working performant Tasks for or taken on by Performant

Comments

@blms
Copy link
Contributor

blms commented Nov 21, 2024

Testing notes (QA)

On the QA public site:

  • Bump your browser zoom up a notch or two past 100%. (Usually cmd +, or ctrl + on Windows.) Navigate to some document detail pages with both transcriptions and translations. They should be aligned correctly.
  • Try the same with browser zoomed out lower than 100%. Again, they should be aligned correctly.
  • Note that behavior is a little different if you zoom before navigating to the doc detail page, as opposed to zooming when you're already on the page. Both should work correctly.
  • This should work in all three major browsers: Chrome, Safari, and Firefox.

When a document detail page with both a transcription and translation is first loaded, if the browser's zoom is not 100%, this will happen:

image

We've encountered this in the past, and the solution was just to set your browser to 100%, but it makes sense to have this open as a bug since it should not behave this way.

The solution probably lies somewhere in this calculation:

getLineCount(el) {
// determine the number of lines by dividing element's rendered height
// by its computed line height from CSS, and applying a floor function
return Math.floor(
el.getBoundingClientRect().height /
parseInt(getComputedStyle(el).getPropertyValue("line-height"))
);
}

@blms blms added the 🐛 bug Something isn't working label Nov 21, 2024
@blms blms self-assigned this Feb 11, 2025
@blms blms added the performant Tasks for or taken on by Performant label Feb 11, 2025
blms added a commit that referenced this issue Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working performant Tasks for or taken on by Performant
Projects
None yet
Development

No branches or pull requests

1 participant