feat: add per-row extension points inside sidebar chat list x-for loop

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 commit is contained in:
Tristan (Deimos AI) 2026-03-29 12:59:46 +00:00
parent 1623088699
commit bd10a667cb

View file

@ -26,6 +26,7 @@
<li>
<div :class="{'chat-container': true, 'chat-selected': context.id === $store.chats.selected}"
@click="$store.chats.selectChat(context.id)">
<x-extension id="sidebar-chat-item-start"></x-extension>
<div class="chat-list-button">
<span :class="{'project-color-ball': true, 'heartbeat': context.running}"
:style="context.project?.color ? { backgroundColor: context.project.color } : { border: '1px solid var(--color-border)' }"></span>
@ -35,6 +36,7 @@
<button class="btn-icon-action chat-list-action-btn" title="Close chat" @click.stop="$confirmClick($event, () => $store.chats.killChat(context.id))">
<span class="material-symbols-outlined">close</span>
</button>
<x-extension id="sidebar-chat-item-end"></x-extension>
</div>
</li>
</template>