Files
buzz/mobile/lib/features/agents/agent_identity_sections.dart
klopez4212 a12ad1cdd2 feat(mobile): refine agent profiles and model selection (#8773)
## 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 |
| --- | --- | --- |
| ![Profile with separate Delete
section](https://github.com/user-attachments/assets/4b6e7cf5-b152-43a3-99d9-7c1ee65d0c70)
| ![Model and Thinking
settings](https://github.com/user-attachments/assets/c81dc138-d5d3-43bb-873b-a64171155a7d)
| ![Muted Bestie
star](https://github.com/user-attachments/assets/5ce95e3b-2403-41c5-b6d6-52b8b60cc7d6)
|

Native iOS simulator interaction with a synthetic catalog:

![Both picker values updated after native menu
selections](https://github.com/user-attachments/assets/a3ee6d4d-91e0-4df6-b4cf-b66d5c1a2e87)

</details>

---------

Signed-off-by: kenny lopez <klopez4212@gmail.com>
Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz>
2026-10-31 11:28:14 -06:00

64 lines
1.9 KiB
Dart
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import '../../shared/agents/remote_agents.dart';
import '../../shared/theme/theme.dart';
import '../../shared/widgets/app_list_card.dart';
import 'agent_instructions.dart';
/// The agent's instructions and management information in shared Settings cards.
class AgentIdentitySections extends HookWidget {
const AgentIdentitySections({
required this.pubkey,
required this.controller,
super.key,
});
final String pubkey;
final RemoteAgentController controller;
@override
Widget build(BuildContext context) {
useListenable(controller);
final remote = controller.agents.any(
(agent) => agent['agent_pubkey'] == pubkey,
);
return Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
AppListCard(
label: 'Instructions',
horizontalPadding: 0,
children: [
Padding(
padding: const EdgeInsets.all(Grid.xs),
child: SizedBox(
width: double.infinity,
child: AgentInstructions(pubkey: pubkey),
),
),
],
),
AppListCard(
label: 'Management',
horizontalPadding: 0,
children: [
Padding(
padding: const EdgeInsets.all(Grid.xs),
child: SizedBox(
width: double.infinity,
child: Text(
remote
? 'This agent runs on Builderbot. Your desktop doesn’t need to be online for it to work.'
: 'This agent is managed on your desktop. Keep Buzz open and your desktop online for it to work.',
style: context.textTheme.bodyMedium,
),
),
),
],
),
],
);
}
}