Skip to content

AI Accessible Comments #31

Description

@TanujW

Hey there!

I've just started using your plugin, and so far it's far ahead of the other plug-ins in terms of UI/UX for a human. However, it seems like my AI agents couldn't see the comments, so I made a small skill to parse the data.json file.

However, it seems like while reading is not an issue, direct edits to data.json are overwritten with in-memory state of the application.

I managed to patch (with the help of Codex) the local bundled main.js so external edits to data.json are picked up while Obsidian is running. The issue was that direct writes to the plugin data file could update disk state without updating SideNote’s in-memory comments array, so comments created by external tools were invisible until restart.

The patch adds a 2-second polling refresh, normalized fingerprinting of plugin data, and save/reload guards. When changes to the data.json are detected, it reloads plugin data, updates the CommentManager, re-renders SideNote views, and refreshes editor decorations.

Plugin-originated saves update the fingerprint and are guarded so SideNote does not react to its own writes to the file.

I'm happy to create a pull-request, but not sure if this is the best method to accomplish what I wanted.

Thank you for your continued development of the plugin!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions