mirror of
https://github.com/block/buzz.git
synced 2026-11-13 21:01:53 +00:00
Duo keeps conversations and Settings details open across closed, book and flat postures. Book mode splits at the fold; flattening restores the sidebar. Native rail controls, full-width navigation backdrops and sheet-local safe areas keep content aligned. Ordinary iPhones remain single-pane in portrait and landscape; tablet and Duo split layouts remain enabled. Includes the recovered preview's matching pane widths, Buzz empty-pane mark, stable Settings chevrons, Bestie pane routing and Duo-only upward New menu attachment. Current main's Activity redesign, Search content fade and unread-navigation button are retained. Menu selection checks sit beside their labels. Shared mobile changes remain in scope: the native iOS status editor, Appearance preview layout, avatar crop preservation, onboarding footer layout, profile/invite sheet geometry and nested conversation navigation. This PR is not exclusively Duo-gated. Nested navigator observers preserve recording cancellation and navigation callbacks; crop resizing preserves the selected image region. iOS 27.1 APIs remain compile-time and runtime gated. Validation on the reconciled source: Flutter analysis, Activity/Home journeys, the full mobile test suite, file-size checks and Swift package tests. The iPhone single-pane fix was also exercised on an iPhone 18 Pro simulator before reconciliation. Fresh hosted CI and physical-device confirmation of the reconciled build are separate and remain pending. --------- Signed-off-by: kenny lopez <klopez4212@gmail.com> Signed-off-by: Tom Brow <tomb@squareup.com> Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Tom Brow <tomb@block.xyz> Co-authored-by: Tom Brow <tomb@squareup.com>
61 lines
2.1 KiB
Dart
61 lines
2.1 KiB
Dart
import 'package:flutter/widgets.dart';
|
|
|
|
/// Shared route lifecycle for native navigation and recording cleanup.
|
|
final appRouteObserver = AppRouteObserver();
|
|
|
|
/// Also reports reveals after the covering route has finished animating out.
|
|
class AppRouteObserver extends RouteObserver<ModalRoute<dynamic>> {
|
|
/// Creates a navigator-owned bridge to the shared route subscriptions.
|
|
/// Each nested navigator needs its own observer instance; Flutter observers
|
|
/// cannot be attached to more than one navigator at a time.
|
|
NavigatorObserver createNestedObserver() => _NestedAppRouteObserver(this);
|
|
|
|
final _revealListeners = <ModalRoute<dynamic>, Set<VoidCallback>>{};
|
|
|
|
/// Registers a layout refresh for the end of a covering route's transition.
|
|
void addRevealListener(ModalRoute<dynamic> route, VoidCallback listener) {
|
|
(_revealListeners[route] ??= {}).add(listener);
|
|
}
|
|
|
|
/// Stops reporting completed reveals to a disposed navigation view.
|
|
void removeRevealListener(ModalRoute<dynamic> route, VoidCallback listener) {
|
|
final listeners = _revealListeners[route];
|
|
listeners?.remove(listener);
|
|
if (listeners?.isEmpty ?? false) _revealListeners.remove(route);
|
|
}
|
|
|
|
@override
|
|
void didPop(Route<dynamic> route, Route<dynamic>? previousRoute) {
|
|
super.didPop(route, previousRoute);
|
|
if (route is! TransitionRoute<dynamic> ||
|
|
previousRoute is! ModalRoute<dynamic>) {
|
|
return;
|
|
}
|
|
route.completed.then((_) {
|
|
if (!previousRoute.isCurrent) return;
|
|
final listeners = List<VoidCallback>.of(
|
|
_revealListeners[previousRoute] ?? const {},
|
|
);
|
|
for (final listener in listeners) {
|
|
if (_revealListeners[previousRoute]?.contains(listener) ?? false) {
|
|
listener();
|
|
}
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
class _NestedAppRouteObserver extends NavigatorObserver {
|
|
_NestedAppRouteObserver(this.delegate);
|
|
|
|
final AppRouteObserver delegate;
|
|
|
|
@override
|
|
void didPush(Route<dynamic> route, Route<dynamic>? previousRoute) =>
|
|
delegate.didPush(route, previousRoute);
|
|
|
|
@override
|
|
void didPop(Route<dynamic> route, Route<dynamic>? previousRoute) =>
|
|
delegate.didPop(route, previousRoute);
|
|
}
|