feat: grove profiles for separate note vaults#8
Open
sdoyle88 wants to merge 3 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Grove Profiles
First, I really enjoy this package! Thank you for starting it. I've been struggling with my knowledge base and have tried other packages such as org-roam and denote. These packages are amazing! But I find sometimes that it's overwhelming and I just want to manage more with vanilla org-mode with a helpful wrapping mechanism around them, and that's why this package piqued my interest.
One feature I enjoy with denote is the ability to have separate note locations on disk for work vs personal notes/knowledge bases. I wanted to introduce this PR as a potential path forward for that. It still allows viewing notes in different profiles by opening the file in Emacs, but the grove commands are tied to a specific profile while selected, and these are kept in different locations on disk to allow separation (say for sensitive data that should stay locally but personal notes that can be kept in a fileshare across machines). As such, I wanted to introduce a configuration option for
grove-profilesthat lets users maintain multiple independent note vaults and switch between them with a single command.Note: If PR #5 goes into the codebase, I'll refactor to include this across those updates as well (which is why I am leaving in draft for discussion), as the main
grove-directoryandgrove--cachevariables are updated to new "meta" variables depending on if a grove-profile plist is set or not. Existing grove-directory configs continue to work unchanged, and will fallback if grove-profiles not set, ensuring backwards compatibility. Essentially, swappedgrove-directorytogrove--active-directoryandgrove--cachetogrove--active-cachein all helper functions as meta variables.Example config
Changes Introduced
Profile switching (C-c v p / M-x grove-switch-profile) — selects the active profile, immediately refreshes the file tree sidebar to reflect the new vault.
Auto-prompt on first use — if profiles are configured but none is active, any grove command (including C-c v v) prompts the user to pick a profile rather than falling through to a directory prompt.
Per-profile lazy cache — each profile maintains its own note cache, populated on first access. Switching profiles is instant; no rescan unless the vault has changed.
Strict isolation — all commands (search, capture, daily notes, backlinks, graph, inbox review) are scoped to the active profile. The file tree header shows the active profile name. Buffers remain open and can be viewed across profile, but all grove actions apply to the selected profile
Cross-profile awareness — following a wikilink to a note that exists in another profile shows a message indicating which profile to switch to, rather than offering to create a duplicate note. Backlinks similarly report the correct profile when a note is open from the wrong vault.