Show community avatar in QR agent creation form

Signed-off-by: Tom Brow <tomb@block.xyz>
This commit is contained in:
Tom Brow
2026-10-20 14:15:18 -07:00
parent b09e15e17e
commit 115ee178dc
3 changed files with 23 additions and 5 deletions

View File

@@ -50,7 +50,7 @@ prototype's 1–64 letter/number/space/dot/hyphen/underscore contract.
Both cold-start Camera links and warm external hyperlinks use the existing
app-link queue. Dispatch waits for signed-in app/account and current-community
hydration. Name and instructions are editable, avatar is read-only, and the
header names the destination community. A community change prevents submission.
form shows the destination community avatar without a community-name heading. A community change prevents submission.
Only the default remote provider is used. No QR signing or QR-generator UI is
included. Signed-out users must sign in and reopen the link; unfinished agent
setup must be resumed before opening a new draft.

View File

@@ -4,6 +4,7 @@ import 'package:hooks_riverpod/hooks_riverpod.dart';
import '../shared/community/community.dart';
import '../shared/community/community_provider.dart';
import '../shared/community/community_avatar.dart';
import '../shared/deeplink/deep_link.dart';
import '../shared/theme/theme.dart';
import '../shared/widgets/buzz_titled_sheet_layout.dart';
@@ -137,9 +138,7 @@ class CreatePrototypeAgentSheet extends HookConsumerWidget {
bottom: MediaQuery.viewInsetsOf(context).bottom,
),
child: BuzzTitledSheetLayout(
title: avatar == null
? 'Create agent'
: 'Create in ${community.name}',
title: 'Create agent',
leading: IconButton(
tooltip: 'Cancel',
style: actionStyle,
@@ -169,6 +168,18 @@ class CreatePrototypeAgentSheet extends HookConsumerWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (avatarUrl != null) ...[
Align(
alignment: Alignment.centerRight,
child: Semantics(
label: 'Current community: ${community.name}',
child: CommunityAvatar(
name: community.name,
relayUrl: community.relayUrl,
size: Grid.md,
),
),
),
const SizedBox(height: Grid.xs),
Center(
child: AvatarImage(
imageUrl: avatarUrl,

View File

@@ -6,6 +6,7 @@ import 'package:buzz/prototype/create_agent_sheet.dart';
import 'package:buzz/prototype/remote_agent_controller.dart';
import 'package:buzz/shared/agents/agents_surface.dart';
import 'package:buzz/shared/community/community.dart';
import 'package:buzz/shared/community/community_avatar.dart';
import 'package:buzz/shared/community/community_provider.dart';
import 'package:buzz/shared/deeplink/deep_link.dart';
import 'package:buzz/shared/deeplink/pending_deep_link_provider.dart';
@@ -122,7 +123,13 @@ void main() {
),
);
await tester.pumpAndSettle();
expect(find.text('Create in Test community'), findsOneWidget);
expect(find.text('Create agent'), findsOneWidget);
expect(find.text('Create in Test community'), findsNothing);
final indicator = tester.widget<CommunityAvatar>(
find.byType(CommunityAvatar),
);
expect(indicator.name, 'Test community');
expect(indicator.relayUrl, 'wss://test.example');
expect(find.byType(AvatarImage), findsOneWidget);
expect(controller.submittedName, isNull);
await tester.enterText(