A highly configurable, auto-hiding, lockable, slide-out panel that remembers its position, with draggable prompts, themes, import/export, and more for Gemini.
The Gemini Prompt Panel is a browser extension that enhances the user experience on the Gemini website by adding a versatile and feature-rich slide-out panel. The primary motivation behind this extension is to boost productivity by providing quick access to frequently used prompts and actions, while being unobtrusive. The core purpose is to offer a highly customizable and persistent interface for managing and using prompts efficiently.
- What it does: Adds a panel that can be positioned on the left or right side of the screen.
- How it improves the target interface: The panel can be locked in place or set to auto-hide, ensuring it doesn't obstruct the main content while remaining easily accessible.
- Example usage:
// The panel's position and visibility are managed through CSS classes .gemini-prompt-panel.left-side { left: 0; } .gemini-prompt-panel.right-side { right: 0; } .gemini-prompt-panel.visible { transform: translateX(0); }
- What it does: Allows users to create, save, and manage a list of custom prompts.
- How it improves the target interface: Users can quickly insert pre-defined text into the Gemini prompt input, with an option to automatically send the prompt.
- Example usage:
// Default prompts array const DEFAULT_PROMPTS = [ { name: 'Explain Code', text: 'Explain this code line by line:', autoSend: false }, { name: 'Refactor Code', text: 'Refactor this code to be more efficient:', autoSend: true } ];
- What it does: The order of the prompt buttons can be rearranged via drag and drop.
- How it improves the target interface: This allows users to prioritize and organize their prompts for a more personalized and efficient workflow.
- What it does: The panel supports light, dark, and auto-detect themes.
- How it improves the target interface: This ensures the panel's appearance is consistent with the Gemini website's theme or the user's preference, providing a seamless visual experience.
- What it does: Users can import prompts from a JSON file, export their current prompts to a backup file, and reset the prompts to the default settings.
- How it improves the target interface: This makes it easy to share prompt collections and manage custom prompts across different browsers or installations.
- A modern web browser that supports userscripts (e.g., Chrome, Firefox, Edge).
- A userscript manager extension such as Tampermonkey or Greasemonkey.
- Install a Userscript Manager: If you don't have one, install a userscript manager like Tampermonkey for your browser.
- Install the Script:
- Navigate to the
Gemini-Prompt-Panel-10.6.user.jsfile in this repository. - Click the "Raw" button to view the raw file content.
- Your userscript manager should automatically detect the userscript and prompt you to install it.
- Click "Install" to add the Gemini Prompt Panel to your browser.
- Navigate to the
- Developer Mode (for local development):
- Clone this repository to your local machine.
- Open the Tampermonkey dashboard in your browser.
- Go to the "Utilities" tab.
- Under "File", use "Choose File" to import the
Gemini-Prompt-Panel-10.6.user.jsfrom your local clone.
Once installed, the Gemini Prompt Panel will automatically appear on the Gemini website (https://gemini.google.com/*).
- Activation: Hover your mouse over the handle on the left or right edge of the screen to reveal the panel.
- Locking: Click the lock icon in the panel header to keep the panel permanently visible.
- Using Prompts: Click on any prompt button to insert its text into the Gemini input field. If 'auto-send' is enabled for that prompt, it will also be submitted automatically.
- Adding a New Prompt: Click the "Add New Prompt" button to open a form where you can define a new prompt.
The panel's settings can be accessed by clicking the gear icon in the header.
- Theme: Choose between "Auto", "Light", and "Dark" themes.
- Panel Position: Set the panel to appear on the "Left" or "Right" side of the screen.
- Prompt Management:
- Import: Import prompts from a
.jsonfile. - Export: Export your current prompts to a
gemini-prompts-backup.jsonfile. - Reset: Reset your prompts to the default settings.
- Import: Import prompts from a
Settings and prompts are stored in your browser's local storage using the following keys:
gemini_custom_prompts_v2gemini_panel_themegemini_panel_positiongemini_panel_position_top
(Here you would include screenshots or animated GIFs of the panel in action, for example: )
Gemini-Prompt-Panel-10.6.user.js: The main userscript file containing all the JavaScript code for the extension.README.md: The file you are currently reading.
- UI Builder (
build...functions): A set of functions responsible for creating the HTML elements for the panel, settings modal, and prompt form. - State Manager: The script uses global variables and
GM_setValue/GM_getValueto manage the state of prompts, theme, and panel position. - Event Handlers: Various event listeners for mouse interactions (click, drag, hover), and a
MutationObserverto detect when new code blocks or responses are added to the page.
- Parameters: None
- Return value:
void - Purpose: The main function that initializes and builds the entire prompt panel, appends it to the DOM, and sets up all event listeners.
- Parameters:
text(string): The prompt text to be inserted.sendPrompt(boolean): Iftrue, the prompt is automatically sent.
- Return value:
void - Purpose: Injects the prompt text into the Gemini chat input and optionally clicks the send button.
- Parameters: None
- Return value:
void - Purpose: Saves the current array of prompts to the browser's storage using
GM_setValue.
- Parameters: None
- Return value:
void - Purpose: Loads the prompts from storage using
GM_getValue, populates the panel with the prompt buttons.
- Please use the GitHub issue tracker for this repository.
- When reporting a bug, include your browser and userscript manager versions, and provide steps to reproduce the issue.
- Fork the repository and create a new branch for your feature or bug fix.
- Follow the existing coding style.
- Submit a pull request with a clear description of your changes.
- The project follows a standard JavaScript coding style.
- Use meaningful variable and function names.
- Comment complex sections of code.
- Initial release of the Gemini Prompt Panel.
This project is licensed under the MIT License.
This userscript is not officially affiliated with, endorsed by, or in any way associated with Google or the Gemini project. It is an independent, open-source tool created to enhance the user experience.