Refine agent list attention handling
This commit is contained in:
@@ -3,8 +3,16 @@ interface ShouldClearAgentAttentionInput {
|
||||
isConnected: boolean;
|
||||
requiresAttention: boolean | null | undefined;
|
||||
attentionReason?: "finished" | "error" | "permission" | null | undefined;
|
||||
trigger?: AgentAttentionClearTrigger;
|
||||
hasDeferredFocusEntryClear?: boolean;
|
||||
}
|
||||
|
||||
export type AgentAttentionClearTrigger =
|
||||
| "focus-entry"
|
||||
| "input-focus"
|
||||
| "prompt-send"
|
||||
| "agent-blur";
|
||||
|
||||
export function shouldClearAgentAttention(
|
||||
input: ShouldClearAgentAttentionInput
|
||||
): boolean {
|
||||
@@ -21,5 +29,11 @@ export function shouldClearAgentAttention(
|
||||
if (input.attentionReason === "permission") {
|
||||
return false;
|
||||
}
|
||||
if (
|
||||
input.trigger === "focus-entry" &&
|
||||
input.hasDeferredFocusEntryClear === true
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user