ArkHost/HelixNotes
14
150
Fork
You've already forked HelixNotes
13

Subject: Separate attachments directory from .helixnotes to prevent sync conflicts #56

Closed
opened 2026年05月05日 07:37:44 +02:00 by Wang234 · 8 comments

Issue:
Currently, the attachments folder is located inside the .helixnotes configuration directory. This setup often causes file conflicts when using synchronization tools like Syncthing, as device-specific configs and shared assets are bundled together.

Request:
In the next version, could you separate the attachments folder from the configuration folder (or allow a custom path)? This would make multi-device syncing much cleaner and more reliable.

Issue: Currently, the attachments folder is located inside the .helixnotes configuration directory. This setup often causes file conflicts when using synchronization tools like Syncthing, as device-specific configs and shared assets are bundled together. Request: In the next version, could you separate the attachments folder from the configuration folder (or allow a custom path)? This would make multi-device syncing much cleaner and more reliable.

For now @Wang234 maybe you can use "ignore files" of synchthing https://docs.syncthing.net/v2.0.0/users/ignoring

For now @Wang234 maybe you can use "ignore files" of synchthing https://docs.syncthing.net/v2.0.0/users/ignoring

@ArkHost @Wang234 I think I've found the solution of the "drag'n'drop" not working for me...#34 (comment)

And it's related to this issue. I've asked ChatGpt to make a "ignore" rules to me...But I've stumbled on another matters...

In sum : I'm using Syncthing to sync between Windows and Android the entire vault without any rules. I've put my android offline and drag'n'drop starts to work ...

Here the problem explained by the IA :

Summary (EN):

Synchronizing the entire vault with Syncthing can interfere with drag-and-drop ordering in HelixNotes because the ordering is not stored as stable, portable data inside the note files (.md).

Instead, the order is derived from local state (e.g., config files, cache, or in-memory UI state). When multiple devices are online:

Device A changes order (drag'n'drop)
→ writes local state
Device B has a different state
→ Syncthing syncs config/state files
→ states conflict or overwrite each other
→ order resets or behaves inconsistently

This creates the effect that drag-and-drop is "not working".

When you turned off the internet on Android:

no synchronization
→ no external state overwrite
→ local state remains stable
→ drag'n'drop works normally

Conclusion:

Full vault synchronization includes files that should remain device-local.
These files override ordering state across devices, breaking drag-and-drop consistency.

Implication:

