feat(FN-4488): complete Step 5 — wire settings and agent permission panels

Fusion-Task-Id: FN-4488
Fusion-Task-Lineage: 3fc1ac43-490f-43f2-a27e-4fdceb64d9c4
This commit is contained in:
Fusion
2026-05-14 12:55:57 -07:00
committed by gsxdsm
parent 921a9d3622
commit bf5170f5ff
5 changed files with 127 additions and 3 deletions

View File

@@ -39,6 +39,7 @@ import { LoginInstructions } from "./LoginInstructions";
import { OAuthManualCodeForm } from "./OAuthManualCodeForm";
import { ProviderIcon } from "./ProviderIcon";
import { CustomProvidersSection } from "./CustomProvidersSection";
import { AgentPermissionPolicyEditor } from "./AgentPermissionPolicyEditor";
import { applyPresetToSelection, generateUniquePresetId } from "../utils/modelPresets";
import { appendTokenQuery } from "../auth";
import { useConfirm } from "../hooks/useConfirm";
@@ -228,6 +229,7 @@ const SETTINGS_SECTIONS: SettingsSection[] = [
{ id: "worktrees", label: "Worktrees", scope: "project" },
{ id: "commands", label: "Commands", scope: "project" },
{ id: "merge", label: "Merge", scope: "project" },
{ id: "agent-permissions", label: "Agent Permissions", scope: "project" },
{ id: "memory", label: "Memory", scope: "project" },
{ id: "research-project", label: "Research", scope: "project" },
{ id: "prompts", label: "Prompts", scope: "project" },
@@ -4186,6 +4188,26 @@ export function SettingsModal({
)}
</>
);
case "agent-permissions":
return (
<>
{renderScopeBanner()}
<h4 className="settings-section-heading">Agent Permissions</h4>
<div className="form-group">
<small className="settings-muted">Per-agent settings override project defaults. Each category controls a separate approval gate.</small>
</div>
<AgentPermissionPolicyEditor
mode="project-default"
value={form.defaultAgentPermissionPolicy ? { presetId: "custom", rules: form.defaultAgentPermissionPolicy.rules ?? {} } : { presetId: "custom", rules: {} }}
onChange={(next) =>
setForm((f) => ({
...f,
defaultAgentPermissionPolicy: { rules: next?.rules ?? {} },
}))
}
/>
</>
);
case "memory": {
// Use memory backend status from top-level hook call
const {