[PR #14982] [MERGED] fix: Replace Inline SVGs with Icon Components and Convert Links to Buttons #62524

Closed
opened 2026-05-06 06:42:42 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/14982
Author: @silentoplayz
Created: 6/14/2025
Status: Merged
Merged: 6/16/2025
Merged by: @tjbck

Base: devHead: fix-drag


📝 Commits (3)

  • 9ccb9a8 fix: Prevent draggable links for Admin Panel & Playground in UserMenu
  • 4fd7bfe refac: Icon files for UserMenu
  • 6e8c6e2 fix: select-none w-full

📊 Changes

6 files changed (+103 additions, -83 deletions)

View changed files

src/lib/components/icons/Code.svelte (+19 -0)
src/lib/components/icons/Settings.svelte (+20 -0)
src/lib/components/icons/SignOut.svelte (+16 -0)
src/lib/components/icons/UserGroup.svelte (+19 -0)
📝 src/lib/components/layout/Navbar/Menu.svelte (+9 -9)
📝 src/lib/components/layout/Sidebar/UserMenu.svelte (+20 -74)

📄 Description

Pull Request Checklist

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

  • Refactored src/lib/components/layout/Sidebar/UserMenu.svelte to enhance maintainability and consistency by replacing inline SVG icons with dedicated Svelte icon components. This change improves code readability and reususability. Additionally, administrative navigation links were converted to buttons with programmatic navigation, and minor user experience improvements were applied to dropdown menu item behavior.

Added

  • Imported new Svelte icon components: Settings, Code, UserGroup, and SignOut.

Changed

  • Replaced inline SVG definitions for the "Settings", "Playground", "Admin Panel", and "Sign Out" menu items with their respective dedicated Svelte icon components (Settings.svelte, Code.svelte, UserGroup.svelte, SignOut.svelte).
  • Converted the "Playground" and "Admin Panel" menu items from <a> tags to <button> elements, updating their navigation to use the goto() function from $app/navigation for consistent behavior.
  • Updated the styling classes for "Documentation", "Releases", and "Keyboard shortcuts" menu items within the "Help" section to include select-none, w-full, and transition for improved visual consistency and user interaction.
  • Ensured that "Documentation" and "Releases" menu items now close the dropdown menu (show = false;) upon click.

Additional Information

  • This refactoring simplifies future updates to icons and ensures a more consistent visual appearance across the application by centralizing icon definitions.
  • The switch from <a> to <button> for Playground and Admin Panel provides more semantic HTML for interactive elements within a dropdown menu, aligning better with accessibility practices for controls that trigger actions rather than navigate directly via href.

Screenshots or Videos

What this PR fixes:
https://github.com/user-attachments/assets/a21f38e5-d112-4726-8a2f-444995b4a511

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/14982 **Author:** [@silentoplayz](https://github.com/silentoplayz) **Created:** 6/14/2025 **Status:** ✅ Merged **Merged:** 6/16/2025 **Merged by:** [@tjbck](https://github.com/tjbck) **Base:** `dev` ← **Head:** `fix-drag` --- ### 📝 Commits (3) - [`9ccb9a8`](https://github.com/open-webui/open-webui/commit/9ccb9a87e6feabebf6922a2e6858f37e2995573e) fix: Prevent draggable links for Admin Panel & Playground in UserMenu - [`4fd7bfe`](https://github.com/open-webui/open-webui/commit/4fd7bfe19b188b278480ed17f64eaff33aa4ba0b) refac: Icon files for UserMenu - [`6e8c6e2`](https://github.com/open-webui/open-webui/commit/6e8c6e269ea3a1f240d6f452261ae88fb36a93f0) fix: select-none w-full ### 📊 Changes **6 files changed** (+103 additions, -83 deletions) <details> <summary>View changed files</summary> ➕ `src/lib/components/icons/Code.svelte` (+19 -0) ➕ `src/lib/components/icons/Settings.svelte` (+20 -0) ➕ `src/lib/components/icons/SignOut.svelte` (+16 -0) ➕ `src/lib/components/icons/UserGroup.svelte` (+19 -0) 📝 `src/lib/components/layout/Navbar/Menu.svelte` (+9 -9) 📝 `src/lib/components/layout/Sidebar/UserMenu.svelte` (+20 -74) </details> ### 📄 Description # Pull Request Checklist **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 - Refactored `src/lib/components/layout/Sidebar/UserMenu.svelte` to enhance maintainability and consistency by replacing inline SVG icons with dedicated Svelte icon components. This change improves code readability and reususability. Additionally, administrative navigation links were converted to buttons with programmatic navigation, and minor user experience improvements were applied to dropdown menu item behavior. ### Added - Imported new Svelte icon components: `Settings`, `Code`, `UserGroup`, and `SignOut`. ### Changed - Replaced inline SVG definitions for the "Settings", "Playground", "Admin Panel", and "Sign Out" menu items with their respective dedicated Svelte icon components (`Settings.svelte`, `Code.svelte`, `UserGroup.svelte`, `SignOut.svelte`). - Converted the "Playground" and "Admin Panel" menu items from `<a>` tags to `<button>` elements, updating their navigation to use the `goto()` function from `$app/navigation` for consistent behavior. - Updated the styling classes for "Documentation", "Releases", and "Keyboard shortcuts" menu items within the "Help" section to include `select-none`, `w-full`, and `transition` for improved visual consistency and user interaction. - Ensured that "Documentation" and "Releases" menu items now close the dropdown menu (`show = false;`) upon click. ### Additional Information - This refactoring simplifies future updates to icons and ensures a more consistent visual appearance across the application by centralizing icon definitions. - The switch from `<a>` to `<button>` for Playground and Admin Panel provides more semantic HTML for interactive elements within a dropdown menu, aligning better with accessibility practices for controls that trigger actions rather than navigate directly via `href`. ### Screenshots or Videos **What this PR fixes:** https://github.com/user-attachments/assets/a21f38e5-d112-4726-8a2f-444995b4a511 ### 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-05-06 06:42:42 -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#62524