Skip to content

Conversation

@multiplex55
Copy link
Owner

Motivation

  • Ensure plugin "Edit config" actions resolve file paths relative to the configured settings location instead of using hard-coded defaults.
  • Create missing config files from a default template and surface clear feedback about the exact path opened/created.
  • Centralise path resolution/creation logic to avoid per-plugin duplication.

Description

  • Add a shared helper src/common/config_files.rs providing ConfigFileSpec, resolve_config_path and ensure_config_file to resolve config paths relative to the settings file and create missing files with default templates, and include unit tests for the helper.
  • Introduce a settings path registry with set_settings_path/settings_path in src/settings.rs and call set_settings_path("settings.json") at startup in src/main.rs so helpers can resolve relative config locations.
  • Wire the layouts subsystem to the shared helper: add DEFAULT_LAYOUTS_TEMPLATE and LAYOUTS_CONFIG in src/plugins/layouts_storage.rs, expose layouts_config_path() and update load_layouts/save_layouts to accept Path-style arguments and ensure parent directories are created on save.
  • Update layout actions and UI to use the resolved settings-based layout path and to present a clear Create/Edit label with the resolved path; changes in src/actions/layout.rs, src/plugins/layout.rs, and src/dashboard/widgets/layouts.rs use ensure_config_file to create templates when missing and open::that the exact file path.

Testing

  • Added unit tests exercising path resolution and create/open behavior in src/common/config_files.rs and attempted to run them with cargo test config_files.
  • The test run compiled dependencies but the build failed in this environment due to a missing system library required by alsa-sys (error: missing alsa.pc / alsa system library), so the unit tests were not executed here; the helper tests are self-contained and should run when the environment can build all crates or when running the specific package tests without the system-dependent crates.

Codex Task

@multiplex55 multiplex55 merged commit 4d0cd68 into master Jan 17, 2026
1 check passed
@multiplex55 multiplex55 deleted the codex/implement-config-management-in-plugins branch January 17, 2026 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants