Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Chat History Top/Bottom Scroll With Keybindings#4866

Closed
angelplusultra wants to merge 2 commits intomasterfrom
4845-keyboard-shortcuts-to-navigate-in-chat
Closed

Chat History Top/Bottom Scroll With Keybindings#4866
angelplusultra wants to merge 2 commits intomasterfrom
4845-keyboard-shortcuts-to-navigate-in-chat

Conversation

@angelplusultra
Copy link
Contributor

Pull Request Type

  • ✨ feat

Relevant Issues

resolves #4845

What is in this change?

Adds keyboard shortcuts to navigate chat history: Ctrl/Cmd + Up Arrow scrolls to the top of the chat history, and Ctrl/Cmd + Down Arrow scrolls to the bottom. These shortcuts work from anywhere in the chat container (not just when focused on the prompt input) and preserve the existing auto-scroll behavior during message streaming.

Key Features:

  • Keyboard shortcuts: Ctrl/Cmd + Up and Ctrl/Cmd + Down for quick navigation
  • Cross-platform support: Automatically detects Mac (Cmd) vs Windows/Linux (Ctrl)
  • Smooth scrolling: Both directions use smooth scroll animations for better UX
  • Auto-scroll preservation: Does not interfere with existing auto-scroll logic that scrolls to bottom when prompts are sent and during response streaming

Technical Implementation:

  • Converted ChatHistory component to use forwardRef to expose scroll methods
  • Added isProgrammaticScroll flag to distinguish keyboard-triggered scrolls from user-initiated scrolls
  • Modified auto-scroll effect to skip during programmatic scrolls to prevent conflicts
  • Updated scroll handler to ignore programmatic scrolls when detecting user scrolling state
  • When scrolling to bottom via keyboard, automatically re-enables auto-scroll for streaming responses

Developer Validations

  • I ran yarn lint from the root of the repo & committed changes
  • Relevant documentation has been updated (N/A - no user-facing docs needed)
  • I have tested my code functionality
  • Docker build succeeds locally (N/A - frontend-only changes)

@angelplusultra angelplusultra linked an issue Jan 15, 2026 that may be closed by this pull request
@angelplusultra angelplusultra changed the title Enhance chat functionality with keyboard shortcuts for scrolling to t… Chat History Top/Bottom Scroll With Keybindings Jan 15, 2026
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.

[FEAT]: Keyboard shortcuts to navigate in chat

1 participant