Skip to content

feat(app): edit config files inside app#14617

Closed
alexyaroshuk wants to merge 23 commits intoanomalyco:devfrom
alexyaroshuk:feat/edit-opencode-json-in-settings
Closed

feat(app): edit config files inside app#14617
alexyaroshuk wants to merge 23 commits intoanomalyco:devfrom
alexyaroshuk:feat/edit-opencode-json-in-settings

Conversation

@alexyaroshuk
Copy link
Copy Markdown
Contributor

@alexyaroshuk alexyaroshuk commented Feb 21, 2026

Issue for this PR

Closes #14614

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Adds a Config tab in Settings allowing users to edit project and global opencode.json files directly from the desktop app UI with JSON validation and auto-reload.

Changes:
Created SettingsConfig component with JSON editor, added platform file I/O methods (readConfigFile, writeConfigFile, getConfigPaths) to desktop app, integrated with global sync to update config and reload app on save.

Why it works:
The desktop platform uses Tauri's fs plugin to read/write config files at known paths ($CONFIG/opencode/opencode.json for global, project directory for project). On save, the config is written to disk and the server is notified to reload via the SDK, triggering a full app refresh to apply changes.

How did you verify your code works?

Test on Windows:

  1. bun test
  2. Tested project config update - updating config correctly updates the config file, and restarts the app with new config
  3. Tested global config update - updating config correctly updates the config file, and restarts the app with new config

Screenshots / recordings

image image

Files changed:

File Changes Made
bun.lock Lockfile update from new dependencies
packages/app/src/components/dialog-settings.tsx Added import for SettingsConfig, added a new "Config" tab trigger with settings-gear icon, and added the corresponding Tabs.Content panel
packages/app/src/components/settings-config.tsx JSON editor with validation/error display, also check for actual changes via isDeepEqual
packages/app/src/context/platform.tsx Added three optional methods to the Platform interface: getConfigPaths, readConfigFile, writeConfigFile
packages/app/src/i18n/en.ts Added locale strings for common keys (error, success, create) and config settings labels (titles and descriptions for global/project config panels)
packages/desktop/package.json Added @tauri-apps/plugin-fs ~2 dependency
packages/desktop/src-tauri/Cargo.lock Lockfile update from new Cargo dependency
packages/desktop/src-tauri/Cargo.toml Added tauri-plugin-fs = "2" crate dependency
packages/desktop/src-tauri/capabilities/default.json Added fs plugin permissions for reading, writing, and checking existence of files
packages/desktop/src-tauri/src/lib.rs Registered tauri_plugin_fs
packages/desktop/src/index.tsx Implemented getConfigPaths, readConfigFile, and writeConfigFile on the desktop Platform using Tauri plugin-fs and `configDir().

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

How to Test

  1. Open the desktop app

  2. Open Settings (gear icon or Cmd/Ctrl+,)

  3. Click "Config" in the sidebar under "Server" section

  4. Test Global Config:

  • Click "Edit" on Global Config row
  • Modify the JSON (e.g., change a setting)
  • Click "Save"
  • App should reload with the new config applied
  1. Test Project Config:
  • Open a project
  • Go to Settings > Config
  • Click "Create" or "Edit" on Project Config row
  • Add/modify config, save
  • App should reload with changes
  1. Test Validation:
  • Enter invalid JSON (e.g., missing closing brace, or a missing comma)

  • Verify error message appears at bottom

  • Verify Save button is disabled

  • Test on Windows

  • Test on Mac

  • Test on Linux

  • Update localization keys

@github-actions github-actions bot added contributor needs:compliance This means the issue will auto-close after 2 hours. needs:issue labels Feb 21, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions github-actions bot removed needs:issue needs:compliance This means the issue will auto-close after 2 hours. labels Feb 21, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@alexyaroshuk
Copy link
Copy Markdown
Contributor Author

couldn't get people to test macos and linux, i guess this feature is not in demand

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] (app): modify config files inside app

1 participant