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:
@@ -389,6 +389,7 @@ export interface SettingsPayload {
|
||||
darkThemeId?: string;
|
||||
lastDirectory?: string;
|
||||
homeDirectory?: string;
|
||||
opencodeBinary?: string;
|
||||
projects?: ProjectEntry[];
|
||||
activeProjectId?: string;
|
||||
approvedDirectories?: string[];
|
||||
|
||||
@@ -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[];
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user