Grok Chat Navigation Improvements

Keyboard navigation and message interaction for Grok chat

Fra 25.04.2025. Se den seneste versjonen.

Forfatter
na na
Vurderinger
0 0 0
Versjon
1.0
Lagd
25.04.2025
Oppdatert
25.04.2025
Size
13,6 kB
Lisens
MIT
Gjelder

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.
  • 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.
  • Escape Key Functionality:

    • Press Escape to deselect messages, 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.
长期地址
遇到问题?请前往 GitHub 提 Issues。