Files
buzz/mobile/lib/features/agents/agent_avatar_geometry.dart
klopez4212 b4509dee8b feat(mobile): add Buzzies and refresh agent avatar picker (#8921)
## Summary

Adds Buzzies and refreshes the agent avatar picker with larger previews,
rounded option strips, and clearer category choices. Also moves Agents
above Appearance in the home menu and adds a custom agent icon.

### Related issue

None found.

### Testing

Analysis, 4,138 app tests, package tests, and 121 configured-auth tests
pass. Earlier visual build exercised on Pixel and iOS simulator, with
iPhone review; snapshots below show that build.

| Android · Pixel | iOS · simulator preview |
| --- | --- |
| ![Buzzies in the Android avatar
picker](https://github.com/user-attachments/assets/bf56120c-0128-4683-a0ad-189587a13c8d)
| ![Buzzies in the iOS avatar
picker](https://github.com/user-attachments/assets/63c692f5-822c-4490-883f-36bec8d2be15)
|

---------

Signed-off-by: kenny lopez <klopez4212@gmail.com>
Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz>
2026-11-02 17:00:12 +00:00

39 lines
1.2 KiB
Dart

import 'dart:math' as math;
import 'package:flutter/material.dart';
import '../../shared/theme/theme.dart';
/// Space reserved below previews for the filmstrip.
const agentAvatarTraySpace = 115.0;
/// Preview space added above the editor controls.
const agentAvatarPreviewSpace = 228.0;
/// Maximum character preview size.
const agentAvatarMaxPreviewSize = 440.0;
/// Asset padding compensation shared by previews and Hero flights.
double agentCharacterOffset(String? url, {double scale = 1}) =>
url?.contains('/buzzies/') == true ? -0.084 * scale : 0;
/// Shrinks only items near clipped filmstrip edges.
double agentFilmstripScale({
required int index,
required int count,
required double extent,
required double width,
required double offset,
required bool reduceMotion,
}) {
if (reduceMotion) return 1;
final center = Grid.xxs + index * extent + extent / 2 - offset;
final maxScroll = math.max(0.0, count * extent + Grid.xxs * 2 - width);
final distance = math.min(
center + math.max(0.0, 72 - offset),
width - center + math.max(0.0, 72 - (maxScroll - offset)),
);
return 0.65 +
0.35 * Curves.easeInOut.transform((distance / 72).clamp(0.0, 1.0));
}