Skip to content

Conversation

@jakubbortlik
Copy link
Collaborator

This PR improves the user experience in the discussion tree by restoring cursor position after rebuilding the tree. This makes navigation in the discussion tree more fluent without the cursor jumping to the first line of the tree after actions like resolving discussions, adding new comments, publishing drafts etc.

@jakubbortlik jakubbortlik changed the title Fix: Restore cursor position after rebuilding view Fix: Restore cursor position after rebuilding discussion tree Oct 15, 2024
@jakubbortlik jakubbortlik changed the title Fix: Restore cursor position after rebuilding discussion tree draft: Fix: Restore cursor position after rebuilding discussion tree Oct 17, 2024
@jakubbortlik
Copy link
Collaborator Author

I've marked this a draft because I've found a bug that this PR introduces. When data are refreshed while the discussion tree is closed, there is an error when trying to reopen the discussion tree again. I'm working on a fix.

@jakubbortlik jakubbortlik changed the title draft: Fix: Restore cursor position after rebuilding discussion tree draft: Oct 18, 2024
@jakubbortlik
Copy link
Collaborator Author

I've now fixed the code so that it works correctly for both discussion trees even if the cursor is outside of the discussion tree.

There are some problems with test (Failed to install LuaRocks) that I don't think I can do anything about and would appreciate if you @harrisoncramer could fix if you find this PR useful.

@jakubbortlik jakubbortlik changed the title draft: Fix: Restore cursor when updating from outside of tree Oct 18, 2024
The first branch of the `if is_draft then` block was never entered because it was inside an
`if ... and not is_draft then` block.
This improves user experience by making the cursor position more predictable when modifying the
discussions.
@jakubbortlik jakubbortlik force-pushed the fix-restore-cursor-position-after-rebuilding-view branch from 532db9d to 6b53db4 Compare October 29, 2024 08:18
@harrisoncramer harrisoncramer merged commit 5f657fd into harrisoncramer:develop Nov 5, 2024
6 checks passed
@harrisoncramer harrisoncramer mentioned this pull request Nov 5, 2024
harrisoncramer added a commit that referenced this pull request Nov 5, 2024
fix: parse dates without timezone offset (#404)
fix: enable replying if tree is in a different tab (#407)
fix: wrong get url (#413)
fix: Restore cursor when updating from outside of tree (#406) 

---------

Co-authored-by: Jakub F. Bortlík <jakub.bortlik@proton.me>
Co-authored-by: Oscar <oscar.creator13@gmail.com>
@jakubbortlik jakubbortlik deleted the fix-restore-cursor-position-after-rebuilding-view branch November 5, 2024 08:31
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.

2 participants