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

Code block annotations are misaligned on mobile #2475

Closed
5 tasks done
Andre601 opened this issue Mar 20, 2021 · 4 comments
Closed
5 tasks done

Code block annotations are misaligned on mobile #2475

Andre601 opened this issue Mar 20, 2021 · 4 comments
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open

Comments

@Andre601
Copy link
Contributor

I've found a bug and checked that ...

  • ... the problem doesn't occur with the default MkDocs template
  • ... the problem is not in any of my customizations (CSS, JS, template)
  • ... the documentation does not mention anything about my problem
  • ... there are no open or closed issues that are related to my problem

Description

The examples about code block annotations on the material insider page is misaligned (see image).

SmartSelect_20210320-072440_Chrome.jpg

Expected behavior

Text should be aligned properly.

Actual behavior

The text shows up on the right cut off

Steps to reproduce the bug

  1. Go to https://squidfunk.github.io/mkdocs-material-insiders/reference/code-blocks/#adding-annotations
  2. Tab on one of the annotations
  3. See issue

Package versions

Since this happens on the live version of the insiders example can I not provide the info.

  • Python: python --version
  • MkDocs: mkdocs --version
  • Material: pip show mkdocs-material | grep -E ^Version

Project configuration

The contents of your mkdocs.yml

System information

  • OS: Android 10
  • Browser: Google Chrome
@squidfunk
Copy link
Owner

squidfunk commented Mar 20, 2021

Thanks for reporting! There're still some issues to work out in regards to sizing and alignment on mobile, that's correct. This is why the feature is still considered experimental. It already works very well in many circumstances, but as always, there are some edge cases to consider. The currently known bugs are:

  1. Annotations may sometimes run out-of-screen on mobile (this is the issue reported in the OP)
  2. Annotations may be rendered too narrow
  3. When scrolling a code block, annotations stay in place and don't follow

I've already implemented an alignment logic, but it seems to still suffer from some issues. Nothing that isn't fixable, but it definitely needs some work on mobile. I'm actually working on a general tooltip alignment solution because I want to expand those annotations/tooltips beyond code blocks, to be peaceable anywhere inside body copy.

Screenshots for issue 2 and 3:

Bildschirmfoto 2021-03-20 um 09 58 14

Bildschirmfoto 2021-03-20 um 09 58 21

@squidfunk squidfunk added the bug Issue reports a bug label Mar 20, 2021
@jj-jitterbit
Copy link

In this file
https://github.com/squidfunk/mkdocs-material-insiders/blob/master/docs/reference/code-blocks.md
there is a typo:

2. Annotations can be __placed anywhere__ in a code block were a comment for the
   underlying language can be placed. 

should be "where a comment":

2. Annotations can be __placed anywhere__ in a code block where a comment for the
   underlying language can be placed. 

@squidfunk
Copy link
Owner

I've finally tackled the reported issues with code annotations – they now work quite well on mobile:

Ohne.Titel.mp4

The fixes were just released as part of 8.0.0b2. See #3219 for update instructions.

@squidfunk squidfunk added the resolved Issue is resolved, yet unreleased if open label Nov 21, 2021
@squidfunk
Copy link
Owner

The fix is now in master and will be released shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open
Projects
None yet
Development

No branches or pull requests

3 participants