Skip to content

adjust focused cell anchor behavior when resizing cells - #195309

Merged
Aaron Munger (amunger) merged 2 commits into
mainfrom
aamunger/cellAnchor
Oct 10, 2023
Merged

Aaron Munger (amunger) merged 2 commits into
mainfrom
aamunger/cellAnchor

Conversation

@amunger

Copy link
Copy Markdown
Collaborator

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
Aaron Munger (amunger) merged commit 257d2bf into main Oct 10, 2023
@amunger
Aaron Munger (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
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Aaron Munger (@amunger) should we check focus other than focused: number[]?

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