feat: add per-row extension points inside sidebar chat list x-for loop#1379
Merged
frdel merged 1 commit intoagent0ai:developmentfrom Apr 1, 2026
Merged
Conversation
Adds sidebar-chat-item-start and sidebar-chat-item-end x-extension points inside the x-for loop in chats-list.html. Previously only sidebar-chats-list-start/end existed, both outside the x-for loop. This forced plugins that need per-chat-row UI (e.g. status indicators, labels, badges) to resort to MutationObserver + index-based DOM scanning and monkey-patching internal store methods. With these new extension points, plugins can inject content into each chat row with access to the reactive Alpine context object (context.id, context.name, context.running, context.project, etc.) entirely through declarative Alpine bindings — no DOM scanning, no method patching, no index arithmetic.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds two new
x-extensionpoints inside thex-forloop inchats-list.html:sidebar-chat-item-start— injected immediately after the openingchat-containerdiv, before the chat labelsidebar-chat-item-end— injected after the close button, before the closingchat-containerdivMotivation
Previously only
sidebar-chats-list-startandsidebar-chats-list-endexisted, both placed outside thex-forloop. Plugins that need to inject UI into individual chat rows had no framework-sanctioned way to do so.This forced third-party plugins to work around the gap by:
chatsStore.applyContexts,chatsStore.selectChat)MutationObserver+ index-based DOM scanning (contexts[index]) to locate rowscreateElement/insertBeforeinstead of declarative Alpine bindingsAll three patterns are fragile — they break silently when internal store method names or DOM structure changes.
Solution
With
sidebar-chat-item-start/sidebar-chat-item-endinside thex-forloop, extension HTML has access to the reactive Alpinecontextobject (includingcontext.id,context.name,context.running,context.project, etc.) through the normal Alpine scope chain.This enables purely declarative per-row plugin UI:
Change
Minimal — 2 lines added to
webui/components/sidebar/chats/chats-list.html. No logic changes, no style changes, no new dependencies.Backwards Compatibility
Fully backwards compatible. Existing
sidebar-chats-list-startandsidebar-chats-list-endextension points are unchanged. The new points are no-ops when no plugin registers extensions for them.