mirror of
https://github.com/logancyang/obsidian-copilot.git
synced 2026-07-22 07:50:24 +00:00
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>
28 lines
1 KiB
TypeScript
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"]}
|
|
/>
|
|
);
|
|
};
|