[PR #11520] [MERGED] Added decodeURIcomponent function to several locations. #22753

Closed
opened 2026-04-20 04:22:23 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/11520
Author: @icsy7867
Created: 3/10/2025
Status: Merged
Merged: 3/11/2025
Merged by: @tjbck

Base: devHead: main


📝 Commits (1)

  • 3fb4776 Added decodeURIcomponent function to several locations.

📊 Changes

4 files changed (+8 additions, -8 deletions)

View changed files

📝 src/lib/components/chat/MessageInput/Commands/Knowledge.svelte (+1 -1)
📝 src/lib/components/chat/Messages/Citations.svelte (+3 -3)
📝 src/lib/components/chat/Messages/CitationsModal.svelte (+1 -1)
📝 src/lib/components/common/FileItem.svelte (+3 -3)

📄 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 for validating 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 cleary 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

Creating a pull request to track my changes.
My initial discussion:
https://github.com/open-webui/open-webui/issues/11512

In my case, and I would think a lot of other folks, want to use a RAG to container their organizations Wiki documents, policies and other items. The current RAG API uses the file name as the document name (Though personally I think this should be able to be overwritten in the API as an optional field).

Ultimately, when the RAG returns a hit, the documentation location should not be a link to download the file, but a URL to the original document.

AS an example, I use the Confluence API to return the HTML bodies of every article in a space. I can then convert the HTML to raw text, and then upload to the RAG. But I want the to have a nice URL as a link in the open-webui chat GUI. However we run into an issue when we try to do this... a filename cannot container several of the characters found in a URL.

To overcome this, I have found that URL Encoding (Or percent encoding) is the easiest way to do this. Windows, linux and Macs can both save files using URLEncoded names. However this looks UGLY on the webgui side:

image

So by using the decodeURIcomponent javascript function, we can convert these display names. (However the original document names will remain the URL encoded values.)

Ultimately we have a nice clickable link!
image

If a filename does not container any sort of URLEncoded variables, the original string will be returned by this function.

Ultimately these percent encoded variables are the only strings that will be converted.
https://www.w3schools.com/tags/ref_urlencode.ASP

This could also be used if someone wanted an FTP:// link, or others:
https://www.chromium.org/developers/design-documents/network-stack/#code-layout

This would also solved that issue.

Added

Added the javascript function decodeURIcomponent to a handful of places.

Changed

  • [List any changes, updates, refactorings, or optimizations]

Deprecated

N/A

Removed

N/A

Fixed

N/A

Security

N/A

Breaking Changes

N/A


Additional Information

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

Screenshots or Videos

  • [Attach any relevant screenshots or videos demonstrating the changes]

🔄 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/11520 **Author:** [@icsy7867](https://github.com/icsy7867) **Created:** 3/10/2025 **Status:** ✅ Merged **Merged:** 3/11/2025 **Merged by:** [@tjbck](https://github.com/tjbck) **Base:** `dev` ← **Head:** `main` --- ### 📝 Commits (1) - [`3fb4776`](https://github.com/open-webui/open-webui/commit/3fb477618e0ce3d7308af8e26c2f7ba43ee12130) Added decodeURIcomponent function to several locations. ### 📊 Changes **4 files changed** (+8 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `src/lib/components/chat/MessageInput/Commands/Knowledge.svelte` (+1 -1) 📝 `src/lib/components/chat/Messages/Citations.svelte` (+3 -3) 📝 `src/lib/components/chat/Messages/CitationsModal.svelte` (+1 -1) 📝 `src/lib/components/common/FileItem.svelte` (+3 -3) </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. - [ ] **Changelog:** Ensure a changelog entry following the format of [Keep a Changelog](https://keepachangelog.com/) is added at the bottom of the PR description. - [ ] **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 for validating 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 cleary 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 Creating a pull request to track my changes. My initial discussion: https://github.com/open-webui/open-webui/issues/11512 In my case, and I would think a lot of other folks, want to use a RAG to container their organizations Wiki documents, policies and other items. The current RAG API uses the file name as the document name (Though personally I think this should be able to be overwritten in the API as an optional field). Ultimately, when the RAG returns a hit, the documentation location should not be a link to download the file, but a URL to the original document. AS an example, I use the Confluence API to return the HTML bodies of every article in a space. I can then convert the HTML to raw text, and then upload to the RAG. But I want the to have a nice URL as a link in the open-webui chat GUI. However we run into an issue when we try to do this... a filename cannot container several of the characters found in a URL. To overcome this, I have found that URL Encoding (Or percent encoding) is the easiest way to do this. Windows, linux and Macs can both save files using URLEncoded names. However this looks UGLY on the webgui side: ![image](https://github.com/user-attachments/assets/15b6ba08-39ff-49bd-893e-1d12eeeb775b) So by using the decodeURIcomponent javascript function, we can convert these display names. (However the original document names will remain the URL encoded values.) Ultimately we have a nice clickable link! ![image](https://github.com/user-attachments/assets/079b6584-2c46-414d-b8e6-b38d03297211) If a filename does not container any sort of URLEncoded variables, the original string will be returned by this function. Ultimately these percent encoded variables are the only strings that will be converted. https://www.w3schools.com/tags/ref_urlencode.ASP This could also be used if someone wanted an `FTP://` link, or others: https://www.chromium.org/developers/design-documents/network-stack/#code-layout This would also solved that issue. ### Added Added the javascript function decodeURIcomponent to a handful of places. ### Changed - [List any changes, updates, refactorings, or optimizations] ### Deprecated N/A ### Removed N/A ### Fixed N/A ### Security N/A ### Breaking Changes N/A --- ### Additional Information - [Insert any additional context, notes, or explanations for the changes] - [Reference any related issues, commits, or other relevant information] ### Screenshots or Videos - [Attach any relevant screenshots or videos demonstrating the changes] --- <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-20 04:22:23 -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#22753