feat: add OpenCode CLI path override and settings UI

- Add opencodeBinary field to settings and persistence flow
- Introduce OpenCode CLI settings panel with Browse and Save actions
This commit is contained in:
Bohdan Triapitsyn
2026-02-06 01:32:32 +02:00
parent b17fb60393
commit 234a91b444
17 changed files with 736 additions and 31 deletions
+1
View File
@@ -389,6 +389,7 @@ export interface SettingsPayload {
darkThemeId?: string;
lastDirectory?: string;
homeDirectory?: string;
opencodeBinary?: string;
projects?: ProjectEntry[];
activeProjectId?: string;
approvedDirectories?: string[];
+2
View File
@@ -37,6 +37,8 @@ export type DesktopSettings = {
darkThemeId?: string;
lastDirectory?: string;
homeDirectory?: string;
// Optional absolute path to `opencode` binary.
opencodeBinary?: string;
projects?: ProjectEntry[];
activeProjectId?: string;
approvedDirectories?: string[];
+5
View File
@@ -350,6 +350,11 @@ const sanitizeWebSettings = (payload: unknown): DesktopSettings | null => {
result.homeDirectory = candidate.homeDirectory;
}
if (typeof candidate.opencodeBinary === 'string') {
const trimmed = candidate.opencodeBinary.trim();
result.opencodeBinary = trimmed.length > 0 ? trimmed : undefined;
}
const projects = sanitizeProjects(candidate.projects);
if (projects) {
result.projects = projects;