feat(extension): add popup toggle to hide Agent control hints (#81)

Add a per-browser "Control hints" switch to the popup that hides the in-page control overlay (status pill + orange glow, along with its input blocker) while the Agent controls a tab. Preference lives in chrome.storage.local (bsk_control_hints_hidden, default: shown) and is applied live in content scripts via storage.onChanged.

Both popup settings rows share a single Switch component; the hint copy lives in an info-icon tooltip.

Refs #62
This commit is contained in:
BB-fat
2026-08-13 10:24:17 +08:00
committed by GitHub
parent f81a1e7796
commit 37fbaacc94
12 changed files with 373 additions and 20 deletions
@@ -18,6 +18,12 @@ export interface OverlayState {
* so 「Agent 正在控制」does not flash between RecordOverlay and teardown.
*/
suppressControlAfterRecord: boolean;
/**
* User preference (chrome.storage, toggled from the popup): hide the
* control hints — status pill, orange glow, and the input blocker that
* comes with them. Not session state; survives overlay resets.
*/
controlHintsHidden: boolean;
}
type MutableOverlayState = Omit<OverlayState, "controlVisible">;
@@ -36,6 +42,7 @@ export class OverlayController {
controlMode: "hidden",
automationBypassCount: 0,
suppressControlAfterRecord: false,
controlHintsHidden: false,
};
snapshot(): OverlayState {
@@ -129,6 +136,10 @@ export class OverlayController {
}
}
setControlHintsHidden(hidden: boolean): void {
this.state.controlHintsHidden = hidden;
}
resetAgentOverlays(sessionId: string): HelpRequestData | null {
if (this.state.activeSessionId && this.state.activeSessionId !== sessionId) {
return null;
@@ -152,6 +163,7 @@ export class OverlayController {
export function shouldShowAgentControlOverlay(state: OverlayState): boolean {
return (
state.controlVisible &&
!state.controlHintsHidden &&
!state.suppressControlAfterRecord &&
state.activeHelp === null &&
state.activeRecord === null