[PR #13813] [CLOSED] feat: Add the ability for any user to edit their own shortcuts in the settings modal #46342

Closed
opened 2026-04-29 21:06:49 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/13813
Author: @edmcquinn
Created: 5/12/2025
Status: Closed

Base: devHead: dev


📝 Commits (4)

📊 Changes

4 files changed (+1664 additions, -1371 deletions)

View changed files

src/lib/components/chat/Settings/Shortcuts.svelte (+361 -0)
📝 src/lib/components/chat/SettingsModal.svelte (+781 -739)
📝 src/lib/components/chat/ShortcutsModal.svelte (+184 -318)
📝 src/routes/(app)/+layout.svelte (+338 -314)

📄 Description

Pull Request Checklist

Note to first-time contributors: Please open a discussion post in Discussions and describe your changes before submitting a pull request.

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

  • Target branch: Please verify that the pull request targets the dev branch.
  • 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: Have you updated relevant documentation Open WebUI Docs, or other documentation sources?
  • Dependencies: Are there any new dependencies? Have you updated the dependency versions in the documentation?
  • Testing: Have you written and run sufficient tests to validate the changes?
  • 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?
  • 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 update introduces customizable keyboard shortcut settings designed to enhance user experience, particularly for those who rely heavily on keyboard navigation and for whom this application is a critical daily tool. Recognizing the need for greater accessibility and personalization in a frequently used interface, this feature allows users to tailor a wide range of common actions to their preferred key combinations.

Key aspects include:

Full Customization: A dedicated shortcut section of the settings modal empowers users to redefine default shortcuts, choosing 2 or 3-key combinations for actions like opening new chats, focusing inputs, copying content, toggling UI elements, and more.
Dynamic Handling: The application now globally recognizes and applies these user-defined shortcuts, falling back to sensible defaults if no customization is present.
Clear Visibility: An updated "Show Shortcuts" modal dynamically displays the currently active key combinations (whether custom or default), ensuring users always have a quick reference.
Improved Workflow: By allowing users to set up shortcuts that best fit their workflow and accessibility needs, this feature aims to make daily interaction with the application faster, more efficient, and more comfortable.
This enhancement directly addresses the desire for a more accessible and user-centric interface, putting more control into the hands of the user for an application that plays a significant role in their daily tasks.

Added

  • Customizable Keyboard Shortcuts Feature:
    • New settings panel allowing users to customize keyboard shortcuts for various actions.
      • Users can define 3 key combinations for the shortcuts (e.g., Ctrl/⌘ + Shift + K).
      • Input fields dynamically adjust based on maxParts definition 3 keys per shortcut).
      • UI allows adding a third key part if maxParts is 3 and two keys are present.
      • UI allows removing only the third key part if present.
      • Validation ensures at least two keys are provided if a shortcut is customized.
      • Validation prevents duplicate shortcut combinations across different actions.
      • Validation requires a non standard key to be the start of the hotkey to prevent the user from using a regular letter or number at the start of the hotkey.
      • Option to reset individual shortcuts to their default key combinations.
      • Ability to clear all inputs for a shortcut to revert it to its default on save.
    • Global keyboard shortcut handler integrated into the main application layout.
      • Dynamically applies user-defined shortcuts from settings.
      • Falls back to default shortcuts if no customization exists for a specific action.
      • Handles a comprehensive list of actions including: Open new chat, Focus chat input, Copy last code block, Copy last response, Toggle sidebar, Delete chat, Toggle settings, Show shortcuts modal, and Toggle temporary chat.
    • "Show Shortcuts" modal now dynamically displays current shortcut key combinations.
      • Reflects user customizations from settings.
      • Falls back to default key combinations if not customized.
      • Organized into a two-column layout for readability.

Changed

  • Keyboard Shortcut Handling:
    • Replaced hardcoded keyboard event listeners in the main application layout with a centralized, dynamic shortcut handling system.
  • Settings Structure:
    • Ensured the application's settings store ($settings.shortcuts) is the source of truth for custom shortcut configurations, used by the configuration panel, global handler, and display modal. Defaults are stored in each of these files though to maintain a non breaking change. So it checks to see if there is anything in settings.shortcuts for that key is there is not it will use the hardcoded defaults for the project.

Deprecated

  • [List any deprecated functionality or features that have been removed]

Removed

  • NA

Fixed

  • NA

Security

  • NA

Breaking Changes

  • BREAKING CHANGE: NA

Additional Information

  • [Insert any additional context, notes, or explanations for the changes]
    • [Reference any related issues, commits, or other relevant information]

Screenshots or Videos

New settings for shortcuts:

CleanShot 2025-05-12 at 10 48 34@2x

Showing that the shortcut modal menu (within the ? help in the bottom right) shows the user edited keys if they are changed if not it defaults to the projects hardcoded defaults:

