fix(plugins): unify plugin data directory under tabularis#258
Open
debba wants to merge 1 commit into
Open
Conversation
Plugins were resolved with `ProjectDirs::from("com", "debba", "tabularis")`,
which landed them in a different folder than the rest of the app data:
`paths.rs` uses `from("", "", "tabularis")` and the Tauri identifier is
`tabularis`. On macOS and Windows this stored plugins under a
`com.debba.tabularis` directory that also contradicted the documented path,
so plugins placed at the documented location were never discovered.
Resolve plugin directories through a shared `paths::get_app_data_dir()` so
plugins live under the same `tabularis` folder as all other app data on
every platform (Linux is unchanged). Add a one-time startup migration that
moves any plugins from the legacy `com.debba.tabularis` location into the
new directory.
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (6 files)
Reviewed by kimi-k2.6-20260420 · 107,810 tokens |
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.
Summary
Plugins were resolved with
ProjectDirs::from("com", "debba", "tabularis"), while the rest of the app data (config, themes, AI activity, heartbeat) usesProjectDirs::from("", "", "tabularis")and the Tauri identifier istabularis. On macOS and Windows this stored and loaded plugins from a separatecom.debba.tabularisdirectory that also contradicted the documented path, so a plugin placed at the documented location was never discovered.This unifies plugin storage under the same
tabularisdirectory as all other app data, with no code duplication, plus a one-time migration of any existing plugins.Changes
paths.rs— extract sharedproject_dirs()+ a pure, unit-testableunnested_app_dir()helper; addget_app_data_dir().get_app_config_dir()is refactored onto the same helpers with identical output.plugins/installer.rs—get_plugins_dir()now resolves viapaths::get_app_data_dir(); add one-timemigrate_legacy_plugins_dir()and a puremigrate_plugins_between()core.plugins/manager.rs— reuseinstaller::get_plugins_dir()instead of a duplicateProjectDirscall.lib.rs— run the migration once at startup, before loading plugins.paths_tests.rsand migration cases inplugins/tests.rs.Resulting plugin directory
~/.local/share/tabularis/plugins/~/.local/share/tabularis/plugins/(unchanged)~/Library/Application Support/com.debba.tabularis/plugins/~/Library/Application Support/tabularis/plugins/%APPDATA%\debba\tabularis\data\plugins\%APPDATA%\tabularis\plugins\The documented paths (
plugins/PLUGIN_GUIDE.md,plugins/README.md,plugins/PLUGIN_TUTORIAL.md, scaffolderjustfile.tmpl) already declaredtabularis, so no doc changes are needed — the code now matches them.Migration
migrate_legacy_plugins_dir()runs once at startup and is idempotent. It moves plugin folders from the legacycom.debba.tabularislocation into the new one only when the target is still empty (never clobbering an existing install), is a no-op on Linux (the two paths are already identical), and a no-op when there is nothing to migrate.Testing
cargo test—paths_tests(4) andplugins::tests(6, including 4 new migration cases) pass.cargo check --tests— clean.Closes #257