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

UI: Cell focus changed when removing ghost cells #316

Open
jlewi opened this issue Oct 21, 2024 · 1 comment
Open

UI: Cell focus changed when removing ghost cells #316

jlewi opened this issue Oct 21, 2024 · 1 comment
Labels

Comments

@jlewi
Copy link
Owner

jlewi commented Oct 21, 2024

I think when ghost cells are deleted it can affect the rendered view.

Here's what I think I'm observing.

Suppose you were editing cell K where K < N and N is the number of cells in the document.
So we generate ghost cells at position K+1 , K+2, ...
(I was testing with #285) which was generating multiple ghost cells.

I then started editing cell N+1.
I think what happens is that when we start editing cell N+1 we delete the current ghost cells (K+1, K+2, ...). This causes the cells to shift up to fill in the gaps. I think this causes problems. I think I observed the cell I was editing disappearing.
Even more confusing, since we are generating new ghost cells, N+2, N+3,... those ghost cells now appear. So to the user it looks like the cell they were editing was deleted and replaced with some ghost cells.

We should try to reproduce this in a more controlled way so we can reproduce it and test fixes.

Could we create a function to insert ghost cells at a particular location?

@jlewi jlewi added the ui label Oct 21, 2024
@jlewi
Copy link
Owner Author

jlewi commented Oct 22, 2024

I think another case where this happening is if you have an earlier cell running a long running commands (e.g. watching the logs). Everytime the cell output changes that will trigger ghost cell generation (at least it will with stateful/vscode-runme#1744). So if cell K is long running and you are working on cell N, then each time cell K's output changes we will create ghost cells K+1,...,K+j this could cause the cells to change which I think can move cell N up or down which I think could cause problems.

@jlewi jlewi added vscode and removed ui labels Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant