mirror of
https://github.com/block/buzz.git
synced 2026-11-08 18:31:56 +00:00
## Summary Make community onboarding easier to scan: shorten hosted hostname fallbacks, clarify Add Community instructions, and replace raw saved-key buttons with identity cards. Use white pages, grey cards, ghost secondary actions, standard page transitions, and a “Getting ready” screen during joining. Native profile setup keeps a horizontal modal transition. Identity cards load signed name/avatar metadata from saved communities without switching accounts; unavailable profiles use a neutral fallback. Cards show only the avatar, a 16px medium-weight name, and muted npub; community lists are omitted. Retiring profile setup closes its avatar editor too. ### Related issue Follow-up to #8687 and #8599; no duplicate PR found. ### Testing - Formatting and analysis passed. Full suite with hosted-auth defines: 4,019 passed, 5 skipped; includes profile-fetch and cancellation regressions. - Prior iOS device preview and native profile tests passed; hosted CI native Swift checks passed on the preceding head. Latest Dart fixes are not yet reinstalled on the phone. - Simulator walkthrough and owner-tested iPhone preview use sample identities and simulated admission. Sample-data previews; the identity snapshot shows the unavailable-profile fallback rendered by Flutter. Media is attached here only. | Community picker | Add Community | Saved identity | | --- | --- | --- | |  |  |  | --------- Signed-off-by: kenny lopez <klopez4212@gmail.com> Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz>
57 lines
1.6 KiB
Dart
57 lines
1.6 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
/// A standard onboarding route that skips motion when the OS requests it.
|
|
Route<T> onboardingRoute<T>(
|
|
BuildContext context, {
|
|
required WidgetBuilder builder,
|
|
RouteSettings? settings,
|
|
}) {
|
|
if (MediaQuery.disableAnimationsOf(context)) {
|
|
return PageRouteBuilder<T>(
|
|
settings: settings,
|
|
transitionDuration: Duration.zero,
|
|
reverseTransitionDuration: Duration.zero,
|
|
pageBuilder: (context, _, _) => Semantics(
|
|
scopesRoute: true,
|
|
explicitChildNodes: true,
|
|
child: builder(context),
|
|
),
|
|
);
|
|
}
|
|
return MaterialPageRoute<T>(settings: settings, builder: builder);
|
|
}
|
|
|
|
/// Declarative counterpart of [onboardingRoute] for nested onboarding steps.
|
|
class OnboardingPage<T> extends MaterialPage<T> {
|
|
const OnboardingPage({super.key, required super.child});
|
|
|
|
@override
|
|
Route<T> createRoute(BuildContext context) {
|
|
if (!MediaQuery.disableAnimationsOf(context)) {
|
|
return super.createRoute(context);
|
|
}
|
|
return _InstantOnboardingRoute<T>(this);
|
|
}
|
|
}
|
|
|
|
class _InstantOnboardingRoute<T> extends PageRouteBuilder<T> {
|
|
_InstantOnboardingRoute(OnboardingPage<T> page)
|
|
: super(
|
|
settings: page,
|
|
transitionDuration: Duration.zero,
|
|
reverseTransitionDuration: Duration.zero,
|
|
pageBuilder: (_, _, _) => const SizedBox.shrink(),
|
|
);
|
|
|
|
@override
|
|
Widget buildPage(
|
|
BuildContext context,
|
|
Animation<double> animation,
|
|
Animation<double> secondaryAnimation,
|
|
) => Semantics(
|
|
scopesRoute: true,
|
|
explicitChildNodes: true,
|
|
child: (settings as OnboardingPage<T>).child,
|
|
);
|
|
}
|