Reuse status dashboard message and simplify settings actions

This commit is contained in:
Eyejoker
2026-05-02 02:06:20 +09:00
committed by GitHub
parent 7576bcd3ff
commit 490ae7d324
8 changed files with 230 additions and 103 deletions

View File

@@ -79,20 +79,51 @@ export function SettingsPanel({
</label>
</section>
<ModelSettings onRestartStack={onRestartStack} />
<SettingsApplyBar onRestartStack={onRestartStack} />
<MoaSettingsPanel onRestartStack={onRestartStack} />
<ModelSettings />
<MoaSettingsPanel />
<FastModeSettings />
<CodexFeatureSettings onRestartStack={onRestartStack} />
<CodexFeatureSettings />
<AccountSettings onRestartStack={onRestartStack} />
<AccountSettings />
</div>
);
}
function ModelSettings({ onRestartStack }: { onRestartStack: () => void }) {
function SettingsApplyBar({ onRestartStack }: { onRestartStack: () => void }) {
return (
<section className="settings-apply-bar" aria-label="변경 적용">
<div>
<strong> </strong>
<small>
, MoA, Codex ,
.
</small>
</div>
<button
className="settings-restart"
onClick={() => {
if (
window.confirm(
'스택을 재시작하면 진행 중인 모든 에이전트 작업이 중단됩니다. 진행할까요?',
)
) {
onRestartStack();
}
}}
type="button"
>
</button>
</section>
);
}
function ModelSettings() {
const [config, setConfig] = useState<ModelConfigSnapshot | null>(null);
const [draft, setDraft] = useState<ModelConfigSnapshot | null>(null);
const [busy, setBusy] = useState(false);
@@ -193,29 +224,13 @@ function ModelSettings({ onRestartStack }: { onRestartStack: () => void }) {
onClick={() => void save()}
type="button"
>
{busy ? '저장 중…' : '저장'}
{busy ? '저장 중…' : '모델 저장'}
</button>
{savedAt && !dirty ? (
<small className="settings-hint">
. .
</small>
) : null}
<button
className="settings-restart"
disabled={busy}
onClick={() => {
if (
window.confirm(
'스택을 재시작하면 진행 중인 모든 에이전트 작업이 중단됩니다. 진행할까요?',
)
) {
onRestartStack();
}
}}
type="button"
>
</button>
</div>
</>
)}
@@ -307,11 +322,7 @@ function FastModeSettings() {
);
}
function CodexFeatureSettings({
onRestartStack,
}: {
onRestartStack: () => void;
}) {
function CodexFeatureSettings() {
const [state, setState] = useState<CodexFeatureSnapshot | null>(null);
const [busy, setBusy] = useState(false);
const [error, setError] = useState<string | null>(null);
@@ -376,29 +387,11 @@ function CodexFeatureSettings({
type="checkbox"
/>
</label>
<div className="settings-actions">
{savedAt ? (
<small className="settings-hint">
. .
</small>
) : null}
<button
className="settings-restart"
disabled={busy}
onClick={() => {
if (
window.confirm(
'스택을 재시작하면 진행 중인 모든 에이전트 작업이 중단됩니다. 진행할까요?',
)
) {
onRestartStack();
}
}}
type="button"
>
</button>
</div>
{savedAt ? (
<small className="settings-hint">
. .
</small>
) : null}
</>
)}
</section>
@@ -436,7 +429,7 @@ function formatExpiry(
};
}
function AccountSettings({ onRestartStack }: { onRestartStack: () => void }) {
function AccountSettings() {
const [data, setData] = useState<AccountData | null>(null);
const [busy, setBusy] = useState(false);
const [perRowBusy, setPerRowBusy] = useState<string | null>(null);
@@ -561,24 +554,6 @@ function AccountSettings({ onRestartStack }: { onRestartStack: () => void }) {
onSwitch={(index) => void handleSwitchCodex(index)}
perRowBusy={perRowBusy}
/>
<div className="settings-actions">
<button
className="settings-restart"
disabled={busy}
onClick={() => {
if (
window.confirm(
'스택을 재시작하면 진행 중인 모든 에이전트 작업이 중단됩니다. 진행할까요?',
)
) {
onRestartStack();
}
}}
type="button"
>
( )
</button>
</div>
</section>
);
}