Only actual note data (.md) should be synced.
UI state and config files should be ignored to avoid this issue.
```"
The rules that it have made to syncthing are :
**/config.json
**/settings.json
**/notebook_icons.json
**/*.db
**/*.sqlite*
**/*.log
**/cache/**
**/tmp/**
**/.cache/**
I will not include "**/notebook_icons.json" because the icons are synching and I expect it...
@ArkHost @Wang234 I think I've found the solution of the "drag'n'drop" not working for me...https://codeberg.org/ArkHost/HelixNotes/issues/34#issuecomment-14357952 And it's related to this issue. I've asked ChatGpt to make a "ignore" rules to me...But I've stumbled on another matters... In sum : I'm using Syncthing to sync between Windows and Android the entire vault without any rules. I've put my android offline and drag'n'drop starts to work ... Here the problem explained by the IA : **Summary (EN):** Synchronizing the entire vault with Syncthing can interfere with drag-and-drop ordering in HelixNotes because the ordering is not stored as stable, portable data inside the note files (`.md`). Instead, the order is derived from **local state** (e.g., config files, cache, or in-memory UI state). When multiple devices are online: ```text Device A changes order (drag'n'drop) → writes local state Device B has a different state → Syncthing syncs config/state files → states conflict or overwrite each other → order resets or behaves inconsistently ``` This creates the effect that drag-and-drop is "not working". When you turned off the internet on Android: ```text no synchronization → no external state overwrite → local state remains stable → drag'n'drop works normally ``` **Conclusion:** ```text Full vault synchronization includes files that should remain device-local. These files override ordering state across devices, breaking drag-and-drop consistency. ``` **Implication:** ```text Only actual note data (.md) should be synced. UI state and config files should be ignored to avoid this issue. ```" The rules that it have made to syncthing are : **/config.json **/settings.json **/notebook_icons.json **/*.db **/*.sqlite* **/*.log **/cache/** **/tmp/** **/.cache/** I will not include "**/notebook_icons.json" because the icons are synching and I expect it...

On Windows it still not working even if I turn off the internet...On Android is ok

On Windows it still not working even if I turn off the internet...On Android is ok

I've created an empty vault on Android...Works for the first folder I move...Then no more...The same behavior with the set on of Synchting....I just don't know...And it's an important feature that Joplin never implemented...

I've created an empty vault on Android...Works for the first folder I move...Then no more...The same behavior with the set on of Synchting....I just don't know...And it's an important feature that Joplin never implemented...

Mistral has spotted a thing . Maybe it is completely incorrect . Maybe not.

https://chat.mistral.ai/chat/21ba596a-72ba-42ef-9091-884f14d4918c

Mistral has spotted a thing . Maybe it is completely incorrect . Maybe not. https://chat.mistral.ai/chat/21ba596a-72ba-42ef-9091-884f14d4918c

From Mistral :

"After investigating the HelixNotes codebase and Tauri's drag-and-drop behavior, I've identified why drag'n'drop isn't working on Android and Windows:

🔍 Root Cause
Tauri 2.0 blocks native DOM drag-and-drop events by default.
The app uses TipTap editor (a ProseMirror-based editor) which relies on native browser drag-and-drop events (ondrop, ondragover, ondragenter) to handle:

Dropping images into the editor
Dropping files for attachment
Drag-and-drop between notes/notebooks
However, Tauri 2.0 enables its own internal drag-and-drop handler by default (dragDropEnabled: true), which:

Intercepts file drops at the OS level
Prevents native DOM events from firing
Uses Tauri's own event system (tauri://file-drop) instead
Since HelixNotes doesn't have code to listen for Tauri's file-drop events, the drops are intercepted and silently ignored.

📄 Evidence from Code

  1. Tauri Configuration (src-tauri/tauri.conf.json)
    json
    Copiar

{
"app": {
"windows": [{
"title": "HelixNotes",
"label": "main",
// MISSING: "dragDropEnabled": false
}]
}
}

The dragDropEnabled flag is not set, so it defaults to true, blocking native DOM events.
2. Documentation Confirms This
From Tauri's own documentation and community discussions:

"When using Tauri, if a developer would like to use native DOM drag and drop events, it is necessary to set dragDropEnabled to false"

— Tauri Issue #14373

"Tauri's internal drag and drop system is enabled, and DOM drag and drop is disabled"

— Tauri Docs

  1. TipTap Expects Native Events
    The TipTap Image extension and custom file handling in HelixNotes use standard browser APIs:

event.dataTransfer.files for dropped files
ondrop / ondragover handlers on the editor
These never fire when Tauri's handler is active

The Fix
Option 1: Disable Tauri's Handler (Recommended)
Add dragDropEnabled: false to your window config in src-tauri/tauri.conf.json:
json
Copiar

{
"app": {
"windows": [{
"title": "HelixNotes",
"label": "main",
"width": 1200,
"height": 800,
"dragDropEnabled": false // Enable native DOM events
}]
}
}

This will:

Allow TipTap's native drag-and-drop to work
Enable dropping images/files into the editor
Enable drag-and-drop between notes/notebooks
Work on Windows, macOS, Linux, and Android
Option 2: Use Tauri's Event System
Alternatively, you could keep Tauri's handler and listen for its events:
typescript
Copiar

// In your frontend code
import { listen } from '@tauri-apps/api/event';

listen('tauri://file-drop', (event) => {
const { paths, position } = event.payload;
// Handle dropped files manually
});

But this requires rewriting all drag-and-drop logic in HelixNotes to use Tauri's API instead of native events.

📱 Android-Specific Notes
The HelixNotes codebase shows:

Mobile detection: const isMobile = /android|ios/i.test(navigator.userAgent)
Some features are disabled on Android (e.g., copy button for Mermaid diagrams)
The app uses long-press for multi-select on mobile instead of drag-and-drop
For Android:

The same dragDropEnabled: false fix should work
However, Android WebView has limited drag-and-drop support in general
You may need to add touch-specific handlers for better mobile UX

🔧 Implementation Steps

Edit src-tauri/tauri.conf.json:
json
Copiar

"windows": [{
"dragDropEnabled": false
}]

Test on all platforms:

Windows: Should work immediately
Android: May need additional touch handlers
macOS/Linux: Should work

For Android improvements (optional):

Add touch-based drag-and-drop alternatives
Consider using touchstart, touchmove, touchend events
Test with actual Android devices (emulators may not support drag-and-drop well)

📚 References

Tauri Drag & Drop Documentation
Tauri Issue #14373 - dragDropEnabled confusion
Tauri Discussion #4736 - File drop handling
Stack Overflow - Tauri + Angular Drag and Drop

Summary: The fix is simple - just add "dragDropEnabled": false to your Tauri window configuration. This will unblock native DOM drag-and-drop events that TipTap and your custom code rely on."

From Mistral : "After investigating the HelixNotes codebase and Tauri's drag-and-drop behavior, I've identified why drag'n'drop isn't working on Android and Windows: 🔍 Root Cause Tauri 2.0 blocks native DOM drag-and-drop events by default. The app uses TipTap editor (a ProseMirror-based editor) which relies on native browser drag-and-drop events (ondrop, ondragover, ondragenter) to handle: Dropping images into the editor Dropping files for attachment Drag-and-drop between notes/notebooks However, Tauri 2.0 enables its own internal drag-and-drop handler by default (dragDropEnabled: true), which: Intercepts file drops at the OS level Prevents native DOM events from firing Uses Tauri's own event system (tauri://file-drop) instead Since HelixNotes doesn't have code to listen for Tauri's file-drop events, the drops are intercepted and silently ignored. 📄 Evidence from Code 1. Tauri Configuration (src-tauri/tauri.conf.json) json Copiar { "app": { "windows": [{ "title": "HelixNotes", "label": "main", // ❌ MISSING: "dragDropEnabled": false }] } } The dragDropEnabled flag is not set, so it defaults to true, blocking native DOM events. 2. Documentation Confirms This From Tauri's own documentation and community discussions: "When using Tauri, if a developer would like to use native DOM drag and drop events, it is necessary to set dragDropEnabled to false" — Tauri Issue #14373 "Tauri's internal drag and drop system is enabled, and DOM drag and drop is disabled" — Tauri Docs 3. TipTap Expects Native Events The TipTap Image extension and custom file handling in HelixNotes use standard browser APIs: event.dataTransfer.files for dropped files ondrop / ondragover handlers on the editor These never fire when Tauri's handler is active ✅ The Fix Option 1: Disable Tauri's Handler (Recommended) Add dragDropEnabled: false to your window config in src-tauri/tauri.conf.json: json Copiar { "app": { "windows": [{ "title": "HelixNotes", "label": "main", "width": 1200, "height": 800, "dragDropEnabled": false // ✅ Enable native DOM events }] } } This will: Allow TipTap's native drag-and-drop to work Enable dropping images/files into the editor Enable drag-and-drop between notes/notebooks Work on Windows, macOS, Linux, and Android Option 2: Use Tauri's Event System Alternatively, you could keep Tauri's handler and listen for its events: typescript Copiar // In your frontend code import { listen } from '@tauri-apps/api/event'; listen('tauri://file-drop', (event) => { const { paths, position } = event.payload; // Handle dropped files manually }); But this requires rewriting all drag-and-drop logic in HelixNotes to use Tauri's API instead of native events. 📱 Android-Specific Notes The HelixNotes codebase shows: Mobile detection: const isMobile = /android|ios/i.test(navigator.userAgent) Some features are disabled on Android (e.g., copy button for Mermaid diagrams) The app uses long-press for multi-select on mobile instead of drag-and-drop For Android: The same dragDropEnabled: false fix should work However, Android WebView has limited drag-and-drop support in general You may need to add touch-specific handlers for better mobile UX 🔧 Implementation Steps Edit src-tauri/tauri.conf.json: json Copiar "windows": [{ "dragDropEnabled": false }] Test on all platforms: Windows: Should work immediately Android: May need additional touch handlers macOS/Linux: Should work For Android improvements (optional): Add touch-based drag-and-drop alternatives Consider using touchstart, touchmove, touchend events Test with actual Android devices (emulators may not support drag-and-drop well) 📚 References Tauri Drag & Drop Documentation Tauri Issue #14373 - dragDropEnabled confusion Tauri Discussion #4736 - File drop handling Stack Overflow - Tauri + Angular Drag and Drop Summary: The fix is simple - just add "dragDropEnabled": false to your Tauri window configuration. This will unblock native DOM drag-and-drop events that TipTap and your custom code rely on."

Documentation has been updated to address this on the HelixNotes website.
Closing this issue.

Documentation has been updated to address this on the HelixNotes website. Closing this issue.
Author
Copy link

Thank you .

Thank you .
Sign in to join this conversation.
No Branch/Tag specified
main
fix/vault-indication
v1.3.3
v1.3.2
v1.3.1
v1.3.0
v1.2.9
v1.2.8
v1.2.7
v1.2.6
v1.2.5
v1.2.4
v1.2.3
v1.2.2
v1.2.1
v1.2.0
v1.1.9
v1.1.8
v1.1.7
v1.1.6
v1.1.5
v1.1.4
v1.1.3
v1.1.2
v1.1.1
v1.1.0
v1.0.9
v1.0.8
v1.0.7
v1.0.6
v1.0.5
v1.0.4
v1.0.3
v1.0.2
v1.0.1
v1.0.0
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
3 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
ArkHost/HelixNotes#56
Reference in a new issue
ArkHost/HelixNotes
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?