feat: decouple manual image sharing from automation gating

The "Share a saved image" panel was wired to the automated exchange
engine, so an operator could only share an image right after an inbound
image request, limited to assets the auto-exchanger would itself pick.

Add a manual path that offers any enabled, unused library image at any
point (no request detection, tier, seller, or boundary gating) and sends
it with no reciprocal "your turn" text. Safety flags now surface as a
non-blocking warning instead of disabling the panel. The automated
auto-send path keeps all its guardrails; the shared image-delivery step
is extracted into a helper used by both paths.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Jamie BruntonandClaude Opus 4.8 committed 2026-08-10 09:18:37 +01:00
1 parent e984bf20ac
commit c8689af04d
9 files changed
+192 -67

No files matched your search

+4 -3
View File
@@ -67,7 +67,8 @@ const server = setupServer(
isRunning: true, status: 'authenticated', createdAt: 1, updatedAt: 2, lastImportedAt: 2,
}])),
http.get('/api/conversations/:id/shareable-media', () => HttpResponse.json({
requestKind: null, assets: [], reason: 'The latest inbound message does not ask for an image.',
requestKind: null, assets: [], warning: null,
reason: 'No enabled, unused library images are available to share.',
})),
);
@@ -354,7 +355,7 @@ describe('ConversationsPage', () => {
],
})),
http.get('/api/conversations/room-alice/shareable-media', () => HttpResponse.json({
requestKind: 'selfie', assets: [asset], reason: null,
requestKind: 'selfie', assets: [asset], reason: null, warning: null,
})),
http.post('/api/conversations/room-alice/share-media', async ({ request }) => {
const body = await request.json() as { assetId: string };
@@ -541,7 +542,7 @@ describe('ConversationsPage', () => {
http.get('/api/conversations', () => HttpResponse.json([alice])),
http.get('/api/conversations/room-alice', () => HttpResponse.json(detailFixture())),
http.get('/api/conversations/room-alice/shareable-media', () => HttpResponse.json({
requestKind: 'selfie', assets: [asset], reason: null,
requestKind: 'selfie', assets: [asset], reason: null, warning: null,
})),
);
const user = userEvent.setup();