feat(app): edit config files inside app#14617
Closed
alexyaroshuk wants to merge 23 commits intoanomalyco:devfrom
Closed
feat(app): edit config files inside app#14617alexyaroshuk wants to merge 23 commits intoanomalyco:devfrom
alexyaroshuk wants to merge 23 commits intoanomalyco:devfrom
Conversation
This reverts commit d44c51b.
…c dev build with -baseline. Is this intended?
Contributor
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
Contributor
Author
|
couldn't get people to test macos and linux, i guess this feature is not in demand |
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.
Issue for this PR
Closes #14614
Type of change
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:
Screenshots / recordings
Files changed:
bun.lockpackages/app/src/components/dialog-settings.tsxSettingsConfig, added a new "Config" tab trigger withsettings-gearicon, and added the correspondingTabs.Contentpanelpackages/app/src/components/settings-config.tsxpackages/app/src/context/platform.tsxPlatforminterface:getConfigPaths,readConfigFile,writeConfigFilepackages/app/src/i18n/en.tserror,success,create) and config settings labels (titles and descriptions for global/project config panels)packages/desktop/package.json@tauri-apps/plugin-fs ~2dependencypackages/desktop/src-tauri/Cargo.lockpackages/desktop/src-tauri/Cargo.tomltauri-plugin-fs = "2"crate dependencypackages/desktop/src-tauri/capabilities/default.jsonfsplugin permissions for reading, writing, and checking existence of filespackages/desktop/src-tauri/src/lib.rstauri_plugin_fspackages/desktop/src/index.tsxgetConfigPaths,readConfigFile, andwriteConfigFileon the desktopPlatformusing Tauriplugin-fsand `configDir().Checklist
How to Test
Open the desktop app
Open Settings (gear icon or Cmd/Ctrl+,)
Click "Config" in the sidebar under "Server" section
Test Global Config:
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