logancyang_obsidian-copilot/src/agentMode/backends/opencode/OpencodeSettingsPanel.tsx
Zero Liu d72e3ee05a
refactor(agent-mode): redesign agent binary configuration UI (#2517)
Replace the per-backend install/settings panels with a shared Configure
dialog layout. Introduces ConfigDialogShell + ConfigSection, InstallCommandRow,
and an installStatus badge/status-line module (with tests), and reworks the
Claude, Codex, and opencode Configure dialogs onto it. The settings page now
shows each backend's icon, an install-status badge, and a Configure button,
dropping the old BinaryInstallContent and SimpleBackendSettingsPanel helpers.
Copy is simplified for non-technical users and dialog spacing/dividers are
made consistent.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-28 15:15:52 -07:00

28 lines
1 KiB
TypeScript

import { EnvOverridesSetting } from "@/agentMode/backends/shared/EnvOverridesSetting";
import type CopilotPlugin from "@/main";
import { updateAgentModeBackendFields, useSettingsValue } from "@/settings/model";
import type { App } from "obsidian";
import React from "react";
interface Props {
plugin: CopilotPlugin;
app: App;
}
/**
* OpenCode card extras. Binary install / detection / path configuration lives
* in the Configure dialog (`OpencodeInstallModal`, opened via
* `descriptor.openInstallUI`); this panel only hosts the spawn-time
* environment-variable overrides that remain on the settings card.
*/
export const OpencodeSettingsPanel: React.FC<Props> = () => {
const settings = useSettingsValue();
return (
<EnvOverridesSetting
backendDisplayName="opencode"
value={settings.agentMode?.backends?.opencode?.envOverrides}
onChange={(next) => updateAgentModeBackendFields("opencode", { envOverrides: next })}
hintExamples={["XDG_CONFIG_HOME", "HTTPS_PROXY"]}
/>
);
};