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

adjust focused cell anchor behavior when resizing cells #195309

Merged
merged 2 commits into from
Oct 10, 2023
Merged

Conversation

amunger
Copy link
Contributor

@amunger amunger commented Oct 10, 2023

fix #194516

#195283 reduced the amount of resizing that cells do, so this PR attempts to make the auto setting for anchoring the focused cell work more smoothly.

Basically, anchor to the focused cell if

  • the cell editor is focused (User is editing the code, so it should stay steady)
  • the cell is growing (prevent the focused cell from being pushed out of view) unless the user set the notebook to not scroll on execute

Shrinking an output is less common since an output won't be resized as the cell is executing, so issues like #193835 shouldn't occur anymore

@amunger amunger requested review from rebornix and removed request for rebornix October 10, 2023 22:26
@vscodenpa vscodenpa added this to the October 2023 milestone Oct 10, 2023
@amunger amunger merged commit 257d2bf into main Oct 10, 2023
7 checks passed
@amunger amunger deleted the aamunger/cellAnchor branch October 10, 2023 23:26
if (focused && (anchorFocusedSetting === 'on' || scrollHeuristic)) {
this.view.updateElementHeight(index, size, focus);
// If the cell is growing, we should favor anchoring to the focused cell
if (focused) {
Copy link
Member

Choose a reason for hiding this comment

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

@amunger should we check focus other than focused: number[]?

@github-actions github-actions bot locked and limited conversation to collaborators Nov 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

More notebook scroll on execute polish
4 participants