Problem
When using Stik in local mode (custom notes directory), external file modifications are not detected by the app. If another program (e.g., a CLI tool, another editor, or a script) modifies a .md file in the Stik directory, the changes are not reflected in the Stik UI until the app is restarted.
Root Cause (from code analysis)
- iCloud mode: File watching is fully implemented via
NSFileCoordinator → notify_external_change() → frontend event. Works great.
- Local mode: No file system watcher exists. Notes are read once via
std::fs::read_to_string() and cached in AppState::viewing_notes. The cache is never invalidated on external file changes.
Key locations:
src-tauri/src/commands/storage.rs — no local file watching (line 313-325)
src-tauri/src/commands/index.rs — notify_external_change() exists but is never called for local files
src-tauri/src/windows.rs — get_viewing_note_content() returns cached content without checking disk (line 488-502)
Proposed Solution
Add a file system watcher for local mode using notify-rs crate:
- Watch the Stik root directory recursively for
.md file changes
- On change, call the existing
index.notify_external_change() method
- Emit a frontend event (similar to
icloud-files-changed) to trigger UI refresh
- In
get_viewing_note_content(), check file modification timestamp vs cache timestamp
The architecture already supports this — notify_external_change() and the frontend event system are in place. Only the local file watcher trigger is missing.
Use Case
I use Stik alongside Obsidian and CLI tools (Claude Code). My workflow:
- Stik notes directory points to an Obsidian vault folder
- CLI tools update note contents programmatically
- I expect Stik to reflect those changes in real-time
Love the app — this would make it perfect for developer workflows!
Problem
When using Stik in local mode (custom notes directory), external file modifications are not detected by the app. If another program (e.g., a CLI tool, another editor, or a script) modifies a
.mdfile in the Stik directory, the changes are not reflected in the Stik UI until the app is restarted.Root Cause (from code analysis)
NSFileCoordinator→notify_external_change()→ frontend event. Works great.std::fs::read_to_string()and cached inAppState::viewing_notes. The cache is never invalidated on external file changes.Key locations:
src-tauri/src/commands/storage.rs— no local file watching (line 313-325)src-tauri/src/commands/index.rs—notify_external_change()exists but is never called for local filessrc-tauri/src/windows.rs—get_viewing_note_content()returns cached content without checking disk (line 488-502)Proposed Solution
Add a file system watcher for local mode using
notify-rscrate:.mdfile changesindex.notify_external_change()methodicloud-files-changed) to trigger UI refreshget_viewing_note_content(), check file modification timestamp vs cache timestampThe architecture already supports this —
notify_external_change()and the frontend event system are in place. Only the local file watcher trigger is missing.Use Case
I use Stik alongside Obsidian and CLI tools (Claude Code). My workflow:
Love the app — this would make it perfect for developer workflows!