CleanShot 2025-05-12 at 10 49 26@2x

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/13813 **Author:** [@edmcquinn](https://github.com/edmcquinn) **Created:** 5/12/2025 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `dev` --- ### 📝 Commits (4) - [`240f98b`](https://github.com/open-webui/open-webui/commit/240f98bb21d3562be248b8664e95bbef766aac5f) Add the ability to edit keyboard shortcuts - [`4d79efe`](https://github.com/open-webui/open-webui/commit/4d79efe0f16dda89ec28f28965a06e0c29ef8c14) Merge branch 'open-webui:dev' into dev - [`2c520b8`](https://github.com/open-webui/open-webui/commit/2c520b8fdbdeea057bca18989e945ce23fea06f9) Added + svg - [`40ed4b6`](https://github.com/open-webui/open-webui/commit/40ed4b6df9ff407270b2a27ecc7ec16e9ca15dc1) Merge branch 'dev' of https://github.com/edmcquinn/open-webui into dev ### 📊 Changes **4 files changed** (+1664 additions, -1371 deletions) <details> <summary>View changed files</summary> ➕ `src/lib/components/chat/Settings/Shortcuts.svelte` (+361 -0) 📝 `src/lib/components/chat/SettingsModal.svelte` (+781 -739) 📝 `src/lib/components/chat/ShortcutsModal.svelte` (+184 -318) 📝 `src/routes/(app)/+layout.svelte` (+338 -314) </details> ### 📄 Description # Pull Request Checklist ### Note to first-time contributors: Please open a discussion post in [Discussions](https://github.com/open-webui/open-webui/discussions) and describe your changes before submitting a pull request. **Before submitting, make sure you've checked the following:** - [X] **Target branch:** Please verify that the pull request targets the `dev` branch. - [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:** Have you updated relevant documentation [Open WebUI Docs](https://github.com/open-webui/docs), or other documentation sources? - [X] **Dependencies:** Are there any new dependencies? Have you updated the dependency versions in the documentation? - [X] **Testing:** Have you written and run sufficient tests to validate the changes? - [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] **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 update introduces customizable keyboard shortcut settings designed to enhance user experience, particularly for those who rely heavily on keyboard navigation and for whom this application is a critical daily tool. Recognizing the need for greater accessibility and personalization in a frequently used interface, this feature allows users to tailor a wide range of common actions to their preferred key combinations. Key aspects include: Full Customization: A dedicated shortcut section of the settings modal empowers users to redefine default shortcuts, choosing 2 or 3-key combinations for actions like opening new chats, focusing inputs, copying content, toggling UI elements, and more. Dynamic Handling: The application now globally recognizes and applies these user-defined shortcuts, falling back to sensible defaults if no customization is present. Clear Visibility: An updated "Show Shortcuts" modal dynamically displays the currently active key combinations (whether custom or default), ensuring users always have a quick reference. Improved Workflow: By allowing users to set up shortcuts that best fit their workflow and accessibility needs, this feature aims to make daily interaction with the application faster, more efficient, and more comfortable. This enhancement directly addresses the desire for a more accessible and user-centric interface, putting more control into the hands of the user for an application that plays a significant role in their daily tasks. ### Added - **Customizable Keyboard Shortcuts Feature:** - New settings panel allowing users to customize keyboard shortcuts for various actions. - Users can define 3 key combinations for the shortcuts (e.g., Ctrl/⌘ + Shift + K). - Input fields dynamically adjust based on `maxParts` definition 3 keys per shortcut). - UI allows adding a third key part if `maxParts` is 3 and two keys are present. - UI allows removing only the third key part if present. - Validation ensures at least two keys are provided if a shortcut is customized. - Validation prevents duplicate shortcut combinations across different actions. - Validation requires a non standard key to be the start of the hotkey to prevent the user from using a regular letter or number at the start of the hotkey. - Option to reset individual shortcuts to their default key combinations. - Ability to clear all inputs for a shortcut to revert it to its default on save. - Global keyboard shortcut handler integrated into the main application layout. - Dynamically applies user-defined shortcuts from settings. - Falls back to default shortcuts if no customization exists for a specific action. - Handles a comprehensive list of actions including: Open new chat, Focus chat input, Copy last code block, Copy last response, Toggle sidebar, Delete chat, Toggle settings, Show shortcuts modal, and Toggle temporary chat. - "Show Shortcuts" modal now dynamically displays current shortcut key combinations. - Reflects user customizations from settings. - Falls back to default key combinations if not customized. - Organized into a two-column layout for readability. ### Changed - **Keyboard Shortcut Handling:** - Replaced hardcoded keyboard event listeners in the main application layout with a centralized, dynamic shortcut handling system. - **Settings Structure:** - Ensured the application's settings store (`$settings.shortcuts`) is the source of truth for custom shortcut configurations, used by the configuration panel, global handler, and display modal. Defaults are stored in each of these files though to maintain a non breaking change. So it checks to see if there is anything in settings.shortcuts for that key is there is not it will use the hardcoded defaults for the project. ### Deprecated - [List any deprecated functionality or features that have been removed] ### Removed - NA ### Fixed - NA ### Security - NA ### Breaking Changes - **BREAKING CHANGE**: NA --- ### Additional Information - [Insert any additional context, notes, or explanations for the changes] - [Reference any related issues, commits, or other relevant information] ### Screenshots or Videos New settings for shortcuts: ![CleanShot 2025-05-12 at 10 48 34@2x](https://github.com/user-attachments/assets/bdd5bce2-c903-4672-9ca1-df9000b8f07e) Showing that the shortcut modal menu (within the ? help in the bottom right) shows the user edited keys if they are changed if not it defaults to the projects hardcoded defaults: ![CleanShot 2025-05-12 at 10 49 26@2x](https://github.com/user-attachments/assets/5bfb27dc-cc47-43bd-bcc1-a2fec11fca4a) ### Contributor License Agreement By submitting this pull request, I confirm that I have read and fully agree to the [Contributor License Agreement (CLA)](/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-29 21:06:49 -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#46342