[PR #4870] [MERGED] Add keyboard shortcuts to scroll to top and bottom of chat history #4796

Closed
opened 2026-02-22 18:36:33 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Mintplex-Labs/anything-llm/pull/4870
Author: @angelplusultra
Created: 1/16/2026
Status: Merged
Merged: 1/26/2026
Merged by: @timothycarambat

Base: masterHead: 4845-keyboard-shortcuts-to-jump-to-top-and-bottom-of-chat-history


📝 Commits (9)

  • ebc6c75 Add keybindings to scroll to top and bottom of chat history
  • fdb4a2b fix isUserScrolling flag and set scrollToBottom to be instant instead of smoothe
  • b330412 fix stream scroll
  • 79e47bc fix default export by removing unneeded constant
  • feb8d62 Replace file-defined isMac variable with global util
  • 2dfcc4c Merge branch 'master' into 4845-keyboard-shortcuts-to-jump-to-top-and-bottom-of-chat-history
  • 16fa5e8 extract funcitonality to hooks for clarity
  • 12f0ec2 patch import
  • 989534c Merge branch 'master' into 4845-keyboard-shortcuts-to-jump-to-top-and-bottom-of-chat-history

📊 Changes

4 files changed (+116 additions, -12 deletions)

View changed files

📝 frontend/src/components/WorkspaceChat/ChatContainer/ChatHistory/index.jsx (+29 -12)
📝 frontend/src/components/WorkspaceChat/ChatContainer/index.jsx (+3 -0)
frontend/src/hooks/useChatContainerQuickScroll.js (+46 -0)
frontend/src/hooks/useChatHistoryScrollHandle.js (+38 -0)

📄 Description

Pull Request Type

  • feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 🔨 chore
  • 📝 docs

Relevant Issues

resolves #4845

What is in this change?

This PR adds keyboard shortcuts to quickly navigate the chat history:

  • Ctrl/Cmd + ↑ scrolls to the top of the chat
  • Ctrl/Cmd + ↓ scrolls to the bottom of the chat
  • Platform-aware modifier key detection (Cmd on macOS, Ctrl on Windows/Linux)

Implementation details:

  • Converted ChatHistory component to use forwardRef to enable parent component control (ChatHistory/index.jsx:28-38)
  • Added useImperativeHandle hook to expose scrollToTop and scrollToBottom methods (ChatHistory/index.jsx:95-109)
  • Implemented keyboard event listener in ChatContainer with platform detection (ChatContainer/index.jsx:37-56)
  • Both shortcuts use smooth scrolling for better UX

Additional Information

This enhancement improves navigation UX for users with long chat histories, allowing quick jumps to the beginning or end of conversations without manual scrolling.

Developer Validations

  • I ran yarn lint from the root of the repo & committed changes
  • Relevant documentation has been updated
  • I have tested my code functionality
  • Docker build succeeds locally

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Mintplex-Labs/anything-llm/pull/4870 **Author:** [@angelplusultra](https://github.com/angelplusultra) **Created:** 1/16/2026 **Status:** ✅ Merged **Merged:** 1/26/2026 **Merged by:** [@timothycarambat](https://github.com/timothycarambat) **Base:** `master` ← **Head:** `4845-keyboard-shortcuts-to-jump-to-top-and-bottom-of-chat-history` --- ### 📝 Commits (9) - [`ebc6c75`](https://github.com/Mintplex-Labs/anything-llm/commit/ebc6c755438b689991743002cec262c0b211cadf) Add keybindings to scroll to top and bottom of chat history - [`fdb4a2b`](https://github.com/Mintplex-Labs/anything-llm/commit/fdb4a2bed0d6a5437ddc7b4527849155e4608ff3) fix isUserScrolling flag and set scrollToBottom to be instant instead of smoothe - [`b330412`](https://github.com/Mintplex-Labs/anything-llm/commit/b3304127e6c0723d7126fb7abf57ab757de2966a) fix stream scroll - [`79e47bc`](https://github.com/Mintplex-Labs/anything-llm/commit/79e47bc886652294f9b76cb937a22e5f7c14ee0e) fix default export by removing unneeded constant - [`feb8d62`](https://github.com/Mintplex-Labs/anything-llm/commit/feb8d620db2c0118805da5f0debfbf71d1896e61) Replace file-defined `isMac` variable with global util - [`2dfcc4c`](https://github.com/Mintplex-Labs/anything-llm/commit/2dfcc4c951b3482823da2a837afb0e74144678df) Merge branch 'master' into 4845-keyboard-shortcuts-to-jump-to-top-and-bottom-of-chat-history - [`16fa5e8`](https://github.com/Mintplex-Labs/anything-llm/commit/16fa5e86488e15b048a3df938517fa483c3397c7) extract funcitonality to hooks for clarity - [`12f0ec2`](https://github.com/Mintplex-Labs/anything-llm/commit/12f0ec260a8536703be394f4d9c1ae44de380628) patch import - [`989534c`](https://github.com/Mintplex-Labs/anything-llm/commit/989534cd17f93847a861c26b912584b7f5893488) Merge branch 'master' into 4845-keyboard-shortcuts-to-jump-to-top-and-bottom-of-chat-history ### 📊 Changes **4 files changed** (+116 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `frontend/src/components/WorkspaceChat/ChatContainer/ChatHistory/index.jsx` (+29 -12) 📝 `frontend/src/components/WorkspaceChat/ChatContainer/index.jsx` (+3 -0) ➕ `frontend/src/hooks/useChatContainerQuickScroll.js` (+46 -0) ➕ `frontend/src/hooks/useChatHistoryScrollHandle.js` (+38 -0) </details> ### 📄 Description ### Pull Request Type <!-- For change type, change [ ] to [x]. --> - [x] ✨ feat - [ ] 🐛 fix - [ ] ♻️ refactor - [ ] 💄 style - [ ] 🔨 chore - [ ] 📝 docs ### Relevant Issues <!-- Use "resolves #xxx" to auto resolve on merge. Otherwise, please use "connect #xxx" --> resolves #4845 ### What is in this change? This PR adds keyboard shortcuts to quickly navigate the chat history: - **Ctrl/Cmd + ↑** scrolls to the top of the chat - **Ctrl/Cmd + ↓** scrolls to the bottom of the chat - Platform-aware modifier key detection (Cmd on macOS, Ctrl on Windows/Linux) **Implementation details:** - Converted `ChatHistory` component to use `forwardRef` to enable parent component control (ChatHistory/index.jsx:28-38) - Added `useImperativeHandle` hook to expose `scrollToTop` and `scrollToBottom` methods (ChatHistory/index.jsx:95-109) - Implemented keyboard event listener in `ChatContainer` with platform detection (ChatContainer/index.jsx:37-56) - Both shortcuts use smooth scrolling for better UX ### Additional Information This enhancement improves navigation UX for users with long chat histories, allowing quick jumps to the beginning or end of conversations without manual scrolling. ### Developer Validations <!-- All of the applicable items should be checked. --> - [x] I ran `yarn lint` from the root of the repo & committed changes - [x] Relevant documentation has been updated - [x] I have tested my code functionality - [x] Docker build succeeds locally --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-22 18:36:33 -05:00
yindo closed this issue 2026-02-22 18:36:33 -05:00
yindo changed title from [PR #4870] Add keyboard shortcuts to scroll to top and bottom of chat history to [PR #4870] [MERGED] Add keyboard shortcuts to scroll to top and bottom of chat history 2026-06-05 15:20:25 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#4796