OpenRouter Chat Enhancements

Navigation hotkeys, message highlight, floating speaker, scroll protections, perfect collapse/expand handling, and enhanced edit scroll lock.

Auteur
na na
Nombre d'installations quotidiennes
0
Nombre d'installations
3
Évaluations
0 0 0
Version
1.4.0
Créer
2025-04-14
Mis à jour
2025-05-09
Taille
53,1 ko
Licence
MIT
S'applique à

This script enhances the OpenRouter chat interface with advanced navigation features including hotkeys, and message highlighting. It aims to address limitations of the default web chat experience on openrouter.ai/chat through improvements of the user interaction experience by making navigation more intuitive and efficient.

The script enhances navigation in the OpenRouter chat interface with features like:

  • Highlighting messages, editing with e, refreshing with r
  • Scrolling to the top or bottom of messages
  • Expanding/collapsing message content
  • Displaying a floating speaker indicator

Features:

  1. Hotkey Navigation:

    • Supports customizable modifier keys (AltCtrl, or None) for navigation actions. Modifier is Alt by default (configurable from the userscript's context menu)
    • Key bindings like j/k for moving to the next/previous message, h/l for expanding/collapsing messages, and Home/End for scrolling to the top/bottom of a message. Ctrl+i focuses the main chat input field.
  2. Message Highlighting:

    • Highlights the currently active message with a visible outline and glow effect.
    • Automatically updates the highlight based on scroll position (with anti-hysteresis to prevent flickering).
  3. Floating Speaker Indicator:

    • Displays a floating panel at the top center showing the speaker's name and avatar when a message is highlighted.
    • Enhances visibility of who is speaking without needing to scroll back to the message header.
  4. Floating Control Panel:

    • Adds a fixed panel at the bottom-right with buttons for navigation (previous/next message, top/bottom scroll, expand/collapse).
    • Can be toggled on/off via a menu command.
    • Responsive design adjusts for smaller screens.
  5. Scroll Protections:

    • Prevents unintended scrolling away from a message during editing or input actions (e.g., paste, cut).
    • Locks scroll position to the active message for a short duration after edits.
  6. Expand/Collapse Handling:

    • Robust handling of message expansion/collapse with scroll position restoration to maintain visual context.
    • Prevents jarring jumps when toggling message visibility.
  7. Edit Scroll Lock:

    • Ensures the scroll stays on the message being edited, preventing accidental navigation away during input.
长期地址
遇到问题?请前往 GitHub 提 Issues。