mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 03:18:23 -05:00
[PR #20912] [CLOSED] perf: add keys to Svelte {#each} blocks for efficient DOM diffing #41457
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/20912
Author: @sjhddh
Created: 1/23/2026
Status: ❌ Closed
Base:
dev← Head:fix/svelte-keyed-each-blocks📝 Commits (1)
a076c7cperf: add keys to Svelte {#each} blocks for efficient DOM diffing📊 Changes
6 files changed (+8 additions, -8 deletions)
View changed files
📝
src/lib/components/workspace/Prompts.svelte(+1 -1)📝
src/lib/components/workspace/Tools.svelte(+1 -1)📝
src/lib/components/workspace/common/AccessControl.svelte(+2 -2)📝
src/lib/components/workspace/common/MemberSelector.svelte(+2 -2)📝
src/lib/components/workspace/common/TagSelector.svelte(+1 -1)📝
src/lib/components/workspace/common/ViewSelector.svelte(+1 -1)📄 Description
Summary
Add unique keys to
{#each}blocks in workspace components to enable Svelte's efficient keyed DOM patching instead of full re-renders.Problem
Multiple
{#each}blocks in workspace components iterate over lists without a unique key. This forces Svelte to diff the entire DOM subtree on updates, which is inefficient especially for large lists.Solution
Add unique keys to
{#each}blocks:ViewSelector.svelte:{#each items as item (item.value)}TagSelector.svelte:{#each items as item (item.value)}MemberSelector.svelte:{#each groupIds as id (id)}and{#each userIds as id (id)}AccessControl.svelte:{#each accessGroups as group (group.id)}Tools.svelte:{#each filteredItems as tool (tool.id)}Prompts.svelte:{#each filteredItems as prompt (prompt.command)}Test plan
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.