Stylus Integration Feedback: Handwriting Optimization and Feature Enhancement Requests #4

Closed
opened 2025-04-03 11:48:50 +00:00 by wenbocn · 22 comments

Thank you sincerely for developing this long-anticipated plugin that finally enables a natural stylus writing experience in SiYuan Note. The current configuration using Polyline pen type with Stabilization activated produces impressively fluid and natural-looking strokes, though I did observe a slight processing delay during rapid writing motions. It would be fantastic if future optimizations could refine this responsiveness while maintaining the excellent stroke quality.

I've observed that previously saved content currently can't be reopened for editing properly, which might indicate a potential technical hiccup in the current implementation. This functionality would be particularly crucial for note revisions. Additionally, implementing an auto-save feature before document closure or application termination could serve as an effective safeguard against accidental data loss - a preventative measure many users would find invaluable.

This plugin already demonstrates brilliant functionality that significantly enhances SiYuan's capabilities. Your dedication to creating such practical innovation is truly admirable. I'm excited to witness how this tool evolves through future updates. Keep up the outstanding work!

Thank you sincerely for developing this long-anticipated plugin that finally enables a natural stylus writing experience in SiYuan Note. The current configuration using Polyline pen type with Stabilization activated produces impressively fluid and natural-looking strokes, though I did observe a slight processing delay during rapid writing motions. It would be fantastic if future optimizations could refine this responsiveness while maintaining the excellent stroke quality. I've observed that previously saved content currently can't be reopened for editing properly, which might indicate a potential technical hiccup in the current implementation. This functionality would be particularly crucial for note revisions. Additionally, implementing an auto-save feature before document closure or application termination could serve as an effective safeguard against accidental data loss - a preventative measure many users would find invaluable. This plugin already demonstrates brilliant functionality that significantly enhances SiYuan's capabilities. Your dedication to creating such practical innovation is truly admirable. I'm excited to witness how this tool evolves through future updates. Keep up the outstanding work!
Author

While I may not have technical programming expertise, I'd be delighted to assist with Chinese localization efforts, including terminology verification and contextual adaptation of interface elements if such collaboration opportunities arise.

While I may not have technical programming expertise, I'd be delighted to assist with Chinese localization efforts, including terminology verification and contextual adaptation of interface elements if such collaboration opportunities arise.
Owner

Hello, thanks for the feedback!

Editing previously saved content should already work, and works fine on my machines and test installations. Can you please clarify:

  • Have you installed the plugin from the marketplace? Or have you built it yourself from source?
  • In order to open a saved drawing, you should go to the block in your document that contains it, and click anywhere on your drawing. For example, place your mouse as such, and left-click.
    image
    Can you confirm you're following this procedure?
  • Describe in detail what you mean by "can't be reopened for editing properly".
    • Does the tab for the editor open?
    • Is the editor empty?

I will surely be working on auto-saving features. Although they are not currently part of any Project, I will add them eventually.

As far as performance optimizations are concerned, I'm afraid I can't help much. The stroke smoothing function requires a slight delay to properly work. If you have any more questions or proposals regarding stroke smoothing, I recommend you check out the upstream project for the editor, js-draw.

Last but not least: thanks for your offer to help with the internationalization of the plugin. I am still working on the core features—there's a big change coming that will make the plugin work in a much more integrated way—once that's done, I will shift the focus to that, and I'll surely ask for your input.

Thanks again.

Hello, thanks for the feedback! Editing previously saved content should already work, and works fine on my machines and test installations. Can you please clarify: - Have you installed the plugin from the marketplace? Or have you built it yourself from source? - In order to open a saved drawing, you should go to the block in your document that contains it, and click anywhere on your drawing. For example, place your mouse as such, and left-click. ![image](/attachments/229b52b8-91d3-4dcd-88aa-5ddad5b365f9) Can you confirm you're following this procedure? - Describe in detail what you mean by "can't be reopened for editing properly". - Does the tab for the editor open? - Is the editor empty? I will surely be working on auto-saving features. Although they are not currently part of any Project, I will add them eventually. As far as performance optimizations are concerned, I'm afraid I can't help much. The stroke smoothing function requires a slight delay to properly work. If you have any more questions or proposals regarding stroke smoothing, I recommend you check out the upstream project for the editor, [js-draw](https://github.com/personalizedrefrigerator/js-draw). Last but not least: thanks for your offer to help with the internationalization of the plugin. I am still working on the core features—there's a big change coming that will make the plugin work in a much more integrated way—once that's done, I will shift the focus to that, and I'll surely ask for your input. Thanks again.
Author

