Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions docs/kiingo-fork-inventory.json
Original file line number Diff line number Diff line change
Expand Up @@ -1559,6 +1559,19 @@
"purpose": "Typing status phases on mobile: reads the optional {\"v\":1,\"phase\":...} content of kind:20002 typing events and shows the sender's status line (starting up, warming up a session, reconnecting, working, typing); unknown or malformed payloads stay plain typing and \"idle\" ends that sender's typing at once. Typing and the replies that clear it are keyed by the reply e-tag, matching desktop. Kiingo M-4017.",
"removalCondition": "Drop when upstream reads typing status phases and scopes mobile typing by the reply tag, or Kiingo agents stop sending phases.",
"upstreamStatus": "Generic typing-status extension (backward-compatible content field); not yet submitted to block/buzz."
},
{
"classification": "drop/upstream-present",
"owner": "Buzz mobile maintainers",
"purpose": "Cherry-pick of upstream block/buzz bf8b356f3 (#8407): opening a channel on iOS 27 terminated the app (CALayerInvalidGeometry) because an unbounded reversed timeline sent Infinity to the native navigation bar. Uses the finite viewport depth and rejects non-finite offsets natively. Shipped ahead of the next sync for Kiingo TestFlight build 4 (M-4017).",
"upstreamStatus": "Upstream-present: block/buzz bf8b356f3 (#8407), landed after snapshot 97e1f6a0.",
"removalCondition": "Drop at the next upstream sync whose snapshot includes block/buzz #8407; these paths then match upstream.",
"paths": [
"mobile/ios/Runner/IosNavigationBar.swift",
"mobile/ios/RunnerTests/RunnerTests.swift",
"mobile/lib/shared/widgets/frosted_scaffold.dart",
"mobile/test/shared/widgets/frosted_scaffold_test.dart"
]
}
],
"budgetAmendments": [
Expand Down
1 change: 1 addition & 0 deletions mobile/ios/Runner/IosNavigationBar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,7 @@ private final class IosNavigationBarView: NSObject, FlutterPlatformView {
}

private func setScrollOffset(_ value: CGFloat) {
guard value.isFinite else { return }
offset = max(0, value)
material.alpha = alwaysFrosted ? 1 : min(1, offset / 12)
applyScroll()
Expand Down
23 changes: 23 additions & 0 deletions mobile/ios/RunnerTests/RunnerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,29 @@ class RunnerTests: XCTestCase {
}
}

@MainActor
func testNavigationIgnoresNonFiniteScrollOffsets() throws {
let parent = UIViewController()
let window = UIWindow(frame: UIScreen.main.bounds)
window.rootViewController = parent
window.makeKeyAndVisible()
defer { window.isHidden = true }
let messenger = NavigationTestMessenger()
let bar = IosNavigationBarFactory(messenger: messenger, parent: parent).create(
withFrame: CGRect(x: 0, y: 0, width: window.bounds.width, height: 120),
viewIdentifier: 999990,
arguments: ["title": "general", "alwaysFrosted": true])
parent.view.addSubview(bar.view())
bar.view().layoutIfNeeded()
let navigation = try XCTUnwrap(parent.children.first as? UINavigationController)
let scroll = try XCTUnwrap(navigation.topViewController?.view as? UIScrollView)
messenger.scroll(to: 52)
let finiteOffset = scroll.contentOffset.y
XCTAssertTrue(finiteOffset.isFinite)
messenger.scroll(to: .infinity)
XCTAssertEqual(scroll.contentOffset.y, finiteOffset, accuracy: 0.5)
}

@MainActor
func testSubtitlelessThreadKeepsFullFallbackBehindControls() throws {
let parent = UIViewController()
Expand Down
10 changes: 8 additions & 2 deletions mobile/lib/shared/widgets/frosted_scaffold.dart
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,14 @@ class FrostedScaffold extends HookWidget {
if (!nativePinned && depth == 0 && metrics.axis == Axis.vertical) {
// Keep real depth so a later UIKit metrics update (Dynamic Type or
// rotation) can apply its new collapse range without another scroll.
final next = topContentDepth.clamp(0.0, double.infinity);
if ((scrollOffset.value - next).abs() > 0.1) {
// Lazy reversed lists can report an unbounded extentAfter. The
// visible viewport is enough depth for UIKit's collapsed state,
// while infinity is not a valid UIScrollView content offset.
final finiteDepth = topContentDepth.isFinite
? topContentDepth
: metrics.viewportDimension;
final next = finiteDepth.clamp(0.0, double.infinity);
if (next.isFinite && (scrollOffset.value - next).abs() > 0.1) {
WidgetsBinding.instance.addPostFrameCallback((_) {
if (context.mounted) scrollOffset.value = next;
});
Expand Down
30 changes: 30 additions & 0 deletions mobile/test/shared/widgets/frosted_scaffold_test.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:buzz/shared/theme/theme.dart';
import 'package:buzz/shared/widgets/frosted_app_bar.dart';
import 'package:buzz/shared/widgets/frosted_scaffold.dart';
import 'package:buzz/shared/widgets/ios_navigation_bar.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';

Expand All @@ -12,6 +13,35 @@ Border? _appBarBorder(WidgetTester tester) {
}

void main() {
testWidgets('unbounded reversed scroll depth stays finite for native bar', (
tester,
) async {
await tester.pumpWidget(
const MaterialApp(
home: FrostedScaffold(
appBar: FrostedAppBar(title: Text('Conversation')),
body: SizedBox(key: ValueKey('timeline')),
),
),
);
final source = tester.element(find.byKey(const ValueKey('timeline')));
final offset = IosNavigationScrollScope.maybeOf(source)!;
ScrollUpdateNotification(
metrics: FixedScrollMetrics(
minScrollExtent: 0,
maxScrollExtent: double.infinity,
pixels: 0,
viewportDimension: 600,
axisDirection: AxisDirection.up,
devicePixelRatio: 1,
),
context: source,
scrollDelta: 0,
).dispatch(source);
await tester.pump();
expect(offset.value, 600);
});

testWidgets('foreground paints above header and leaves body interactive', (
tester,
) async {
Expand Down