-
-
Notifications
You must be signed in to change notification settings - Fork 480
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
Right align sage/python tabs and alter vertical spacing #38568
Conversation
…bs so they don't run into each other
Here is an alternative suggestion (I don't know anything about web programming and only little about user interfaces, so feel free to ignore). Many web pages have a global language switch, often indicated by a flag of the corresponding country, in the top right (https://ux.stackexchange.com/questions/15041/placement-of-a-change-language-button) Since the code shown is also globally changed, maybe this would be a good approach. |
Well I thought about this idea when I made the original design, but there are several reasons why I decided to use tabs. The main one:
|
I recommend to merge #38468 so that the "Build documentation" workflow runs through |
Documentation preview for this PR (built with commit 66e01fa; changes) is ready! 🎉 |
Beautiful. Thanks @thecaligarmo for working on this! Note that in https://doc-release--sagemath.netlify.app/html/en/reference/tensor_free_modules/sage/tensor/modules/finite_rank_free_module we use a third tab "Sage Live", so more space will be needed |
Ok, so I changed a little bit how it works so that we can do variable widths depending on how many tabs there are. It should make it so it looks nice regardless of number of tabs. |
As seen above, I am not sure if this improves the situation. For the three tabs, the tab labels will create even more space to the right. i doubt that moving tab labels to the right would only improve the situation. It creates other problem. What do we want to solve? Perhaps we want to move the tab labels completely out of sight. If not completely, then we may just shrink the spaces that the tab labels occupy (without the "kerning"). Or there may be other creative solutions. I am not sure what would be the best solution at the moment... |
I think, personally, I would generally prefer the tabs on the left. By putting it to the right it obfuscates it a little and it's harder to know they're tabs to begin with. The documentation is a little bulkier with the tabs on the left, but it makes it nicer from a UX perspective. We can shrink the gap between the tabs and the previous sentence to make it a little smaller, but I don't think it's that big of an issue? An alternative design would be to put the tabs completely to the left of the code boxes. The problem with that would be that we have less room for the code boxes. This theoretically shouldn't be an issue as code length should be less than 80 chars, but that's not always the case. |
I add that psychologically we don't skip the tab labels on the right, we tend to look at them, scanning all the way to the right. |
I think adding a bit of vertical spacing above the tabs might eliminate this effect. |
I also prefer the tabs on the left. I don't see much difference with the spacing tweaks to the labels. |
How about dimming the labels (the last screenshot above)? No much difference? |
Good for me. Thanks. |
Yes, in isolation. But we see too many of them (tabbed examples). I prefer just highlighting the underline (bottom border line). We may choose one if the author, hopefully, prepares a few design candidates :-) |
Thanks for the work! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
Sounds good. I'll update the code to reflect the chosen design and push when it's ready (hopefully in the next day or two). I'll update the ticket when the design is updated |
I thought the PR branch is already for (AL). No? |
Anyway I will remove the label to give you enough time to update the code. |
No, it's currently still on the right hand side. I stopped editing it while we were voting on it. It shouldn't take to long to do, but I'm away from my computer until Thursday night/Friday, so it should be finished by the end of this week. |
The doc preview shows the tabs on the left... |
Yes. For the previews I made local changes that didn't affect the branch itself. This was done because there were many options and it didn't seem viable (and would be a waste of time) to make a commit for every single option. So none of those are in the branch. |
I meant #38568 (comment). Anyway, take your time. |
@kwankyu Ah ok! I had missed my comment that I had actually updated my branch to include (AL), so I was wrong. Sorry about that. The thing that I hadn't finished doing was cleaning up the code of unnecessary things. I've gone ahead and done that and it should now be ready. |
Otherwise lgtm. |
…cing <!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes sagemath#12345". --> Fixes sagemath#37760 The css will push the tabs all the way to the right and alter the vertical spacing so that they are more "in-line". The vertical spacing causes some issues as sometimes the text from the previous line will run into the tabs. To fix this, the previous line now has a `max-width` of `80%` so that they won't overlap. This also makes it so that the `EXAMPLES:` line is on the same line as tabs. (As far as I could tell, there was no way to distinguish the `EXAMPLES:` text from other text). A good page to see the changes is on: `en/reference/rings_standard/sage/rings/integer_ring.html` as it contains various different formats for sage/python examples. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [x] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> - Depends on sagemath#38468 (merged here) URL: sagemath#38568 Reported by: Aram Dermenjian Reviewer(s): Andrew Mathas, Aram Dermenjian, Kwankyu Lee, Matthias Köppe
…cing <!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes sagemath#12345". --> Fixes sagemath#37760 The css will push the tabs all the way to the right and alter the vertical spacing so that they are more "in-line". The vertical spacing causes some issues as sometimes the text from the previous line will run into the tabs. To fix this, the previous line now has a `max-width` of `80%` so that they won't overlap. This also makes it so that the `EXAMPLES:` line is on the same line as tabs. (As far as I could tell, there was no way to distinguish the `EXAMPLES:` text from other text). A good page to see the changes is on: `en/reference/rings_standard/sage/rings/integer_ring.html` as it contains various different formats for sage/python examples. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [x] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> - Depends on sagemath#38468 (merged here) URL: sagemath#38568 Reported by: Aram Dermenjian Reviewer(s): Andrew Mathas, Aram Dermenjian, Kwankyu Lee, Matthias Köppe
…cing <!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes sagemath#12345". --> Fixes sagemath#37760 The css will push the tabs all the way to the right and alter the vertical spacing so that they are more "in-line". The vertical spacing causes some issues as sometimes the text from the previous line will run into the tabs. To fix this, the previous line now has a `max-width` of `80%` so that they won't overlap. This also makes it so that the `EXAMPLES:` line is on the same line as tabs. (As far as I could tell, there was no way to distinguish the `EXAMPLES:` text from other text). A good page to see the changes is on: `en/reference/rings_standard/sage/rings/integer_ring.html` as it contains various different formats for sage/python examples. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [x] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> - Depends on sagemath#38468 (merged here) URL: sagemath#38568 Reported by: Aram Dermenjian Reviewer(s): Andrew Mathas, Aram Dermenjian, Kwankyu Lee, Matthias Köppe
…cing <!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes sagemath#12345". --> Fixes sagemath#37760 The css will push the tabs all the way to the right and alter the vertical spacing so that they are more "in-line". The vertical spacing causes some issues as sometimes the text from the previous line will run into the tabs. To fix this, the previous line now has a `max-width` of `80%` so that they won't overlap. This also makes it so that the `EXAMPLES:` line is on the same line as tabs. (As far as I could tell, there was no way to distinguish the `EXAMPLES:` text from other text). A good page to see the changes is on: `en/reference/rings_standard/sage/rings/integer_ring.html` as it contains various different formats for sage/python examples. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [x] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> - Depends on sagemath#38468 (merged here) URL: sagemath#38568 Reported by: Aram Dermenjian Reviewer(s): Andrew Mathas, Aram Dermenjian, Kwankyu Lee, Matthias Köppe
Fixes #37760
The css will push the tabs all the way to the right and alter the vertical spacing so that they are more "in-line". The vertical spacing causes some issues as sometimes the text from the previous line will run into the tabs. To fix this, the previous line now has a
max-width
of80%
so that they won't overlap. This also makes it so that theEXAMPLES:
line is on the same line as tabs. (As far as I could tell, there was no way to distinguish theEXAMPLES:
text from other text).A good page to see the changes is on:
en/reference/rings_standard/sage/rings/integer_ring.html
as it contains various different formats for sage/python examples.
📝 Checklist
⌛ Dependencies