Thank you for your prompt response. After upgrading Siyuan Note from version 3.1.24 to 3.1.26, your plugin now functions properly with full compatibility. In the updated version (3.1.26), clicking saved sketches successfully opens them in new browser tabs within Siyuan Note as intended. However, I can confirm that in the previous version (3.1.24), the plugin remained unresponsive when attempting to access stored drawings.
This is truly an outstanding plugin that adds substantial value to the Siyuan ecosystem - excellent work!

Thank you for your prompt response. After upgrading Siyuan Note from version 3.1.24 to 3.1.26, your plugin now functions properly with full compatibility. In the updated version (3.1.26), clicking saved sketches successfully opens them in new browser tabs within Siyuan Note as intended. However, I can confirm that in the previous version (3.1.24), the plugin remained unresponsive when attempting to access stored drawings. This is truly an outstanding plugin that adds substantial value to the Siyuan ecosystem - excellent work!
Owner

Thanks! I will set the minimum app version in the next release to the correct one. Your input has been very valuable. I will contact you as soon as I start working on the internationalization.

Thanks! I will set the minimum app version in the next release to the correct one. Your input has been very valuable. I will contact you as soon as I start working on the internationalization.
Author

Here’s another issue to report: The plugin works fine for creating handwritten files on Huawei tablets (Android OS), but as mentioned earlier, saved files can’t be reopened by tapping with a finger or stylus. Could you check if this is just happening on my device or if it’s a wider issue?

I’d love to help with the Chinese translation of this plugin—feel free to reach out if you need assistance!

Here’s another issue to report: The plugin works fine for creating handwritten files on Huawei tablets (Android OS), but as mentioned earlier, saved files can’t be reopened by tapping with a finger or stylus. Could you check if this is just happening on my device or if it’s a wider issue? I’d love to help with the Chinese translation of this plugin—feel free to reach out if you need assistance!
Author

When using the URL obtained via "Copy Directly Edit Link" and pasting it as a hyperlink in SiYuan Note, the link works fine on PC but causes the Android tablet screen to go black upon clicking. The device becomes unresponsive, preventing any further actions (including returning to the previous screen).
@massivebox

When using the URL obtained via "Copy Directly Edit Link" and pasting it as a hyperlink in SiYuan Note, the link works fine on PC but causes the Android tablet screen to go black upon clicking. The device becomes unresponsive, preventing any further actions (including returning to the previous screen). @massivebox
wenbocn reopened this issue 2025-04-03 15:59:16 +00:00
Author

I reopened this issue because I need your help with another problem regarding the plugin's Android functionality. Thank you!
@massivebox

I reopened this issue because I need your help with another problem regarding the plugin's Android functionality. Thank you! @massivebox
Owner

Okay, thanks again for the feedback. Can you confirm the tablet is on the latest version of the SiYuan app as well?
My current testing routine doesn't involve checks on Android, but I will surely introduce them.

Okay, thanks again for the feedback. Can you confirm the tablet is on the latest version of the SiYuan app as well? My current testing routine doesn't involve checks on Android, but I will surely introduce them.
Author

Yes, the Android version of SiYuan Note is up-to-date (v3.1.26). However, when tapping on images with either fingers or a stylus, they only show a border outline without any further response—no new tabs open or additional actions occur.
@massivebox

Yes, the Android version of SiYuan Note is up-to-date (v3.1.26). However, when tapping on images with either fingers or a stylus, they only show a border outline without any further response—no new tabs open or additional actions occur. @massivebox
Owner

