feat: scroll the message list with PageUp/PageDown#3738
Conversation
Add keyboard paging over the conversation view. The input box is usually focused, so the browser won't scroll the Virtuoso message container on its own; drive it explicitly via the VirtuosoHandle already exposed on uiStore (messageScrolling), scrolling by ~90% of the viewport height with an instant jump (matches native PageUp/PageDown). Also surface the shortcut in Settings > Hotkeys as two read-only rows (kept hardcoded like the other non-configurable shortcuts, e.g. mod+1-9) and add the 'Page Up'/'Page Down' key labels plus en/zh-Hans/zh-Hant translations. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Thanks for the PR. I checked the diff and tried applying it locally. The patch is mergeable and Main blocker: the new PageUp/PageDown handler is registered on global Suggested fix: only handle PageUp/PageDown when the active context is the chat page/message input/body, and explicitly skip dialogs/modals plus One more project-specific issue: this PR hand-edits |
Description
Adds keyboard paging over the conversation view via PageUp / PageDown.
On desktop the input box is usually focused, so the browser never scrolls the (react-virtuoso) message container on its own when these keys are pressed. This wires them up to scroll the conversation explicitly, driving the
VirtuosoHandlealready exposed onuiStore(messageScrolling). Each press scrolls by ~90% of the viewport height as an instant jump, matching native PageUp/PageDown. The keys don't conflict with text input, so they work regardless of focus.The shortcut is also surfaced in Settings → Hotkeys as two read-only rows ("Scroll Up / Down the Message List"), kept hardcoded like the other non-configurable shortcuts (e.g.
mod+1-9). AddedPage Up/Page Downkey labels toformatKey, plusen/zh-Hans/zh-Hanttranslations.Files changed:
src/renderer/hooks/useShortcut.tsx— PageUp/PageDown handler driving theVirtuosoHandlesrc/renderer/components/Shortcut.tsx— two read-only Hotkeys rows +Page Up/Page Downlabelssrc/renderer/i18n/locales/{en,zh-Hans,zh-Hant}/translation.json— new stringsAdditional Notes
useShortcut, so it isn't user-rebindable.fallbackLng: 'en') and can be filled in later by the existing translation pipeline.Screenshots
N/A — keyboard-only interaction. The only visual change is two read-only rows added to Settings → Hotkeys.
Contributor Agreement
By submitting this Pull Request, I confirm that I have read and agree to the following terms:
Please check the box below to confirm:
[x] I have read and agree with the above statement.