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:
@@ -0,0 +1,37 @@
|
||||
/// The "pick up this ticket" prompt builder (T-327): lead-in, header, meta
|
||||
/// line, and description, with missing fields omitted gracefully.
|
||||
library;
|
||||
|
||||
import 'package:clide/builtin/tickets/src/pick_up_prompt.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() {
|
||||
test('renders the lead-in, header, meta line, and description', () {
|
||||
final p = pickUpPrompt({
|
||||
'id': 'T-327',
|
||||
'title': 'Pick up icon',
|
||||
'type': 'story',
|
||||
'status': 'ready',
|
||||
'priority': 'medium',
|
||||
'parent_id': 'T-276',
|
||||
'description': 'Do the thing.',
|
||||
});
|
||||
expect(p, startsWith('Pick up and start working this ticket'));
|
||||
expect(p, contains('**T-327 — Pick up icon**'));
|
||||
expect(p, contains('story · ready · medium · parent T-276'));
|
||||
expect(p, contains('Do the thing.'));
|
||||
});
|
||||
|
||||
test('omits the meta line and parent when those fields are absent', () {
|
||||
final p = pickUpPrompt({'id': 'T-1', 'title': 'Bare'});
|
||||
expect(p, contains('**T-1 — Bare**'));
|
||||
expect(p, isNot(contains('·')));
|
||||
expect(p, isNot(contains('parent')));
|
||||
});
|
||||
|
||||
test('includes the decision ref and assignee when present', () {
|
||||
final p = pickUpPrompt({'id': 'T-2', 'title': 'x', 'decision_ref': 'D-90', 'assigned_to': 'jeroen'});
|
||||
expect(p, contains('D-90'));
|
||||
expect(p, contains('@jeroen'));
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user