hand a ticket to Claude from the sidebar (T-327)

Hovering a ticket card reveals a person-simple-run icon; clicking it
fetches the full ticket (pql.tickets.show withContext), builds a "pick
this up and start" prompt, and publishes ('builtin.tickets','pick-up',
{id,prompt}) on the message bus. The Claude builtin subscribes and
injects it into the active session (primary, else first visible) as a
user turn — a quiet no-op when no session is live. Sidebar stays
decoupled from the orchestrator (bus-only). Prompt-builder test.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-10 14:52:27 +02:00
co-authored by Claude Opus 4.8
parent aa6f112164
commit 3097d5f63b
7 changed files with 188 additions and 34 deletions
+14
View File
@@ -348,6 +348,20 @@ class ClaudeExtension extends ClideExtension {
// 'image' message; we inject the matching card into the conversation the
// user is looking at (the primary lead, else the first visible session).
_subs.add(ctx.messages.subscribe(channel: imageShowChannel).listen(_onImageShow));
// A sidebar "pick up" click (T-327) publishes the full ticket; inject it
// into the active conversation as a user turn so Claude starts working it.
_subs.add(ctx.messages.subscribe(publisher: 'builtin.tickets', channel: 'pick-up').listen(_onTicketPickUp));
}
/// Hand a picked-up ticket to the active Claude session (T-327): the primary
/// lead, else the first visible session. A quiet no-op when none is live.
void _onTicketPickUp(Message m) {
final prompt = m.data['prompt'] as String?;
if (prompt == null || prompt.isEmpty) return;
final target = _orchestrator?.byId('primary') ?? _orchestrator?.visibleSessions.firstOrNull;
if (target == null) return;
_orchestrator?.injectMessage(target.id, prompt);
}
/// Close every session that doesn't belong to the newly-active workspace