Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/core/types/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ export const StorageKeys = {

// Upsell hider
UPSELL_HIDER_ENABLED: 'gvUpsellHiderEnabled',

// AI Studio master toggle
GV_AISTUDIO_ENABLED: 'gvAIStudioEnabled',
} as const;

export type StorageKey = (typeof StorageKeys)[keyof typeof StorageKeys];
8 changes: 8 additions & 0 deletions src/locales/ar/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1411,6 +1411,14 @@
"message": "AI Studio",
"description": "AI Studio platform label."
},
"enableOnAIStudio": {
"message": "التفعيل في AI Studio",
"description": "Toggle to enable/disable Voyager on AI Studio"
},
"enableOnAIStudioHint": {
"message": "أوقف التشغيل لتعطيل ميزات Voyager على AI Studio (يبقى Prompt Manager نشطاً)",
"description": "Hint for AI Studio enable toggle"
},
"export_select_mode_only_user": {
"message": "تحديد المستخدم فقط",
"description": "Export selection mode: select only user messages"
Expand Down
8 changes: 8 additions & 0 deletions src/locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1419,6 +1419,14 @@
"message": "AI Studio",
"description": "AI Studio platform label."
},
"enableOnAIStudio": {
"message": "Enable on AI Studio",
"description": "Toggle to enable/disable Voyager on AI Studio"
},
"enableOnAIStudioHint": {
"message": "Turn off to disable Voyager features on AI Studio (Prompt Manager stays active)",
"description": "Hint for AI Studio enable toggle"
},
"export_select_mode_only_user": {
"message": "Select User Only",
"description": "Export selection mode: select only user messages"
Expand Down
8 changes: 8 additions & 0 deletions src/locales/es/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1411,6 +1411,14 @@
"message": "AI Studio",
"description": "AI Studio platform label."
},
"enableOnAIStudio": {
"message": "Activar en AI Studio",
"description": "Toggle to enable/disable Voyager on AI Studio"
},
"enableOnAIStudioHint": {
"message": "Desactiva para deshabilitar las funciones de Voyager en AI Studio (Prompt Manager sigue activo)",
"description": "Hint for AI Studio enable toggle"
},
"export_select_mode_only_user": {
"message": "Seleccionar solo usuario",
"description": "Export selection mode: select only user messages"
Expand Down
8 changes: 8 additions & 0 deletions src/locales/fr/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1411,6 +1411,14 @@
"message": "AI Studio",
"description": "AI Studio platform label."
},
"enableOnAIStudio": {
"message": "Activer sur AI Studio",
"description": "Toggle to enable/disable Voyager on AI Studio"
},
"enableOnAIStudioHint": {
"message": "Désactiver pour désactiver les fonctions Voyager sur AI Studio (Prompt Manager reste actif)",
"description": "Hint for AI Studio enable toggle"
},
"export_select_mode_only_user": {
"message": "Sélectionner uniquement l'utilisateur",
"description": "Export selection mode: select only user messages"
Expand Down
8 changes: 8 additions & 0 deletions src/locales/ja/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1411,6 +1411,14 @@
"message": "AI Studio",
"description": "AI Studio platform label."
},
"enableOnAIStudio": {
"message": "AI Studio で有効化",
"description": "Toggle to enable/disable Voyager on AI Studio"
},
"enableOnAIStudioHint": {
"message": "オフにすると AI Studio での Voyager 機能が無効になります(Prompt Manager は除く)",
"description": "Hint for AI Studio enable toggle"
},
"export_select_mode_only_user": {
"message": "ユーザーのみ選択",
"description": "Export selection mode: select only user messages"
Expand Down
8 changes: 8 additions & 0 deletions src/locales/ko/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1411,6 +1411,14 @@
"message": "AI Studio",
"description": "AI Studio platform label."
},
"enableOnAIStudio": {
"message": "AI Studio에서 활성화",
"description": "Toggle to enable/disable Voyager on AI Studio"
},
"enableOnAIStudioHint": {
"message": "끄면 AI Studio의 Voyager 기능이 비활성화됩니다 (Prompt Manager 제외)",
"description": "Hint for AI Studio enable toggle"
},
"export_select_mode_only_user": {
"message": "사용자만 선택",
"description": "Export selection mode: select only user messages"
Expand Down
8 changes: 8 additions & 0 deletions src/locales/pt/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1411,6 +1411,14 @@
"message": "AI Studio",
"description": "AI Studio platform label."
},
"enableOnAIStudio": {
"message": "Ativar no AI Studio",
"description": "Toggle to enable/disable Voyager on AI Studio"
},
"enableOnAIStudioHint": {
"message": "Desative para desabilitar as funcionalidades do Voyager no AI Studio (Prompt Manager permanece ativo)",
"description": "Hint for AI Studio enable toggle"
},
"export_select_mode_only_user": {
"message": "Selecionar apenas usuário",
"description": "Export selection mode: select only user messages"
Expand Down
8 changes: 8 additions & 0 deletions src/locales/ru/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1411,6 +1411,14 @@
"message": "AI Studio",
"description": "AI Studio platform label."
},
"enableOnAIStudio": {
"message": "Включить в AI Studio",
"description": "Toggle to enable/disable Voyager on AI Studio"
},
"enableOnAIStudioHint": {
"message": "Отключите, чтобы деактивировать функции Voyager в AI Studio (Prompt Manager остаётся активным)",
"description": "Hint for AI Studio enable toggle"
},
"export_select_mode_only_user": {
"message": "Выбрать только пользователя",
"description": "Export selection mode: select only user messages"
Expand Down
8 changes: 8 additions & 0 deletions src/locales/zh/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1419,6 +1419,14 @@
"message": "AI Studio",
"description": "AI Studio platform label."
},
"enableOnAIStudio": {
"message": "在 AI Studio 上启用",
"description": "Toggle to enable/disable Voyager on AI Studio"
},
"enableOnAIStudioHint": {
"message": "关闭后将禁用 AI Studio 上的 Voyager 功能(Prompt Manager 不受影响)",
"description": "Hint for AI Studio enable toggle"
},
"export_select_mode_only_user": {
"message": "仅选用户",
"description": "Export selection mode: select only user messages"
Expand Down
8 changes: 8 additions & 0 deletions src/locales/zh_TW/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1411,6 +1411,14 @@
"message": "AI Studio",
"description": "AI Studio platform label."
},
"enableOnAIStudio": {
"message": "在 AI Studio 上啟用",
"description": "Toggle to enable/disable Voyager on AI Studio"
},
"enableOnAIStudioHint": {
"message": "關閉後將停用 AI Studio 上的 Voyager 功能(Prompt Manager 不受影響)",
"description": "Hint for AI Studio enable toggle"
},
"export_select_mode_only_user": {
"message": "僅選用戶",
"description": "Export selection mode: select only user messages"
Expand Down
16 changes: 16 additions & 0 deletions src/pages/content/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,22 @@ async function initializeFeatures(): Promise<void> {
}

if (location.hostname === 'aistudio.google.com' || location.hostname === 'aistudio.google.cn') {
// Check if user has disabled Voyager on AI Studio
const aiStudioEnabled = await new Promise<boolean>((resolve) => {
try {
chrome.storage?.sync?.get({ [StorageKeys.GV_AISTUDIO_ENABLED]: true }, (res) =>
resolve(res?.[StorageKeys.GV_AISTUDIO_ENABLED] !== false),
);
} catch {
resolve(true);
}
});

if (!aiStudioEnabled) {
console.log('[Gemini Voyager] AI Studio features disabled by user');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 console.log in production code violates AGENTS.md anti-pattern rule

The new console.log at line 303 violates the AGENTS.md DON'Ts rule: "Console Logs: Remove console.log in production code (use LoggerService for critical info)." A LoggerService exists at src/core/services/LoggerService.ts and should be used instead. Note: the same file has ~12 pre-existing console.log calls following the same [Gemini Voyager] pattern, so this follows an established (but non-compliant) pattern.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

return;
}
Comment thread
devin-ai-integration[bot] marked this conversation as resolved.

startAIStudioFolderManager();
await delay(HEAVY_FEATURE_INIT_DELAY);

Expand Down
32 changes: 32 additions & 0 deletions src/pages/popup/Popup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ interface SettingsUpdate {
upsellHiderEnabled?: boolean;
accountIsolationEnabled?: boolean;
accountIsolationPlatform?: AccountPlatform;
aiStudioEnabled?: boolean;
}

export default function Popup() {
Expand Down Expand Up @@ -341,6 +342,7 @@ export default function Popup() {
useState<boolean>(false);
const [accountIsolationEnabledAIStudio, setAccountIsolationEnabledAIStudio] =
useState<boolean>(false);
const [aiStudioEnabled, setAiStudioEnabled] = useState<boolean>(true);
const [activeAccountPlatform, setActiveAccountPlatform] = useState<AccountPlatform>('gemini');
const [aiStructureCopyStatus, setAiStructureCopyStatus] = useState<
'idle' | 'loading' | 'copied' | 'error'
Expand Down Expand Up @@ -436,6 +438,8 @@ export default function Popup() {
payload[getAccountIsolationStorageKey(isolationPlatform)] =
settings.accountIsolationEnabled;
}
if (typeof settings.aiStudioEnabled === 'boolean')
payload[StorageKeys.GV_AISTUDIO_ENABLED] = settings.aiStudioEnabled;
void setSyncStorage(payload);
},
[activeAccountPlatform, setSyncStorage],
Expand Down Expand Up @@ -740,6 +744,7 @@ export default function Popup() {
[StorageKeys.GV_ACCOUNT_ISOLATION_ENABLED]: false,
[StorageKeys.GV_ACCOUNT_ISOLATION_ENABLED_GEMINI]: null,
[StorageKeys.GV_ACCOUNT_ISOLATION_ENABLED_AISTUDIO]: null,
[StorageKeys.GV_AISTUDIO_ENABLED]: true,
gvChatWidthEnabled: false,
gvEditInputWidthEnabled: false,
gvSidebarWidthEnabled: false,
Expand Down Expand Up @@ -786,6 +791,7 @@ export default function Popup() {
setPreventAutoScrollEnabled(res?.gvPreventAutoScrollEnabled === true);
setForkEnabled(res?.[StorageKeys.FORK_ENABLED] === true);
setUpsellHiderEnabled(res?.[StorageKeys.UPSELL_HIDER_ENABLED] === true);
setAiStudioEnabled(res?.[StorageKeys.GV_AISTUDIO_ENABLED] !== false);

// Width enabled flags — auto-enable if user previously customized the width
setChatWidthEnabled(
Expand Down Expand Up @@ -1115,6 +1121,32 @@ export default function Popup() {
</div>
</Card>
)}
{/* AI Studio master toggle - only shown when on AI Studio */}
{isAIStudio && (
<Card className="border-primary/20 p-4 transition-all hover:shadow-md">
<CardContent className="p-0">
<div className="group flex items-center justify-between">
<div className="flex-1">
<Label
htmlFor="aistudio-enabled"
className="group-hover:text-primary cursor-pointer text-sm font-medium transition-colors"
>
{t('enableOnAIStudio')}
</Label>
<p className="text-muted-foreground mt-1 text-xs">{t('enableOnAIStudioHint')}</p>
</div>
<Switch
id="aistudio-enabled"
checked={aiStudioEnabled}
onChange={(e) => {
setAiStudioEnabled(e.target.checked);
apply({ aiStudioEnabled: e.target.checked });
}}
/>
</div>
</CardContent>
</Card>
)}
{/* Cloud Sync - First priority - Hidden on Safari due to API limitations */}
{!isSafariBrowser && <CloudSyncSettings />}
{/* Context Sync */}
Expand Down
Loading