story-219: add Always Allow button to web UI permission dialog
Cherry-pick from feature branch — code was never squash-merged despite story being accepted (bug 226). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -578,10 +578,14 @@ export function Chat({ projectPath, onCloseProject }: ChatProps) {
|
||||
}
|
||||
};
|
||||
|
||||
const handlePermissionResponse = (approved: boolean) => {
|
||||
const handlePermissionResponse = (approved: boolean, alwaysAllow = false) => {
|
||||
const current = permissionQueue[0];
|
||||
if (!current) return;
|
||||
wsRef.current?.sendPermissionResponse(current.requestId, approved);
|
||||
wsRef.current?.sendPermissionResponse(
|
||||
current.requestId,
|
||||
approved,
|
||||
alwaysAllow,
|
||||
);
|
||||
setPermissionQueue((prev) => prev.slice(1));
|
||||
};
|
||||
|
||||
@@ -1095,6 +1099,21 @@ export function Chat({ projectPath, onCloseProject }: ChatProps) {
|
||||
>
|
||||
Approve
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => handlePermissionResponse(true, true)}
|
||||
style={{
|
||||
padding: "10px 20px",
|
||||
borderRadius: "8px",
|
||||
border: "none",
|
||||
backgroundColor: "#4caf50",
|
||||
color: "#fff",
|
||||
cursor: "pointer",
|
||||
fontSize: "0.9em",
|
||||
}}
|
||||
>
|
||||
Always Allow
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user