windingwind / zotero-better-notes

Everything about note management. All in Zotero.
GNU Affero General Public License v3.0
5.21k stars 184 forks source link

[Bug] Note Workspace's Viewport loses track of the current focused line when getting resized #929

Closed ThachNgocTran closed 5 months ago

ThachNgocTran commented 5 months ago

Is there an existing issue for this?

Are you using the latest Zotero and the latest plugin?

Environment

Describe the bug

Intro

When I read to a certain line within Note Workspace, I move to another tab (PDF Viewer) to read, and from time to time, switching on/off the button:

button

When switching back to the Note Workspace, the lastly focused line is now out of sight (maybe above or under). This is troublesome because if the Note Workspace is long, it takes time to get back to the aforementioned line. I workarounded this issue by marking the line with additional characters, e.g. AAA, then I only need to Ctrl + F with the phrase to jump to the line.

We can also see this issue by just resizing the splitter in Note Workspace, as showed in the Reproducibility part.

I know when resizing, the Note Workspace's Viewport has to accommodate the new size changes, thus re-rendering itself. But it would be great if the resizing is done, without losing track of the current line.

Reproducibility

https://github.com/windingwind/zotero-better-notes/assets/9520123/766dedf4-c23b-4550-804b-31a08f53dc68

Acceptance Criteria

A fixed solution would look like: when resizing, one sees the scrollbar changes (bigger or smaller, up or down), but the currently focused line should not move out of the current Viewport.

https://github.com/windingwind/zotero-better-notes/assets/9520123/eda86c35-96ec-47ed-b5b0-5966a4d8c853

Debug Output

Debug Output when resizing the splitter (before this, cleared the Debug output).

Debug Output.zip

Anything else?

No response

windingwind commented 5 months ago

Thanks for the feedback. Sorry there will be no further updates to the Z6 version, but this is fixed in the latest Z7 beta release (1.1.4-beta.60)