Thanks, I will verify ASAP and look for a fix.

By my first assessment, it looks like the API I'm using to edit the editor tab doesn't exist on mobile, as documented here, so I'll try to implement the alternative.

Thanks, I will verify ASAP and look for a fix. By my first assessment, it looks like the API I'm using to edit the editor tab doesn't exist on mobile, as documented [here](https://liuyun.io/article/1724560411861#Opening-a-Document-Page), so I'll try to implement the alternative.
Owner

Here's a quick update @wenbocn:
I have found a way to open the editor on mobile as well—and on tablets too, but that comes free with this new feature 8d1438de33—it has been added with the commit e165c69664.

However, by testing the plugin on mobile and tablet as well, I have found that the asset sync behavior is more inconsistent than I thought. Although I am using the APIs correctly, I find it that most of the times, if an image is edited on a device it won't be reflected on the other.

This is a serious issue, but I have already thought of a fix: it involves saving the image as a new file each time, deleting the old one, then editing the document to change all the references to the new link. This should theoretically force SiYuan to push the updated drawing on sync after every edit.

The framework for this implementation is roughly already there, since I already have some features for editing the document (for anti-cache purposes), but it still needs some work.
I will try to have this implemented and a new release published on the Marketplace before Monday.

Here's a quick update @wenbocn: I have found a way to open the editor on mobile as well—and on tablets too, but that comes free with this new feature https://git.massive.box/massivebox/siyuan-jsdraw-plugin/commit/8d1438de331a78519686ed53bceb30001000c8c7—it has been added with the commit https://git.massive.box/massivebox/siyuan-jsdraw-plugin/commit/e165c696643fbba38dacde48881abdd27271dc7b. However, by testing the plugin on mobile and tablet as well, I have found that the asset sync behavior is more inconsistent than I thought. Although I am using the APIs correctly, I find it that most of the times, if an image is edited on a device it won't be reflected on the other. This is a serious issue, but I have already thought of a fix: it involves saving the image as a new file each time, deleting the old one, then editing the document to change all the references to the new link. This should theoretically force SiYuan to push the updated drawing on sync after every edit. The framework for this implementation is roughly already there, since I already have some features for editing the document (for anti-cache purposes), but it still needs some work. I will try to have this implemented and a new release published on the Marketplace before Monday.
Author

I gave it a try and confirmed that the old version does have synchronization issues after edits.
Thanks for your hard work.
Looking forward to the updated plugin!

I gave it a try and confirmed that the old version does have synchronization issues after edits. Thanks for your hard work. Looking forward to the updated plugin!
Owner

@wenbocn The updates have been pushed to the release v0.2.0. The new version should be available in the Marketplace within an hour, please let me know if other errors occur when you test it, even though everything should be working.

@wenbocn The updates have been pushed to the release [v0.2.0](https://git.massive.box/massivebox/siyuan-jsdraw-plugin/releases/tag/v0.2.0). The new version should be available in the Marketplace within an hour, please let me know if other errors occur when you test it, even though everything should be working.
Author

Thanks for the update! The new version now allows smooth creation of handwriting tabs and opening existing handwritten image files. However, I’ve noticed another issue I’d like to report again:

  1. Clicking the save button twice causes file loss – If I click "Save" once, make no changes, and click it again, the file disappears.
  2. Could you add keyboard shortcuts for "Creat" and "open"? This would significantly improve the plugin's usability.

Let me know if you need more details. Big thanks for this awesome plugin - super helpful!

Thanks for the update! The new version now allows smooth creation of handwriting tabs and opening existing handwritten image files. However, I’ve noticed another issue I’d like to report again: 1. Clicking the save button twice causes file loss – If I click "Save" once, make no changes, and click it again, the file disappears. 2. Could you add keyboard shortcuts for "Creat" and "open"? This would significantly improve the plugin's usability. Let me know if you need more details. Big thanks for this awesome plugin - super helpful!
Author

Here's a suggestion for improving the "Save" button behavior: When there are unsaved changes, keep it as "Save"; once saved, change it to "Saved" and disable the button.
Of course, the ideal solution would be either auto-saving when closing tabs, or at least showing an "unsaved changes" warning before allowing tab closure. If SiYuan Note doesn't currently support this feature, you can consult Developer D for help, I think.
@massivebox

Here's a suggestion for improving the "Save" button behavior: When there are unsaved changes, keep it as "Save"; once saved, change it to "Saved" and disable the button. Of course, the ideal solution would be either auto-saving when closing tabs, or at least showing an "unsaved changes" warning before allowing tab closure. If SiYuan Note doesn't currently support this feature, you can consult Developer D for help, I think. @massivebox
Owner

@wenbocn wrote in #4 (comment):

Thanks for the update! The new version now allows smooth creation of handwriting tabs and opening existing handwritten image files. However, I’ve noticed another issue I’d like to report again:

1. Clicking the save button twice causes file loss – If I click "Save" once, make no changes, and click it again, the file disappears.

2. Could you add keyboard shortcuts for  "Creat" and "open"?  This would significantly improve the plugin's usability.

Let me know if you need more details. Big thanks for this awesome plugin - super helpful!

That is very weird behavior, it never happened in my testing. Can you please close all editor tabs, close the app fully, then open it and try again?

If the error persists: Were you editing an existing drawing or a new one? Can you copy and send here the Image URL before opening the drawing, then after the first save, then after the second save? (I don't need the actual image contents, just the URL is fine)

And by "the file disappears", do you mean that the image is entirely removed from the document, or that the image remains but leads to a non-existing path, or that it's removed from the editor window?

Thanks. I will work on the shortcuts and save behavior once the important bugs are all fixed.

@wenbocn wrote in https://git.massive.box/massivebox/siyuan-jsdraw-plugin/issues/4#issuecomment-38: > Thanks for the update! The new version now allows smooth creation of handwriting tabs and opening existing handwritten image files. However, I’ve noticed another issue I’d like to report again: > > 1. Clicking the save button twice causes file loss – If I click "Save" once, make no changes, and click it again, the file disappears. > > 2. Could you add keyboard shortcuts for "Creat" and "open"? This would significantly improve the plugin's usability. > > > Let me know if you need more details. Big thanks for this awesome plugin - super helpful! That is very weird behavior, it never happened in my testing. Can you please close all editor tabs, close the app fully, then open it and try again? If the error persists: Were you editing an existing drawing or a new one? Can you copy and send here the Image URL before opening the drawing, then after the first save, then after the second save? (I don't need the actual image contents, just the URL is fine) And by "the file disappears", do you mean that the image is entirely removed from the document, or that the image remains but leads to a non-existing path, or that it's removed from the editor window? Thanks. I will work on the shortcuts and save behavior once the important bugs are all fixed.
Author
  1. Creat,Close:assets/tvrnqkt-20250406155702-ri6km5i.svg
  2. Modified,Close:assets/tvrnqkt-20250406155726-4ywyua8.svg
  3. open,do nothing, click save button, Close:assets/tvrnqkt-20250406155726-4ywyua8.svg
    At this point, the file appears normal in the Svg file in Siyuan page, but the contents are blank when opened. This file cannot be found in Windows Explorer.
  4. open, modify, click save,close:assets/tvrnqkt-20250406160007-pz660el.svg
    now,looks good
  5. open, modify, click save,wait, click save, close:assets/tvrnqkt-20250406160151-1c9v1yw.svg
    The svg file does not display content, and this file cannot be found in Windows Explorer.
1. Creat,Close:assets/tvrnqkt-20250406155702-ri6km5i.svg 2. Modified,Close:assets/tvrnqkt-20250406155726-4ywyua8.svg 3. open,do nothing, click save button, Close:assets/tvrnqkt-20250406155726-4ywyua8.svg At this point, the file appears normal in the Svg file in Siyuan page, but the contents are blank when opened. This file cannot be found in Windows Explorer. 4. open, modify, click save,close:assets/tvrnqkt-20250406160007-pz660el.svg now,looks good 5. open, modify, click save,wait, click save, close:assets/tvrnqkt-20250406160151-1c9v1yw.svg The svg file does not display content, and this file cannot be found in Windows Explorer.
Author

image

![image](/attachments/39a3afed-9d7d-4f62-aa76-1195a9feb360)
Author

I’d actually prefer if you could add a button to the top bar. When an SVG image is selected, clicking the button opens to draw; if no SVG is selected, clicking the button creates a new one.

I’d actually prefer if you could add a button to the top bar. When an SVG image is selected, clicking the button opens to draw; if no SVG is selected, clicking the button creates a new one.
Owner

The issue should be resolved in release v0.2.1.
Please let me know how that goes after upgrading. As usual, the update will be live on the marketplace within ~1h.

Also, this issue is getting quite crowded, it's usual in the case of code issues to open a separate thread for each separate issue/suggestion, so I recommend this:

  • The current topic of discussion is that of the double-save bug, so it will remain as such. If you want, you can edit this issue's title to reflect that.
    • If you find other related bugs in the new versions, you can still talk about them here, but if the bugs are about something else, you should open another issue and close this one.
  • You can submit your proposals to improve the UX again in another issue (keyboard shortcuts/top bar icon, etc). You can open a single issue for all of those improvements, because they're similar in nature; but you should separate them, for example, from an issue suggesting the inclusion of auto-save features.

This would help me better keep track of what needs to be done, and how much priority it has. As always, thanks for your cooperation.

The issue should be resolved in release [v0.2.1](https://git.massive.box/massivebox/siyuan-jsdraw-plugin/releases/tag/v0.2.1). Please let me know how that goes after upgrading. As usual, the update will be live on the marketplace within ~1h. Also, this issue is getting quite crowded, it's usual in the case of code issues to open a separate thread for each separate issue/suggestion, so I recommend this: - The current topic of discussion is that of the double-save bug, so it will remain as such. If you want, you can edit this issue's title to reflect that. - If you find other related bugs in the new versions, you can still talk about them here, but if the bugs are about something else, you should open another issue and close this one. - You can submit your proposals to improve the UX again in another issue (keyboard shortcuts/top bar icon, etc). You can open a single issue for all of those improvements, because they're similar in nature; but you should separate them, for example, from an issue suggesting the inclusion of auto-save features. This would help me better keep track of what needs to be done, and how much priority it has. As always, thanks for your cooperation.
Author

I wasn't getting automatic updates for the Siyuan plugin, so I grabbed the latest version from GitHub and did a manual install. Works perfectly now—appreciate your efforts! No data loss, so all good.

I wasn't getting automatic updates for the Siyuan plugin, so I grabbed the latest version from GitHub and did a manual install. Works perfectly now—appreciate your efforts! No data loss, so all good.
Owner

Turns out I had forgotten to bump the version, so the baazar didn't suggest it as an update 😅 That should be rectified with v0.2.2. I should really add some CI automation to check for stuff like this. I'll put it in my tasks.

Also thanks for creating all the other issues for the improvement proposals. Unfortunately, we're getting closer to my midterms, so I have very little time to allocate to those right now. I'm glad we were able to fix the important bugs though, and I'll get to the new features as soon as I have time.

Since you've encountered no other errors, I'm closing this issue. Feel free to open it again at any time if needed!
Thanks again.

Turns out I had forgotten to bump the version, so the baazar didn't suggest it as an update 😅 That should be rectified with [v0.2.2](https://git.massive.box/massivebox/siyuan-jsdraw-plugin/releases/tag/v0.2.2). I should really add some CI automation to check for stuff like this. I'll put it in my tasks. Also thanks for creating all the other issues for the improvement proposals. Unfortunately, we're getting closer to my midterms, so I have very little time to allocate to those right now. I'm glad we were able to fix the important bugs though, and I'll get to the new features as soon as I have time. Since you've encountered no other errors, I'm closing this issue. Feel free to open it again at any time if needed! Thanks again.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: massivebox/siyuan-jsdraw-plugin#4
No description provided.