mirror of
https://github.com/block/buzz.git
synced 2026-11-24 18:21:59 +00:00
## Summary - Simplify agent profiles with Message/Bestie actions, relay-authored published instructions (unavailable without a config channel), management details, public-key copying, and a separate final Delete section. - Sort the Agents directory by name and mark the selected Bestie with a muted filled star. - Place Model and Thinking together below Name. Use native iOS Liquid Glass menus and preserve selection callbacks as controls become enabled. Related: #8685. ## Validation Full mobile checks passed. Regression coverage includes relay-author filtering, unavailable instructions, metadata retry, resizing native pickers, accurate deletion state, selection after loading, and Bestie switching. Real iOS simulator taps verified both pickers; the user confirmed the earlier iPhone build works. Review fixes were checked with widget journeys and the native UIKit resize/selection probe. <details> <summary>Previews</summary> Synthetic fixture renders: | Profile | Create agent | Bestie card | | --- | --- | --- | |  |  |  | Native iOS simulator interaction with a synthetic catalog:  </details> --------- Signed-off-by: kenny lopez <klopez4212@gmail.com> Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz>
67 lines
2.3 KiB
Dart
67 lines
2.3 KiB
Dart
import 'package:buzz/features/agents/delete_agent_action.dart';
|
|
import 'package:buzz/shared/community/community_provider.dart';
|
|
import 'package:buzz/shared/theme/theme.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'dart:async';
|
|
import 'package:buzz/shared/widgets/app_list.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
|
import 'package:nostr/nostr.dart' as nostr;
|
|
|
|
import 'agents_harness.dart';
|
|
|
|
void main() {
|
|
testWidgets('Delete appears only for owned remote agents and needs confirm', (
|
|
tester,
|
|
) async {
|
|
final h = await AgentsHarness.create();
|
|
final controller = h.controller;
|
|
final agent = nostr.Keys('0' * 63 + '2').public;
|
|
h.registry.listed = [
|
|
{'agent_pubkey': agent, 'agent_id': 'remote-id', 'agent_name': 'Scout'},
|
|
];
|
|
await controller.run(controller.refresh);
|
|
h.registry.calls.clear();
|
|
await tester.pumpWidget(
|
|
ProviderScope(
|
|
overrides: [
|
|
activeCommunityProvider.overrideWith((ref) async => h.community),
|
|
],
|
|
child: MaterialApp(
|
|
theme: AppTheme.light(),
|
|
home: Scaffold(
|
|
body: Column(
|
|
children: [
|
|
DeleteAgentAction(
|
|
controller: controller,
|
|
pubkey: agent,
|
|
asSettingsRow: true,
|
|
),
|
|
DeleteAgentAction(controller: controller, pubkey: 'local'),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
await tester.pumpAndSettle();
|
|
expect(find.text('Delete agent'), findsOneWidget);
|
|
final refresh = Completer<void>();
|
|
final refreshing = controller.run(() => refresh.future);
|
|
await tester.pump();
|
|
expect(find.text('Deleting…'), findsNothing);
|
|
expect(find.text('Delete agent'), findsOneWidget);
|
|
expect(tester.widget<AppListRow>(find.byType(AppListRow)).onTap, isNull);
|
|
refresh.complete();
|
|
await refreshing;
|
|
await tester.pumpAndSettle();
|
|
await tester.tap(find.text('Delete agent'));
|
|
await tester.pumpAndSettle();
|
|
expect(find.text('Delete Scout?'), findsOneWidget);
|
|
await tester.tap(find.text('Cancel'));
|
|
await tester.pumpAndSettle();
|
|
expect(h.registry.calls, isEmpty);
|
|
expect(controller.agents, hasLength(1));
|
|
});
|
|
}
|