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

Add scroll margin to headings for better alignment #15703

Merged
merged 3 commits into from Jan 29, 2024

Conversation

krassowski
Copy link
Member

References

Fixes #15670

Code changes

Fixes a regression caught by visual tests in which after scrolling to a heading, the target heading was too close to the edge of the notebook (with no margin, and with the cell toolbar buttons cut off).

This regression was a result of a security-related PR fixing the ToC implementation, which meant that the fallback code path which was giving us extra padding was no longer used, see #15670 (comment) for details.

User-facing changes

The cell toolbar buttons are fully available after scrolling to a heading; the heading is easier to read as there is more margin.

Before security fix After security fix This PR
image image image

Backwards-incompatible changes

None

@krassowski krassowski added the bug label Jan 27, 2024
@krassowski krassowski added this to the 4.1.0 milestone Jan 27, 2024
Copy link

Thanks for making a pull request to jupyterlab!
To try out this branch on binder, follow this link: Binder

@github-actions github-actions bot added pkg:rendermime tag:Testing tag:CSS For general CSS related issues and pecadilloes Design System CSS labels Jan 27, 2024
@krassowski krassowski modified the milestones: 4.1.0, 4.0.x Jan 27, 2024
@krassowski
Copy link
Member Author

krassowski commented Jan 27, 2024

This needs to be backported to 4.0.x but without the test case because we kept the old behaviour of scrolling to the bottom of the cell in the 4.0.x backport of #15386 (so the tests are not failing on 4.0.x but users who toggle the setting on scroll behaviour would still see buttons being cut-off).

which solved a problem with background of disabled buttons
@krassowski
Copy link
Member Author

CI is so green again 💚

Copy link
Contributor

@JasonWeill JasonWeill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change looks good, verified behavior in Chrome and Firefox ESR on macOS.

@krassowski krassowski merged commit 728c2b3 into jupyterlab:main Jan 29, 2024
77 checks passed
@krassowski
Copy link
Member Author

@meeseeksdev please backport to 4.0.x

Copy link

lumberbot-app bot commented Jan 29, 2024

Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

  1. Checkout backport branch and update it.
git checkout 4.0.x
git pull
  1. Cherry pick the first parent branch of the this PR on top of the older branch:
git cherry-pick -x -m1 728c2b3ba948336972e401318651d9d0c3b87502
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
git commit -am 'Backport PR #15703: Add scroll margin to headings for better alignment'
  1. Push to a named branch:
git push YOURFORK 4.0.x:auto-backport-of-pr-15703-on-4.0.x
  1. Create a PR against branch 4.0.x, I would have named this PR:

"Backport PR #15703 on branch 4.0.x (Add scroll margin to headings for better alignment)"

And apply the correct labels and milestones.

Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon!

Remember to remove the Still Needs Manual Backport label once the PR gets merged.

If these instructions are inaccurate, feel free to suggest an improvement.

krassowski added a commit to krassowski/jupyterlab that referenced this pull request Jan 29, 2024
krassowski added a commit that referenced this pull request Jan 30, 2024
… better alignment) (#15711)

* Backport PR #15703: Add scroll margin to headings for better alignment

* Update snapshot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Design System CSS pkg:rendermime tag:CSS For general CSS related issues and pecadilloes tag:Testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Notebook scrolls to heading" test fails subtly
2 participants