[PR #18256] [CLOSED] feat: add toggleable hotkey hints to sidebar buttons and refac ShortcutsModal #40358

Closed
opened 2026-04-25 12:51:58 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/18256
Author: @silentoplayz
Created: 10/12/2025
Status: Closed

Base: devHead: hotkey-hints-in-chats-sidebar


📝 Commits (2)

  • 5dbcef7 feat: add toggleable hotkey hints to sidebar buttons and refac ShortcutsModal
  • 9be8403 refac

📊 Changes

10 files changed (+511 additions, -466 deletions)

View changed files

📝 src/lib/components/chat/MessageInput.svelte (+6 -18)
📝 src/lib/components/chat/Settings/Interface.svelte (+21 -0)
src/lib/components/chat/ShortcutItem.svelte (+71 -0)
📝 src/lib/components/chat/ShortcutsModal.svelte (+77 -351)
src/lib/components/common/HotkeyHint.svelte (+39 -0)
📝 src/lib/components/layout/Sidebar.svelte (+8 -4)
📝 src/lib/i18n/locales/en-US/translation.json (+1 -0)
src/lib/shortcuts.ts (+178 -0)
📝 src/lib/stores/index.ts (+1 -0)
📝 src/routes/(app)/+layout.svelte (+109 -93)

📄 Description

Pull Request Checklist

Before submitting, make sure you've checked the following:

  • Target branch: Verify that the pull request targets the dev branch. Not targeting the dev branch may lead to immediate closure of the PR.
  • Description: Provide a concise description of the changes made in this pull request.
  • Changelog: Ensure a changelog entry following the format of Keep a Changelog is added at the bottom of the PR description.
  • Documentation: If necessary, update relevant documentation Open WebUI Docs like environment variables, the tutorials, or other documentation sources.
  • Dependencies: Are there any new dependencies? Have you updated the dependency versions in the documentation?
  • Testing: Perform manual tests to verify the implemented fix/feature works as intended AND does not break any other functionality. Take this as an opportunity to make screenshots of the feature/fix and include it in the PR description.
  • Agentic AI Code:: Confirm this Pull Request is not written by any AI Agent or has at least gone through additional human review and manual testing. If any AI Agent is the co-author of this PR, it may lead to immediate closure of the PR.
  • Code review: Have you performed a self-review of your code, addressing any coding standard issues and ensuring adherence to the project's coding standards?
  • Title Prefix: To clearly categorize this pull request, prefix the pull request title using one of the following:
    • BREAKING CHANGE: Significant changes that may affect compatibility
    • build: Changes that affect the build system or external dependencies
    • ci: Changes to our continuous integration processes or workflows
    • chore: Refactor, cleanup, or other non-functional code changes
    • docs: Documentation update or addition
    • feat: Introduces a new feature or enhancement to the codebase
    • fix: Bug fix or error correction
    • i18n: Internationalization or localization changes
    • perf: Performance improvement
    • refactor: Code restructuring for better maintainability, readability, or scalability
    • style: Changes that do not affect the meaning of the code (white space, formatting, missing semi-colons, etc.)
    • test: Adding missing tests or correcting existing tests
    • WIP: Work in progress, a temporary label for incomplete or ongoing work

Changelog Entry

Description

  • This pull request contains a complete overhaul of the keyboard shortcut system to improve functionality, reliability, and maintainability. It introduces a new, data-driven shortcuts modal that accurately reflects all available hotkeys, including situational commands and their required keys. Additionally, the underlying shortcut detection has been refactored to be more robust across different keyboard layouts.

Added

  • A fully data-driven Shortcuts Modal that dynamically renders all shortcuts from a central registry.
  • A Shortcut enum and a mapped ShortcutRegistry type in src/lib/shortcuts.ts for improved type-safety and code maintainability.
  • Previously missing shortcuts "New temporary chat" to the modal.
  • A two-column grid layout for the "Input Commands" section to match the "Keyboard Shortcuts" section for visual consistency.

Changed

  • Refactored the shortcut registry in src/lib/shortcuts.ts to use KeyboardEvent.code values (e.g., KeyK, Slash) instead of KeyboardEvent.key to ensure shortcuts work reliably across different keyboard layouts.
  • Updated the global shortcut handler in src/routes/(app)/+layout.svelte to use event.code for detection.
  • Updated the formatKey functions in ShortcutsModal.svelte and HotkeyHint.svelte to correctly translate keyboard codes back into user-friendly symbols (e.g., KeyK -> K, Slash -> /).
  • Re-categorized "Generate prompt pair" and "Stop Generating" to the "Input" category for better logical grouping in the modal.
  • Moved the disclaimer text about situational shortcuts to the bottom of the modal for improved readability.

Additional Information

Screenshots or Videos

Hotkey Hints on Windows/Linux:

image

Hotkey Hints on MacOS:

image

Refactored ShortcutsModal on Windows/Linux:

image

Refactored ShortcutsModal on MacOS:

image

New Show Sidebar Hotkey Hints toggle:

image

Contributor License Agreement

By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.


🔄 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/open-webui/open-webui/pull/18256 **Author:** [@silentoplayz](https://github.com/silentoplayz) **Created:** 10/12/2025 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `hotkey-hints-in-chats-sidebar` --- ### 📝 Commits (2) - [`5dbcef7`](https://github.com/open-webui/open-webui/commit/5dbcef7772c7c7012fb9f16f03f251bcdd69e53f) feat: add toggleable hotkey hints to sidebar buttons and refac ShortcutsModal - [`9be8403`](https://github.com/open-webui/open-webui/commit/9be8403f811b81c215543e18556f7b5f226f779b) refac ### 📊 Changes **10 files changed** (+511 additions, -466 deletions) <details> <summary>View changed files</summary> 📝 `src/lib/components/chat/MessageInput.svelte` (+6 -18) 📝 `src/lib/components/chat/Settings/Interface.svelte` (+21 -0) ➕ `src/lib/components/chat/ShortcutItem.svelte` (+71 -0) 📝 `src/lib/components/chat/ShortcutsModal.svelte` (+77 -351) ➕ `src/lib/components/common/HotkeyHint.svelte` (+39 -0) 📝 `src/lib/components/layout/Sidebar.svelte` (+8 -4) 📝 `src/lib/i18n/locales/en-US/translation.json` (+1 -0) ➕ `src/lib/shortcuts.ts` (+178 -0) 📝 `src/lib/stores/index.ts` (+1 -0) 📝 `src/routes/(app)/+layout.svelte` (+109 -93) </details> ### 📄 Description # Pull Request Checklist **Before submitting, make sure you've checked the following:** - [X] **Target branch:** Verify that the pull request targets the `dev` branch. Not targeting the `dev` branch may lead to immediate closure of the PR. - [X] **Description:** Provide a concise description of the changes made in this pull request. - [X] **Changelog:** Ensure a changelog entry following the format of [Keep a Changelog](https://keepachangelog.com/) is added at the bottom of the PR description. - [X] **Documentation:** If necessary, update relevant documentation [Open WebUI Docs](https://github.com/open-webui/docs) like environment variables, the tutorials, or other documentation sources. - [X] **Dependencies:** Are there any new dependencies? Have you updated the dependency versions in the documentation? - [X] **Testing:** Perform manual tests to verify the implemented fix/feature works as intended AND does not break any other functionality. Take this as an opportunity to make screenshots of the feature/fix and include it in the PR description. - [X] **Agentic AI Code:**: Confirm this Pull Request is **not written by any AI Agent** or has at least gone through additional human review **and** manual testing. If any AI Agent is the co-author of this PR, it may lead to immediate closure of the PR. - [X] **Code review:** Have you performed a self-review of your code, addressing any coding standard issues and ensuring adherence to the project's coding standards? - [X] **Title Prefix:** To clearly categorize this pull request, prefix the pull request title using one of the following: - **BREAKING CHANGE**: Significant changes that may affect compatibility - **build**: Changes that affect the build system or external dependencies - **ci**: Changes to our continuous integration processes or workflows - **chore**: Refactor, cleanup, or other non-functional code changes - **docs**: Documentation update or addition - **feat**: Introduces a new feature or enhancement to the codebase - **fix**: Bug fix or error correction - **i18n**: Internationalization or localization changes - **perf**: Performance improvement - **refactor**: Code restructuring for better maintainability, readability, or scalability - **style**: Changes that do not affect the meaning of the code (white space, formatting, missing semi-colons, etc.) - **test**: Adding missing tests or correcting existing tests - **WIP**: Work in progress, a temporary label for incomplete or ongoing work # Changelog Entry ### Description - This pull request contains a complete overhaul of the keyboard shortcut system to improve functionality, reliability, and maintainability. It introduces a new, data-driven shortcuts modal that accurately reflects all available hotkeys, including situational commands and their required keys. Additionally, the underlying shortcut detection has been refactored to be more robust across different keyboard layouts. ### Added - A fully data-driven **Shortcuts Modal** that dynamically renders all shortcuts from a central registry. - A `Shortcut` enum and a mapped `ShortcutRegistry` type in `src/lib/shortcuts.ts` for improved type-safety and code maintainability. - Previously missing shortcuts "New temporary chat" to the modal. - A two-column grid layout for the "Input Commands" section to match the "Keyboard Shortcuts" section for visual consistency. ### Changed - Refactored the shortcut registry in `src/lib/shortcuts.ts` to use `KeyboardEvent.code` values (e.g., `KeyK`, `Slash`) instead of `KeyboardEvent.key` to ensure shortcuts work reliably across different keyboard layouts. - Updated the global shortcut handler in `src/routes/(app)/+layout.svelte` to use `event.code` for detection. - Updated the `formatKey` functions in `ShortcutsModal.svelte` and `HotkeyHint.svelte` to correctly translate keyboard codes back into user-friendly symbols (e.g., `KeyK` -> `K`, `Slash` -> `/`). - Re-categorized "Generate prompt pair" and "Stop Generating" to the "Input" category for better logical grouping in the modal. - Moved the disclaimer text about situational shortcuts to the bottom of the modal for improved readability. ### Additional Information - This PR addresses https://github.com/open-webui/open-webui/issues/17015 and https://github.com/open-webui/open-webui/issues/1132. ### Screenshots or Videos ## Hotkey Hints on Windows/Linux: <img width="262" height="197" alt="image" src="https://github.com/user-attachments/assets/f40d3235-678b-48c5-8a01-676a1c69508f" /> ## Hotkey Hints on MacOS: <img width="265" height="196" alt="image" src="https://github.com/user-attachments/assets/e3adf429-52e7-4991-9271-8720af2098ec" /> ## Refactored ShortcutsModal on Windows/Linux: <img width="734" height="880" alt="image" src="https://github.com/user-attachments/assets/a7134d6d-d15a-4865-99f7-6f1aea1645e6" /> ## Refactored ShortcutsModal on MacOS: <img width="734" height="880" alt="image" src="https://github.com/user-attachments/assets/cb4d41ba-8385-4589-a940-890270376258" /> ## New `Show Sidebar Hotkey Hints` toggle: <img width="1152" height="707" alt="image" src="https://github.com/user-attachments/assets/9970b9ab-3555-45ee-83f1-1640ec76634a" /> ### Contributor License Agreement By submitting this pull request, I confirm that I have read and fully agree to the [Contributor License Agreement (CLA)](https://github.com/open-webui/open-webui/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT), and I am providing my contributions under its terms. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-25 12:51:58 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#40358