Skip to content

Add Google AI Studio shortcut#229

Open
Yurii201811 wants to merge 2 commits into
prem-k-r:mainfrom
Yurii201811:feature/google-ai-studio-tool
Open

Add Google AI Studio shortcut#229
Yurii201811 wants to merge 2 commits into
prem-k-r:mainfrom
Yurii201811:feature/google-ai-studio-tool

Conversation

@Yurii201811

@Yurii201811 Yurii201811 commented Jun 21, 2026

Copy link
Copy Markdown

📌 Description

Adds Google AI Studio as an AI Tools shortcut linking to https://aistudio.google.com/prompts/new_chat.

The shortcut is hidden by default, matching the existing optional AI tools pattern, and existing saved AI Tools settings now append newly-added default tools so current users can opt into Google AI Studio without resetting their existing order.

🎨 Visual Changes (Screenshots / Videos)

No screenshot attached from this environment. The visible change is one additional hidden-by-default AI Tools option that appears in the AI Tools settings list and can be enabled by the user.

🔗 Related Issues

✅ Checklist

  • I have read and followed the Contributing Guidelines.
  • My code follows the project's coding style and conventions.
  • I have tested my changes thoroughly to ensure expected behavior.
    • Static checks run: git diff --check, node --check scripts/ai-tools.js, node --check scripts/languages.js, and a repository consistency check for the new tool id/link.
  • I have verified compatibility across Chrome and Firefox (additional browsers if applicable).
  • I have attached relevant visual evidence (screenshots/videos) if applicable.
  • I have updated the CHANGELOG.md under the appropriate categories with all my changes in this PR.

🤖 AI Assistance (Coding)

  • None
  • Ideas / planning
  • Debugging / review help
  • Small code snippets
  • Partial implementation
  • Major implementation help
  • Mostly AI-generated
  • Full vibe coded

Summary

This PR adds Google AI Studio as a new AI Tools shortcut linking to https://aistudio.google.com/prompts/new_chat. It integrates with the existing optional AI tools system so the shortcut is hidden by default and can be enabled via AI Tools settings, while ensuring current users’ saved tool preferences are preserved.

Changes

CHANGELOG.md

  • Added an Unreleased entry documenting Google AI Studio in the AI Tools shortcuts list.

index.html

  • Added a new “Google AI Studio” tile/link (inline SVG icon and destination URL) in the AI tools section.
  • Adjusted closing HTML tag whitespace/position.

locales/en.js

  • Added the googleAIStudio localization string with value “Google AI Studio”.

scripts/ai-tools.js

  • Extended the AI tools catalog (aiToolsRaw) to include Google AI Studio, including default visibility/order changes.
  • Added helpers to:
    • compute default per-tool visibility
    • extract a tool id from either string or object entries
    • merge saved settings with defaults so newly introduced tools are appended without disrupting existing user order/preferences
  • Updated applyAIToolsSettings() and showAIToolsSettings() to always merge saved settings with defaults, and to avoid rewriting localStorage unless merged settings differ from the previously loaded ones.
  • Refactored tool rendering and settings form generation to use the shared id/visibility helpers.
  • Updated the reset handler to use the shared default-settings helper.

scripts/languages.js

  • Added googleAIStudio to the translationMap so language switching populates the new AI tools UI text.

Implementation Notes

  • Follows the existing AI tools pattern: Google AI Studio is opt-in via the AI Tools settings UI.
  • Preserves existing saved AI Tools settings by merging defaults with saved tool entries rather than overwriting user configuration.

@coderabbitai

coderabbitai Bot commented Jun 21, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6530226d-b25b-414d-a3e2-0eb67d9731d5

📥 Commits

Reviewing files that changed from the base of the PR and between 4822de5 and 2b0c08b.

📒 Files selected for processing (1)
  • scripts/ai-tools.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • scripts/ai-tools.js

📝 Walkthrough

Walkthrough

Adds Google AI Studio as a new toggleable AI tool: inserts its catalog entry in aiToolsRaw, HTML anchor tile with SVG icon, English localization string, and language mapping key. Concurrently refactors scripts/ai-tools.js by extracting three shared helper functions (createDefaultAIToolsSettings, getAIToolId, mergeAIToolsSettings) and updating all settings apply, render, and reset paths to use them.

Changes

Add Google AI Studio to AI Tools

Layer / File(s) Summary
Google AI Studio tile, catalog entry, and localization
scripts/ai-tools.js, index.html, locales/en.js, scripts/languages.js, CHANGELOG.md
Inserts googleAIStudio into aiToolsRaw (order indices of subsequent tools updated), adds the anchor/SVG tile in the HTML tools grid, adds the googleAIStudio English i18n string, registers the key in translationMap, and adds a changelog entry.
Settings helper functions and refactored call sites
scripts/ai-tools.js
Adds createDefaultAIToolsSettings(), getAIToolId(), and mergeAIToolsSettings() helpers. Updates applyAIToolsSettings() to always merge saved settings and conditionally rewrite localStorage, simplifies DOM rendering and settings modal generation to use getAIToolId, normalizes settings in showAIToolsSettings() via merge, and replaces the reset handler's inline default-building with createDefaultAIToolsSettings().

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

enhancement

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 62.50% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: adding Google AI Studio as a shortcut to the AI tools section.
Description check ✅ Passed The description covers the main objective, provides context about the hidden-by-default pattern, explains the settings merging approach, and references the related issue #177.
Linked Issues check ✅ Passed All code changes directly fulfill issue #177's requirement to add Google AI Studio (https://aistudio.google.com/prompts/new_chat) as a toggleable AI tool shortcut.
Out of Scope Changes check ✅ Passed All changes are scoped to implementing the Google AI Studio feature: UI addition, localization, default tool configuration, and settings management refactoring to support proper tool inheritance.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/ai-tools.js`:
- Around line 53-64: The mergeAIToolsSettings function accepts and preserves all
saved settings without validating them against known tool IDs from aiToolsRaw,
allowing stale or malformed entries to persist. Before calculating
missingSettings, filter the savedSettings array to only include entries whose
tool IDs (obtained via getAIToolId) exist in the aiToolsRaw reference data, then
proceed with appending the missing defaults as currently done. This ensures only
valid and known tool IDs are retained in the merged result.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 63ea0788-2d9b-42ce-97fc-5bb2967f5748

📥 Commits

Reviewing files that changed from the base of the PR and between 6f22d9d and 4822de5.

📒 Files selected for processing (5)
  • CHANGELOG.md
  • index.html
  • locales/en.js
  • scripts/ai-tools.js
  • scripts/languages.js

Comment thread scripts/ai-tools.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Add google Ai studio as an ai tool

1 participant