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

Prevent ghost cells from changing cell focus #1827

Merged
merged 1 commit into from
Dec 2, 2024
Merged

Conversation

jlewi
Copy link
Contributor

@jlewi jlewi commented Nov 28, 2024

  • The bug is described in UI: Cell focus changed when removing ghost cells  jlewi/foyle#316

  • The problem was we weren't deleting the previous ghost cells until we were ready to insert the new ghost cells. When we deleted the ghost cells this could shift the current cells up. This could lead to the active cell shifting up and losing focus. This was very confusing. It felt like the ground was changing underneath you.

  • This PR fixes that by deleting the ghost cells from the current compeltion as soon as you change the cell focus to a new cell. Therefore by the time you start typing the previous ghost cells have already been removed.

  • I think this is a much better experience.

  • I think the original UX was motivated in part to give you time to look at the previous ghost cells while you are still typing. I also think it might have partially been for demo purposes to give you some ghost cells to continue to look at.

  • In practice, I find that if I don't select a ghost cell immediately after switching cell focus I never bother to look at it. So persisting the ghost cells after switching focus wasn't adding any value.

  • On the other hand, the cell losing focus was super frustrating.

  • Fix UI: Cell focus changed when removing ghost cells  jlewi/foyle#316

* The bug is described in jlewi/foyle#316
* The problem was we weren't deleting the previous ghost cells until we were ready to
  insert the new ghost cells. When we deleted the ghost cells this could shift
  the current cells up. This could lead to the active cell shifting up and losing
  focus. This was very confusing. It felt like the ground was changing underneath you.

* This PR fixes that by deleting the ghost cells from the current compeltion
  as soon as you change the cell focus to a new cell. Therefore by the time
  you start typing the previous ghost cells have already been removed.

* I think this is a much better experience.

* I think the original UX was motivated in part to give you time to look
  at the previous ghost cells while you are still typing. I also
  think it might have partially been for demo purposes to give you some
  ghost cells to continue to look at.

* In practice, I find that if I don't select a ghost cell immediately after
  switching cell focus I never bother to look at it. So persisting the ghost
  cells after switching focus wasn't adding any value.

* On the other hand, the cell losing focus was super frustrating.

* Fix jlewi/foyle#316
@jlewi
Copy link
Contributor Author

jlewi commented Nov 28, 2024

@sourishkrout This is ready for review.

@sourishkrout sourishkrout self-requested a review December 2, 2024 16:51
Copy link
Member

@sourishkrout sourishkrout left a comment

Choose a reason for hiding this comment

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

✅ LGTM.

@sourishkrout sourishkrout merged commit 9f68530 into main Dec 2, 2024
1 check passed
@sourishkrout sourishkrout deleted the jlewi/fixfocus branch December 2, 2024 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UI: Cell focus changed when removing ghost cells
2 participants