mirror of
https://github.com/block/buzz.git
synced 2026-11-12 04:12:21 +00:00
## 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 | | --- | --- | |  |  | --------- Signed-off-by: kenny lopez <klopez4212@gmail.com> Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz>
39 lines
1.2 KiB
Dart
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));
|
|
}
|