mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-13 11:33:32 -05:00
[PR #22920] [CLOSED] fix: restore $ skill highlight and TipTap mention nodes on page reload #65784
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/22920
Author: @silentoplayz
Created: 3/21/2026
Status: ❌ Closed
Base:
dev← Head:fix/skill-highlight-persistence📝 Commits (1)
de8b0ecfix: restore $ skill highlight and TipTap mention nodes on page reload📊 Changes
5 files changed (+57 additions, -6 deletions)
View changed files
📝
src/lib/components/chat/Chat.svelte(+7 -2)📝
src/lib/components/chat/MessageInput.svelte(+30 -4)📝
src/lib/components/chat/MessageInput/CommandSuggestionList.svelte(+2 -0)📝
src/lib/components/chat/MessageInput/Commands/Skills.svelte(+17 -0)📝
src/lib/components/common/RichTextInput/suggestions.ts(+1 -0)📄 Description
Pull Request Checklist
Note to first-time contributors: Please open a discussion post in Discussions to discuss your idea/fix with the community before creating a pull request, and describe your changes before submitting a pull request.
This is to ensure large feature PRs are discussed with the community first, before starting work on the feature. If the community does not want this feature or it is not relevant for Open WebUI as a project, it can be identified in the discussion before working on the feature and submitting the PR.
Before submitting, make sure you've checked the following:
devbranch. PRs targetingmainwill be immediately closed.devto ensure no unrelated commits (e.g. frommain) are included. Push updates to the existing PR branch instead of closing and reopening.Changelog Entry
Description
Fixes two related bugs in the chat input's
$skill selection:Mention node loss on reload: TipTap uses special mention nodes to render
@modeland$skillselections. Previously, only the plain-text markdownpromptwas saved to the sessionStorage draft. On page reload,setText()would recreate the content from plain text, causing mention nodes to be lost (rendered as raw text like<$visualize|Visualize>instead of proper highlight). The fix savesinputContent.jsonto the draft and usessetContent(json)on restore to properly reconstruct mention nodes.Skill dropdown highlight not restored: The blue highlight of the selected skill in the dropdown was not restored on page reload because
selectedSkillIdwas never persisted. The fix addsselectedSkillIdto the draft save/restore chain and updatesSkills.svelteto pre-highlight the restored skill when the dropdown first loads.selectedSkillIdis only cleared when the user actively searches (query changes after skills are already loaded), preserving the highlight during the initial API fetch window.Fixed
$skill,@model) are now preserved on page reload by saving the full TipTap JSON content to the sessionStorage draft and usingsetContent(json)on restore.$skill dropdown highlight is now restored on page reload viaselectedSkillIdpersistence through the draft →CommandSuggestionList→Skillsprop chain.Additional Information
Chat.svelte,MessageInput.svelte,CommandSuggestionList.svelte,Skills.svelte,suggestions.ts), 57 lines total.#XXXXfor the@model selection persistence fix.Screenshots or Videos
Before the fix: After selecting a skill via
$and refreshing the page, the skill appears as raw text like<$open-webui-pr-copilot|Open WebUI PR Copilot v2>instead of a proper mention node, and no dropdown highlight is shown.After the fix: The skill mention node is properly restored as a highlighted mention, and the dropdown shows the correct skill pre-selected (blue highlight).
Manual Verification Performed
$to trigger the skill suggestion dropdown.$visualize).<$skill|Skill Name>).@model selection) is unaffected by this change.Contributor License Agreement
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.