Skip to content

fix(plugins): unify plugin data directory under tabularis#258

Open
debba wants to merge 1 commit into
mainfrom
fix/unify-plugin-data-dir
Open

fix(plugins): unify plugin data directory under tabularis#258
debba wants to merge 1 commit into
mainfrom
fix/unify-plugin-data-dir

Conversation

@debba
Copy link
Copy Markdown
Collaborator

@debba debba commented May 27, 2026

Summary

Plugins were resolved with ProjectDirs::from("com", "debba", "tabularis"), while the rest of the app data (config, themes, AI activity, heartbeat) uses ProjectDirs::from("", "", "tabularis") and the Tauri identifier is tabularis. On macOS and Windows this stored and loaded plugins from a separate com.debba.tabularis directory that also contradicted the documented path, so a plugin placed at the documented location was never discovered.

This unifies plugin storage under the same tabularis directory as all other app data, with no code duplication, plus a one-time migration of any existing plugins.

Changes

  • paths.rs — extract shared project_dirs() + a pure, unit-testable unnested_app_dir() helper; add get_app_data_dir(). get_app_config_dir() is refactored onto the same helpers with identical output.
  • plugins/installer.rsget_plugins_dir() now resolves via paths::get_app_data_dir(); add one-time migrate_legacy_plugins_dir() and a pure migrate_plugins_between() core.
  • plugins/manager.rs — reuse installer::get_plugins_dir() instead of a duplicate ProjectDirs call.
  • lib.rs — run the migration once at startup, before loading plugins.
  • Tests — new paths_tests.rs and migration cases in plugins/tests.rs.

Resulting plugin directory

OS Before After (matches docs)
Linux ~/.local/share/tabularis/plugins/ ~/.local/share/tabularis/plugins/ (unchanged)
macOS ~/Library/Application Support/com.debba.tabularis/plugins/ ~/Library/Application Support/tabularis/plugins/
Windows %APPDATA%\debba\tabularis\data\plugins\ %APPDATA%\tabularis\plugins\

The documented paths (plugins/PLUGIN_GUIDE.md, plugins/README.md, plugins/PLUGIN_TUTORIAL.md, scaffolder justfile.tmpl) already declared tabularis, 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 legacy com.debba.tabularis location 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 testpaths_tests (4) and plugins::tests (6, including 4 new migration cases) pass.
  • cargo check --tests — clean.

Closes #257

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.
@kilo-code-bot
Copy link
Copy Markdown

kilo-code-bot Bot commented May 27, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (6 files)
  • src-tauri/src/lib.rs — startup migration call ordering is correct
  • src-tauri/src/paths.rs — clean extraction of shared helpers, consistent fallback paths
  • src-tauri/src/paths_tests.rs — good coverage for unnested_app_dir and directory name assertions
  • src-tauri/src/plugins/installer.rs — safe idempotent migration logic with proper guards
  • src-tauri/src/plugins/manager.rs — correctly deduplicates ProjectDirs resolution
  • src-tauri/src/plugins/tests.rs — comprehensive migration test cases including edge cases

Reviewed by kimi-k2.6-20260420 · 107,810 tokens

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Plugins stored under inconsistent com.debba.tabularis directory instead of unified tabularis

1 participant