Skip to content

Commit 6b5bb6f

Browse files
authored
feat(mobile): refresh onboarding and smooth QR scanner motion (block#8019)
## Summary Refresh mobile onboarding with light/dark gradients, an animated fuzzy Buzz wordmark and tagline, and bottom-aligned glass/ghost actions. Remove the dot grid and idle scroll bounce, and smooth the QR scanner's continuous corners and spring transitions by deferring camera teardown until dismissal finishes. ### Related issue N/A — no matching mobile onboarding issue or PR found. ### Testing - Mobile formatting, analysis, and full test suite passed at `0bb357f7a`. - Regression coverage includes shader animation/reduced motion, keyboard reachability, scanner interruption, deferred camera disposal, and rendered error contrast in both themes (mutation-checked). - Signed iOS release build installed on iPhone Air; Kenneth tried the onboarding and scanner during iteration and approved the final blur. - Agent review completed with no correctness blockers. Android device validation was not performed; hosted checks run separately. buzz-review-completed ### Preview Production-widget renders at 420 × 912; before: `5fdb2e536`, after: `443858a96`. | Before | After — light | After — dark | |---|---|---| | ![Before](https://raw.githubusercontent.com/block/buzz/52fb09e3c7e536f3a365d61401a077ce03ac47d9/pr-8019--buzz-before-light.png) | ![Light](https://raw.githubusercontent.com/block/buzz/52fb09e3c7e536f3a365d61401a077ce03ac47d9/pr-8019--buzz-blur-only-light.png) | ![Dark](https://raw.githubusercontent.com/block/buzz/52fb09e3c7e536f3a365d61401a077ce03ac47d9/pr-8019--buzz-blur-only-dark.png) | --------- Signed-off-by: kenny lopez <[email protected]>
1 parent 5fdb2e5 commit 6b5bb6f

16 files changed

Lines changed: 1079 additions & 211 deletions
325 KB
Loading
181 KB
Loading

‎mobile/lib/features/pairing/pairing_page.dart‎

Lines changed: 28 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import 'dart:async';
2+
import 'dart:math' show sqrt2;
3+
import 'dart:ui' show ImageFilter;
24

35
import 'package:flutter/foundation.dart';
46
import 'package:flutter/material.dart';
@@ -11,20 +13,15 @@ import '../../shared/security/sensitive_action_authorizer.dart';
1113
import '../../shared/theme/theme.dart';
1214
import '../../shared/widgets/buzz_loading_indicator.dart';
1315
import '../../shared/widgets/ios_glass_navigation_button.dart';
14-
import '../../shared/widgets/tappable_flapping_bee.dart';
16+
import 'pairing_page/onboarding_wordmark.dart';
1517
import 'pairing_provider.dart';
1618
import 'pairing_qr_scanner.dart';
1719

1820
part 'pairing_page/onboarding_background.dart';
21+
part 'pairing_page/onboarding_colors.dart';
22+
part 'pairing_page/onboarding_glass_button.dart';
1923
part 'pairing_page/pairing_welcome_view.dart';
2024

21-
const _onboardingChartreuse = Color(0xFFD7D72E);
22-
const _onboardingShellBottom = Color(0xFFD7E7F6);
23-
const _onboardingCtaLabel = Color(0xFFD7E6F0);
24-
const _onboardingInk = Color(0xFF111111);
25-
const _onboardingMutedInk = Color(0xB3111111);
26-
const _onboardingErrorInk = Color(0xFF7A1025);
27-
2825
class PairingPage extends HookConsumerWidget {
2926
/// When true, the pairing page is being used to add a new community
3027
/// (user is already authenticated with at least one community).
@@ -88,12 +85,14 @@ class PairingPage extends HookConsumerWidget {
8885
}
8986

9087
final isVerifyingSas = pairingState.status == PairingStatus.confirmingSas;
91-
final onboardingSystemOverlayStyle = SystemUiOverlayStyle.dark.copyWith(
92-
statusBarColor: Colors.transparent,
93-
);
88+
final onboardingSystemOverlayStyle =
89+
(context._onboardingIsDark
90+
? SystemUiOverlayStyle.light
91+
: SystemUiOverlayStyle.dark)
92+
.copyWith(statusBarColor: Colors.transparent);
9493
final pairingAppBar = addingCommunity
9594
? AppBar(
96-
foregroundColor: _onboardingInk,
95+
foregroundColor: context._onboardingInk,
9796
systemOverlayStyle: onboardingSystemOverlayStyle,
9897
leadingWidth: Theme.of(context).platform == TargetPlatform.iOS
9998
? Grid.quarter + iosGlassChannelHeaderLeadingWidth
@@ -108,7 +107,7 @@ class PairingPage extends HookConsumerWidget {
108107
onPressed: () => Navigator.of(context).maybePop(),
109108
width: iosGlassChannelHeaderLeadingWidth,
110109
buttonCenterX: iosGlassChannelHeaderButtonCenterX,
111-
foregroundColor: _onboardingInk,
110+
foregroundColor: context._onboardingInk,
112111
),
113112
)
114113
: IconButton(
@@ -119,7 +118,7 @@ class PairingPage extends HookConsumerWidget {
119118
title: Text(
120119
identityRecoveryOnly ? 'Send to Desktop' : 'Add Community',
121120
style: context.textTheme.titleMedium?.copyWith(
122-
color: _onboardingInk,
121+
color: context._onboardingInk,
123122
),
124123
),
125124
)
@@ -162,9 +161,7 @@ class PairingPage extends HookConsumerWidget {
162161
)
163162
: AnnotatedRegion<SystemUiOverlayStyle>(
164163
key: const Key('pairing-onboarding-system-overlay'),
165-
value: SystemUiOverlayStyle.dark.copyWith(
166-
statusBarColor: Colors.transparent,
167-
),
164+
value: onboardingSystemOverlayStyle,
168165
child: _OnboardingBackground(
169166
child: Scaffold(
170167
backgroundColor: Colors.transparent,
@@ -254,7 +251,7 @@ class _SasVerificationView extends StatelessWidget {
254251
'Confirm desktop code',
255252
textAlign: TextAlign.center,
256253
style: context.textTheme.headlineSmall?.copyWith(
257-
color: _onboardingInk,
254+
color: context._onboardingInk,
258255
fontWeight: FontWeight.w600,
259256
letterSpacing: -0.4,
260257
),
@@ -266,7 +263,7 @@ class _SasVerificationView extends StatelessWidget {
266263
: 'Make sure the six-digit code matches on both devices. Your Buzz identity will transfer to this device. Only continue if you started this pairing from your desktop.',
267264
textAlign: TextAlign.center,
268265
style: context.textTheme.bodyMedium?.copyWith(
269-
color: _onboardingMutedInk,
266+
color: context._onboardingMutedInk,
270267
),
271268
),
272269
const SizedBox(height: Grid.md),
@@ -288,7 +285,7 @@ class _SasVerificationView extends StatelessWidget {
288285
padding: const EdgeInsets.symmetric(vertical: Grid.xs),
289286
alignment: Alignment.center,
290287
decoration: BoxDecoration(
291-
color: Colors.white.withValues(alpha: 0.7),
288+
color: context._onboardingInputSurface,
292289
borderRadius: BorderRadius.circular(12),
293290
border: Border.all(
294291
color: context.colors.primary.withValues(alpha: 0.15),
@@ -298,7 +295,7 @@ class _SasVerificationView extends StatelessWidget {
298295
sasCode[index],
299296
style: context.textTheme.displaySmall?.copyWith(
300297
fontWeight: FontWeight.w600,
301-
color: _onboardingInk,
298+
color: context._onboardingInk,
302299
),
303300
),
304301
),
@@ -316,22 +313,22 @@ class _SasVerificationView extends StatelessWidget {
316313
onChanged: confirmed
317314
? null
318315
: (value) => onProtectionChanged(value ?? false),
319-
activeColor: _onboardingInk,
320-
checkColor: _onboardingCtaLabel,
321-
side: const BorderSide(color: _onboardingInk),
316+
activeColor: context._onboardingInk,
317+
checkColor: context._onboardingCtaLabel,
318+
side: BorderSide(color: context._onboardingInk),
322319
controlAffinity: ListTileControlAffinity.leading,
323320
contentPadding: EdgeInsets.zero,
324321
title: Text(
325322
biometricLabel,
326323
style: context.textTheme.bodyMedium?.copyWith(
327-
color: _onboardingInk,
324+
color: context._onboardingInk,
328325
fontWeight: FontWeight.w600,
329326
),
330327
),
331328
subtitle: Text(
332329
'For secure actions',
333330
style: context.textTheme.bodySmall?.copyWith(
334-
color: _onboardingMutedInk,
331+
color: context._onboardingMutedInk,
335332
),
336333
),
337334
),
@@ -341,7 +338,7 @@ class _SasVerificationView extends StatelessWidget {
341338
errorMessage!,
342339
textAlign: TextAlign.center,
343340
style: context.textTheme.bodySmall?.copyWith(
344-
color: _onboardingErrorInk,
341+
color: context._onboardingErrorInk,
345342
),
346343
),
347344
],
@@ -354,14 +351,14 @@ class _SasVerificationView extends StatelessWidget {
354351
children: [
355352
BuzzLoadingIndicator(
356353
size: 24,
357-
color: _onboardingInk,
354+
color: context._onboardingInk,
358355
semanticLabel: 'Connecting',
359356
),
360357
const SizedBox(width: Grid.twelve),
361358
Text(
362359
'Confirmed — waiting for desktop',
363360
style: context.textTheme.bodySmall?.copyWith(
364-
color: _onboardingMutedInk,
361+
color: context._onboardingMutedInk,
365362
),
366363
),
367364
],
@@ -372,14 +369,14 @@ class _SasVerificationView extends StatelessWidget {
372369
crossAxisAlignment: CrossAxisAlignment.stretch,
373370
children: [
374371
FilledButton.icon(
375-
style: _onboardingButtonStyle,
372+
style: context._onboardingButtonStyle,
376373
onPressed: onConfirm,
377374
icon: const Icon(LucideIcons.check),
378375
label: const Text('Codes match'),
379376
),
380377
const SizedBox(height: Grid.xxs),
381378
TextButton(
382-
style: _onboardingSecondaryButtonStyle.copyWith(
379+
style: context._onboardingSecondaryButtonStyle.copyWith(
383380
minimumSize: const WidgetStatePropertyAll(
384381
Size.fromHeight(48),
385382
),

‎mobile/lib/features/pairing/pairing_page/onboarding_background.dart‎

Lines changed: 69 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,87 @@ class _OnboardingBackground extends StatelessWidget {
77

88
@override
99
Widget build(BuildContext context) {
10+
final isDark = context._onboardingIsDark;
1011
return DecoratedBox(
1112
key: const Key('pairing-onboarding-background'),
12-
decoration: const BoxDecoration(
13-
gradient: LinearGradient(
14-
begin: Alignment.topCenter,
15-
end: Alignment.bottomCenter,
16-
colors: [_onboardingChartreuse, _onboardingShellBottom],
17-
),
13+
decoration: BoxDecoration(
14+
color: isDark ? const Color(0xFF11181D) : const Color(0xFFE7F0EF),
15+
image: isDark
16+
? null
17+
: const DecorationImage(
18+
// Same supplied artwork and full-image stretch as Buzz 2.0.
19+
image: AssetImage('assets/images/shell-gradient.png'),
20+
fit: BoxFit.fill,
21+
),
22+
),
23+
child: CustomPaint(
24+
painter: _OnboardingShellPainter(isDark: isDark),
25+
child: child,
1826
),
19-
child: CustomPaint(painter: const _DotGridPainter(), child: child),
2027
);
2128
}
2229
}
2330

24-
class _DotGridPainter extends CustomPainter {
25-
const _DotGridPainter();
31+
class _OnboardingShellPainter extends CustomPainter {
32+
final bool isDark;
33+
34+
const _OnboardingShellPainter({required this.isDark});
2635

2736
@override
2837
void paint(Canvas canvas, Size size) {
29-
final dotPaint = Paint()..color = _onboardingInk.withValues(alpha: 0.08);
30-
const spacing = 24.0;
31-
32-
for (var x = 0.0; x <= size.width; x += spacing) {
33-
for (var y = 0.0; y <= size.height; y += spacing) {
34-
canvas.drawCircle(Offset(x, y), 1, dotPaint);
35-
}
38+
if (size.isEmpty) return;
39+
if (isDark) {
40+
// Match the desktop's layered CSS farthest-corner ellipses.
41+
_paintGlow(
42+
canvas,
43+
size,
44+
const Offset(0.9, 1),
45+
0.7,
46+
const Color(0xFF39304B),
47+
);
48+
_paintGlow(
49+
canvas,
50+
size,
51+
const Offset(0.15, 0),
52+
0.65,
53+
const Color(0xFF203D53),
54+
);
3655
}
3756
}
3857

58+
void _paintGlow(
59+
Canvas canvas,
60+
Size size,
61+
Offset position,
62+
double stop,
63+
Color color,
64+
) {
65+
final radiusX =
66+
(position.dx > 0.5 ? position.dx : 1 - position.dx) *
67+
size.width *
68+
sqrt2 *
69+
stop;
70+
final radiusY =
71+
(position.dy > 0.5 ? position.dy : 1 - position.dy) *
72+
size.height *
73+
sqrt2 *
74+
stop;
75+
canvas.save();
76+
canvas.clipRect(Offset.zero & size);
77+
canvas.translate(position.dx * size.width, position.dy * size.height);
78+
canvas.scale(radiusX, radiusY);
79+
canvas.drawCircle(
80+
Offset.zero,
81+
1,
82+
Paint()
83+
..shader = RadialGradient(
84+
colors: [color, color.withValues(alpha: 0)],
85+
).createShader(const Rect.fromLTWH(-1, -1, 2, 2)),
86+
);
87+
canvas.restore();
88+
}
89+
3990
@override
40-
bool shouldRepaint(_DotGridPainter oldDelegate) => false;
91+
bool shouldRepaint(_OnboardingShellPainter oldDelegate) =>
92+
oldDelegate.isDark != isDark;
4193
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
part of '../pairing_page.dart';
2+
3+
// Foregrounds for the fixed Buzz shell artwork, independent of accent choice.
4+
extension _OnboardingColors on BuildContext {
5+
bool get _onboardingIsDark => Theme.of(this).brightness == Brightness.dark;
6+
Color get _onboardingInk =>
7+
_onboardingIsDark ? const Color(0xFFE6EDF0) : const Color(0xFF111111);
8+
Color get _onboardingMutedInk =>
9+
_onboardingIsDark ? const Color(0xFFAAB8C0) : const Color(0xB3111111);
10+
Color get _onboardingCtaLabel =>
11+
_onboardingIsDark ? const Color(0xFF172229) : const Color(0xFFD7E6F0);
12+
Color get _onboardingErrorInk =>
13+
_onboardingIsDark ? const Color(0xFFFFAAA0) : const Color(0xFF7A1025);
14+
Color get _onboardingInputSurface => _onboardingIsDark
15+
? const Color(0xFF233039)
16+
: Colors.white.withValues(alpha: 0.7);
17+
18+
OutlineInputBorder get _inputBorder => OutlineInputBorder(
19+
borderRadius: BorderRadius.circular(Radii.md),
20+
borderSide: BorderSide(color: _onboardingInk.withValues(alpha: 0.18)),
21+
);
22+
23+
ButtonStyle get _onboardingButtonStyle => FilledButton.styleFrom(
24+
minimumSize: const Size(0, 48),
25+
padding: const EdgeInsets.symmetric(
26+
horizontal: Grid.lg,
27+
vertical: Grid.twelve,
28+
),
29+
backgroundColor: _onboardingInk,
30+
foregroundColor: _onboardingCtaLabel,
31+
disabledBackgroundColor: _onboardingInk.withValues(alpha: 0.38),
32+
disabledForegroundColor: _onboardingCtaLabel.withValues(alpha: 0.7),
33+
shape: const StadiumBorder(),
34+
);
35+
36+
ButtonStyle get _onboardingSecondaryButtonStyle => TextButton.styleFrom(
37+
minimumSize: const Size(0, 44),
38+
padding: const EdgeInsets.symmetric(
39+
horizontal: Grid.md,
40+
vertical: Grid.xxs,
41+
),
42+
backgroundColor: _onboardingInk.withValues(alpha: 0.1),
43+
foregroundColor: _onboardingInk,
44+
disabledBackgroundColor: _onboardingInk.withValues(alpha: 0.05),
45+
disabledForegroundColor: _onboardingInk.withValues(alpha: 0.45),
46+
shape: const StadiumBorder(),
47+
);
48+
}

0 commit comments

Comments
 (0)