Grok Chat Navigation Improvements

Keyboard navigation and message interaction for Grok chat

À partir de 2025-04-29. Voir la dernière version.

Auteur
na na
Évaluations
0 0 0
Version
1.2
Créer
2025-04-25
Mis à jour
2025-04-29
Taille
19,4 ko
Licence
MIT
S'applique à

Grok Chat Navigation Improvements

This userscript enhances the accessibility and usability of the Grok chat interface by adding keyboard navigation and interaction capabilities. It allows users to easily select, edit, copy, and regenerate chat messages using intuitive keyboard shortcuts, making the chat more accessible and efficient.

Features

  • Keyboard Navigation:

    • Navigate through chat messages using j (down), k (up), Home, and End keys. Ctrl+I to focus the main chat input field.
  • Message Interaction:

    • Edit (e), copy (c), or regenerate (r) selected messages with keyboard shortcuts.
    • Enhanced cursor control in editing mode with Ctrl+Home and Ctrl+End.
    • Quickly go to the last or the first chat message by quickly double tapping End and/or Home, respectively.
  • Escape Key Functionality:

    • Press Escape to deselect messages, defocus input, cancel editing, or toggle the aside panel for messages with code.
  • Mouse Interaction:

    • Click a message to select it; click outside to deselect.
  • Scroll Handling:

    • Automatically adjusts selection and scrolls to keep the selected message in view.

Installation

  1. Install a userscript manager like Tampermonkey for Chrome or Firefox.
  2. Click the Tampermonkey icon in your browser and select "Create a new script."
  3. Copy and paste the entire script code into the editor.
  4. Save the script with "File" > "Save" or Ctrl+S.
  5. The script will activate on the Grok chat page (https://grok.com/*).

Usage

Navigation

  • j or ArrowDown: Select the next message.
  • k or ArrowUp: Select the previous message.
  • Home: Jump to the first message.
  • End: Jump to the last message (scrolls to bottom with offset).

Interaction

  • With a message selected:
    • e: Edit the message.
    • c: Copy the message.
    • r: Regenerate the message.
  • While editing:
    • Ctrl+Home: Move cursor to start.
    • Ctrl+End: Move cursor to end.
    • Escape: Cancel editing.

Deselection and Panel Control

  • Escape: Deselect the current message, cancel editing, or toggle the aside panel.

Mouse Interaction

  • Click a message to select it.
  • Click outside messages to deselect.

Compatibility

  • Works on the Grok chat interface at https://grok.com/*.
  • Tested with Tampermonkey on Chrome and Firefox.

License

Released under the MIT License. See script header for details.

Author

  • cdr-x

    Changelog

  • Version 1.0:

    • Initial release with keyboard navigation and interaction features.