KEMBAR78
adjust focused cell anchor behavior when resizing cells by amunger · Pull Request #195309 · microsoft/vscode · GitHub
Skip to content

Conversation

@amunger
Copy link
Collaborator

@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
@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