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

[UI?][i18n] Enable horizontal scroll for code blocks on PyPI #12529

Closed
webknjaz opened this issue Nov 11, 2022 · 1 comment · Fixed by #12531
Closed

[UI?][i18n] Enable horizontal scroll for code blocks on PyPI #12529

webknjaz opened this issue Nov 11, 2022 · 1 comment · Fixed by #12531
Labels
bug 🐛 CSS/SCSS requires change to CSS/SCSS files UX/UI design, user experience, user interface

Comments

@webknjaz
Copy link
Member

Describe the bug

I noticed that the monotype text in a .pypirc example overflows the right border.
I suppose it's because the translation string is longer than the original English one.
The problem of text not fitting in the UI is common

Expected behavior

I think that a horizontal scroll bar appearing in such code blocks would handle this case very well. The translators aren't immediately exposed to where and how the translation strings will be rendered. So it is unlikely for this to be fixed during the translation-time, only post-merge/build/deploy.

To Reproduce

It's on https://pypi.org/manage/account/token/.

My Platform

N/A

Additional context

i18n-code-block-needs-scroll

@webknjaz webknjaz added requires triaging maintainers need to do initial inspection of issue bug 🐛 labels Nov 11, 2022
@miketheman miketheman added UX/UI design, user experience, user interface CSS/SCSS requires change to CSS/SCSS files and removed requires triaging maintainers need to do initial inspection of issue labels Nov 11, 2022
@miketheman
Copy link
Member

The problem manifests in English as well:

Screen Shot 2022-11-11 at 9 09 41 AM

The content is located in this template:

<pre class="code-block">
[distutils]
index-servers =
{{ site }}
PROJECT_NAME
[{{ site }}]
username = __token__
password = # {% trans %}either a user-scoped token or a project-scoped token you want to set as the default{% endtrans %}
[PROJECT_NAME]
repository = {{ upload_url }}
username = __token__
password = # {% trans %}a project token{% endtrans %} </pre>

The width of the overall content column is set in SCSS:

.tabs-container {
@include site-container;

$site-container: 1150px;

I don't think it's likely to change the global width setting to accommodate this. Rather, it's more likely to explore adding the horizontal scroll to the specific code block SCSS https://github.com/pypi/warehouse/blob/1387d3a1212cb56feb114611cf44739f63707eb2/warehouse/static/sass/blocks/_code-block.scss

miketheman added a commit to miketheman/warehouse that referenced this issue Nov 11, 2022
Use same `pverflow-x` behavior we have in `project-description`.

`code-block` classes are only used in the `token.html` template today.

Fixes pypi#12529

Signed-off-by: Mike Fiedler <[email protected]>
@di di closed this as completed in #12531 Nov 11, 2022
di pushed a commit that referenced this issue Nov 11, 2022
Use same `pverflow-x` behavior we have in `project-description`.

`code-block` classes are only used in the `token.html` template today.

Fixes #12529

Signed-off-by: Mike Fiedler <[email protected]>

Signed-off-by: Mike Fiedler <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 CSS/SCSS requires change to CSS/SCSS files UX/UI design, user experience, user interface
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants