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

multiline warnings containing links are difficult to click due to resizing #51

Closed
braingram opened this issue Feb 16, 2023 · 4 comments · Fixed by #53
Closed

multiline warnings containing links are difficult to click due to resizing #51

braingram opened this issue Feb 16, 2023 · 4 comments · Fixed by #53

Comments

@braingram
Copy link
Contributor

The active resizing to allow for easier reading of asdf file contents limits interaction with links in warning block text.

div.admonition:active {

Perhaps a hover would allow for both uses but would require testing.

@WilliamJamieson
Copy link
Contributor

First, hover seems incompatible with how the directive generates the page. This necessitated the click to increase size fix. I also find hover changes to not work well on mobile devices.

I believe this issue is rooted in your comment here: asdf-format/asdf#1337 (comment). First note that sphinx structures things so that admonition is the parent of directives like warning and note, see https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html#directives for details. This means that click to resize for warning directives can be overridden by specifically changing the settings for warning.

Indeed, this is exactly how note is not resized, see:

div.note:active {
width: 100%
}
this can simply be extended to include warning.

As for the reason why it has to affect all admonition is because when you look at the directives that sphinx uses to write the parts of ASDF files, it does them in pure admonition directives. So I had to modify the CSS for that directly in order to make it work.

@WilliamJamieson
Copy link
Contributor

Note these changes were first developed as part of asdf-format/asdf#1142

@braingram
Copy link
Contributor Author

After looking at this a bit more my vote is for removal of custom.css unless there are other uses aside from the resizing.

The resizing also interferes with selecting content within blocks. As one example, for the external_array.asdf file here:
https://asdf.readthedocs.io/en/latest/asdf/features.html#array-references
selecting /asdf at the end of the following line is impossible:

asdf_library: !core/software-1.0.0 {author: The ASDF Developers, homepage: 'http://github.com/asdf-format/asdf',

Removing custom.css allows for normal use of the scroll bars in the blocks.

The resizing also does not consistently work on mobile and touches sometimes result in scrolling and other times result in resizing that resets the scrolling.

@WilliamJamieson
Copy link
Contributor

Then remove it.

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 a pull request may close this issue.

2 participants