[PR #24211] feat: add keyboard shortcuts for playground and edit last user message #50553

Open
opened 2026-04-30 03:19:54 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/24211
Author: @MahammadParvezSalim
Created: 4/29/2026
Status: 🔄 Open

Base: devHead: feat/keyboard-shortcuts-playground


📝 Commits (1)

  • a6d210f feat: add keyboard shortcuts for playground and edit last user message

📊 Changes

5 files changed (+71 additions, -1 deletions)

View changed files

📝 src/lib/components/chat/ShortcutsModal.svelte (+5 -0)
📝 src/lib/components/playground/Chat.svelte (+20 -0)
📝 src/lib/components/playground/Completions.svelte (+13 -0)
📝 src/lib/shortcuts.ts (+29 -1)
📝 src/routes/(app)/+layout.svelte (+4 -0)

📄 Description


Closes #1008

Adds keyboard shortcuts to the Playground (which previously had none) and a global shortcut to edit the last user message in the main chat.

Pull Request Checklist

  • Target branch: This PR targets the dev branch.
  • Description: Provided above and in the changelog below.
  • Changelog: See below.
  • Documentation: No env vars or public APIs changed. New shortcuts are self-documented in the in-app Shortcuts modal (Ctrl+/).
  • Dependencies: No new or upgraded dependencies.
  • Testing: Manually tested on Windows — all shortcuts verified working (see screenshot below).
  • Agentic AI Code: Written and manually reviewed and tested by human contributor.
  • Code review: Self-reviewed. Follows existing shortcut patterns in the codebase.
  • Design & Architecture: No new settings added. Uses existing svelte:window and getElementsByClassName patterns already present in the codebase.
  • Git Hygiene: Single atomic commit, rebased on dev.
  • Title Prefix: feat:

Changelog Entry

Description

  • Adds keyboard shortcuts for the Playground (Chat and Completions tabs) which previously had no shortcut support, and adds Ctrl/Cmd+E to edit the last user message from anywhere in the main chat. Addresses #1008.

Added

  • Ctrl/Cmd+Enter — Run/submit in Playground Chat and Completions
  • Ctrl/Cmd+Shift+A — Add message in Playground Chat (mirrors Add button, auto-toggles role)
  • Ctrl/Cmd+Shift+X — Toggle user/assistant role in Playground Chat
  • Ctrl/Cmd+E — Edit last user message from anywhere in the main chat
  • New Playground category visible in the Shortcuts modal (Ctrl+/)

Changed

  • src/lib/shortcuts.ts — added EDIT_LAST_MESSAGE, PLAYGROUND_SUBMIT, PLAYGROUND_ADD_MESSAGE, PLAYGROUND_TOGGLE_ROLE enum values and registry entries
  • src/routes/(app)/+layout.svelte — added global Ctrl/Cmd+E handler
  • src/lib/components/playground/Chat.svelte — added local svelte:window keydown handler
  • src/lib/components/chat/ShortcutsModal.svelte — added i18n extraction comments for new strings

Screenshots or Videos

Screenshot 2026-04-28 221453

Contributor License Agreement

Note

Deleting the CLA section will lead to immediate closure of your PR and it will not be merged in.



🔄 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/24211 **Author:** [@MahammadParvezSalim](https://github.com/MahammadParvezSalim) **Created:** 4/29/2026 **Status:** 🔄 Open **Base:** `dev` ← **Head:** `feat/keyboard-shortcuts-playground` --- ### 📝 Commits (1) - [`a6d210f`](https://github.com/open-webui/open-webui/commit/a6d210f644eb4c863c235a0ef8e76b20d98c8e70) feat: add keyboard shortcuts for playground and edit last user message ### 📊 Changes **5 files changed** (+71 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/lib/components/chat/ShortcutsModal.svelte` (+5 -0) 📝 `src/lib/components/playground/Chat.svelte` (+20 -0) 📝 `src/lib/components/playground/Completions.svelte` (+13 -0) 📝 `src/lib/shortcuts.ts` (+29 -1) 📝 `src/routes/(app)/+layout.svelte` (+4 -0) </details> ### 📄 Description --- Closes #1008 Adds keyboard shortcuts to the Playground (which previously had none) and a global shortcut to edit the last user message in the main chat. <!-- ⚠️ CRITICAL CHECKS FOR CONTRIBUTORS (READ, DON'T DELETE) ⚠️ 1. Target the `dev` branch. PRs targeting `main` will be automatically closed. 2. Do NOT delete the CLA section at the bottom. It is required for the bot to accept your PR. --> # Pull Request Checklist - [x] **Target branch:** This PR targets the `dev` branch. - [x] **Description:** Provided above and in the changelog below. - [x] **Changelog:** See below. - [x] **Documentation:** No env vars or public APIs changed. New shortcuts are self-documented in the in-app Shortcuts modal (`Ctrl+/`). - [x] **Dependencies:** No new or upgraded dependencies. - [x] **Testing:** Manually tested on Windows — all shortcuts verified working (see screenshot below). - [x] **Agentic AI Code:** Written and manually reviewed and tested by human contributor. - [x] **Code review:** Self-reviewed. Follows existing shortcut patterns in the codebase. - [x] **Design & Architecture:** No new settings added. Uses existing `svelte:window` and `getElementsByClassName` patterns already present in the codebase. - [x] **Git Hygiene:** Single atomic commit, rebased on `dev`. - [x] **Title Prefix:** `feat:` # Changelog Entry ### Description - Adds keyboard shortcuts for the Playground (Chat and Completions tabs) which previously had no shortcut support, and adds `Ctrl/Cmd+E` to edit the last user message from anywhere in the main chat. Addresses #1008. ### Added - `Ctrl/Cmd+Enter` — Run/submit in Playground Chat and Completions - `Ctrl/Cmd+Shift+A` — Add message in Playground Chat (mirrors Add button, auto-toggles role) - `Ctrl/Cmd+Shift+X` — Toggle user/assistant role in Playground Chat - `Ctrl/Cmd+E` — Edit last user message from anywhere in the main chat - New **Playground** category visible in the Shortcuts modal (`Ctrl+/`) ### Changed - `src/lib/shortcuts.ts` — added `EDIT_LAST_MESSAGE`, `PLAYGROUND_SUBMIT`, `PLAYGROUND_ADD_MESSAGE`, `PLAYGROUND_TOGGLE_ROLE` enum values and registry entries - `src/routes/(app)/+layout.svelte` — added global `Ctrl/Cmd+E` handler - `src/lib/components/playground/Chat.svelte` — added local `svelte:window` keydown handler - `src/lib/components/chat/ShortcutsModal.svelte` — added i18n extraction comments for new strings ### Screenshots or Videos <img width="1021" height="1152" alt="Screenshot 2026-04-28 221453" src="https://github.com/user-attachments/assets/5502ac27-deca-4784-8fcd-f5ef0c09c573" /> ### Contributor License Agreement <!-- 🚨 DO NOT DELETE THE TEXT BELOW 🚨 Keep the "Contributor License Agreement" confirmation text intact. Deleting it will trigger the CLA-Bot to INVALIDATE your PR. Your PR will NOT be reviewed or merged until you check the box below confirming that you have read and agree to the terms of the CLA. --> - [x] 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. > [!NOTE] > Deleting the CLA section will lead to immediate closure of your PR and it will not be merged in. --- --- <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-30 03:19:54 -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#50553