From 39b8b2b6a6d065b3da981e096b1a3881f1c63fd4 Mon Sep 17 00:00:00 2001 From: klopez4212 Date: Thu, 29 Oct 2026 14:27:22 +0000 Subject: [PATCH] feat(mobile): unify Messages navigation with Solo and Team filters (#8649) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary Unify mobile conversations in Messages with All / Solo / Team filters, a collapsing header, and separate Search, New, and default-agent shortcuts. Move workspace actions into the community menu and keep collapsed sections intact across filters. Align Inbox and list typography, spacing, and muted controls. Preserve native glass layering through navigation and give every filtered list enough clearance above the footer. The default-agent shortcut reads the shared encrypted preference and opens an existing chat immediately. When unset, it opens Agents; a star action selects the default through a production signed, self-encrypted preference writer. Save failures remain visible and retryable. Android now uses rounded navigation controls and filters, optically balanced search icons, and expanding New/community menus with leading Tabler icons matching iOS. Preset avatars retain transparent WebM animation through an Android WebView renderer, with lifecycle pausing and poster fallback. ### Related issue None found in searches for mobile navigation issues and open PRs. ### Testing - Android follow-up: ARM64 debug build, Dart analysis, and emulator checks passed for menu placement, selection, icon alignment, search, and avatar playback/pause/resume. The avatar implementation passed 3,840 Flutter tests and native Android tests before subsequent styling iterations. Automated tests for the later menu/icon iterations were skipped at the author’s request; those earlier results do not cover the final styling changes. - Mobile formatting/analysis and full test suite (3,838 passed, 23 skipped, plus 4 push-configuration tests); regression journey covers filtering, collapse retention, and scrolling the last Solo row above the footer. - iPhone 18 Pro simulator (Honeycomb): filters, menus, Inbox, Invite/Back, Switch Community, and default-agent chat/Back exercised. iOS release build and Pairing Preview install/launch passed during iteration, preserving the saved profile. - P1 follow-up: production writer-to-reader widget journey covers selection, publish failure/retry, and the unset footer opening Agents. Simulator Agents open/close passes; its saved community has no selectable agents, so live selection was not verified there. - Independent agent review completed; its Solo footer-clearance finding is fixed. The final clearance adjustment is covered by widget tests; physical-device acceptance of that adjustment and hosted CI remain pending. Final Messages layout: ![Messages with All, Solo and Team filters and separate bottom shortcuts](https://github.com/user-attachments/assets/562ddc3e-945b-4945-bd58-217a2c62b570) Switcher layering during iteration (before → after): | Before: filter edge showing through | After: Home hidden behind switcher | | --- | --- | | ![Filter edge visible beside Switch Community](https://github.com/user-attachments/assets/b32a0157-8b17-4f01-9a23-29b12ce3b1af) | ![Clean Switch Community screen](https://github.com/user-attachments/assets/222956e4-9989-4c8f-a162-65de45029845) | --------- Signed-off-by: kenny lopez Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz> --- .../xyz/block/buzz/mobile/MainActivity.kt | 4 + .../buzz/mobile/TransparentAvatarView.kt | 110 +++ .../buzz/mobile/TransparentAvatarViewTest.kt | 23 + .../ios/Runner/ConcentricSheetSurface.swift | 10 +- .../ios/Runner/JumpToLatestGlassButton.swift | 62 +- mobile/ios/Runner/NativeTabler.swift | 4 + mobile/lib/app.dart | 18 +- mobile/lib/features/agents/agents_sheet.dart | 278 +++++-- .../agents/community_bot_profiles.dart | 27 + .../features/agents/create_agent_sheet.dart | 59 +- .../channels/channel_management_provider.dart | 19 + .../lib/features/channels/channels_page.dart | 356 +++++--- .../features/channels/channels_page/body.dart | 183 +++- .../channels/channels_page/channel_tile.dart | 4 +- .../channels_page/header_actions.dart | 79 +- .../channels/channels_page/quick_actions.dart | 4 +- .../channels/channels_page/sections.dart | 56 +- .../channels/default_agent_launcher.dart | 150 ++++ mobile/lib/features/channels/me/me_page.dart | 367 ++++---- .../features/channels/me/me_page_helpers.dart | 18 +- .../lib/features/channels/me/me_section.dart | 28 +- mobile/lib/features/home/home_page.dart | 731 +++++----------- .../lib/features/home/messages_filters.dart | 41 + .../home/messages_navigation_bar.dart | 61 ++ mobile/lib/features/search/search_page.dart | 51 +- .../lib/features/settings/settings_page.dart | 27 +- mobile/lib/shared/me/default_agent.dart | 133 +++ .../lib/shared/me/default_agent_writer.dart | 65 ++ mobile/lib/shared/theme/app_theme.dart | 3 + mobile/lib/shared/theme/buzz_theme.dart | 6 + mobile/lib/shared/theme/grid.dart | 6 + .../lib/shared/theme/message_typography.dart | 17 + .../shared/widgets/agent_navigation_icon.dart | 54 ++ .../android_expanding_menu_button.dart | 336 ++++++++ .../widgets/android_transparent_avatar.dart | 56 ++ .../lib/shared/widgets/buzz_search_field.dart | 150 ++-- .../widgets/concentric_sheet_surface.dart | 71 +- .../lib/shared/widgets/filter_chip_bar.dart | 69 +- .../lib/shared/widgets/frosted_app_bar.dart | 23 +- .../widgets/ios_message_create_button.dart | 159 ++++ .../widgets/navigation_button_surface.dart | 33 + .../shared/widgets/preset_agent_avatar.dart | 119 +++ .../widgets/retained_page_transition.dart | 76 ++ .../test/features/agents/agents_harness.dart | 51 +- .../features/agents/agents_sheet_test.dart | 71 ++ .../agents/community_bot_profiles_test.dart | 29 + .../agents/create_agent_sheet_test.dart | 38 +- .../channel_management_provider_test.dart | 58 ++ .../features/channels/channels_page_test.dart | 522 +++++------- .../dm_recipient_layout_tests.dart | 2 +- .../channels_page_test/presence_tests.dart | 2 +- .../channels_page_test/read_seed_journey.dart | 2 +- .../channels/default_agent_launcher_test.dart | 73 ++ .../features/channels/me/me_unread_test.dart | 33 +- mobile/test/features/home/home_page_test.dart | 782 ++++++------------ .../settings/settings_overlay_test.dart | 385 ++++----- mobile/test/shared/me/default_agent_test.dart | 117 +++ .../shared/widgets/filter_chip_bar_test.dart | 7 +- .../widgets/modal_presentation_test.dart | 15 +- .../widgets/preset_agent_avatar_test.dart | 184 +++++ scripts/flake-check.mjs | 6 +- scripts/flake-check.test.mjs | 4 +- 62 files changed, 4178 insertions(+), 2349 deletions(-) create mode 100644 mobile/android/app/src/main/kotlin/xyz/block/buzz/mobile/TransparentAvatarView.kt create mode 100644 mobile/android/app/src/test/kotlin/xyz/block/buzz/mobile/TransparentAvatarViewTest.kt create mode 100644 mobile/lib/features/agents/community_bot_profiles.dart create mode 100644 mobile/lib/features/channels/default_agent_launcher.dart create mode 100644 mobile/lib/features/home/messages_filters.dart create mode 100644 mobile/lib/features/home/messages_navigation_bar.dart create mode 100644 mobile/lib/shared/me/default_agent.dart create mode 100644 mobile/lib/shared/me/default_agent_writer.dart create mode 100644 mobile/lib/shared/widgets/agent_navigation_icon.dart create mode 100644 mobile/lib/shared/widgets/android_expanding_menu_button.dart create mode 100644 mobile/lib/shared/widgets/android_transparent_avatar.dart create mode 100644 mobile/lib/shared/widgets/ios_message_create_button.dart create mode 100644 mobile/lib/shared/widgets/navigation_button_surface.dart create mode 100644 mobile/lib/shared/widgets/preset_agent_avatar.dart create mode 100644 mobile/lib/shared/widgets/retained_page_transition.dart create mode 100644 mobile/test/features/agents/community_bot_profiles_test.dart create mode 100644 mobile/test/features/channels/default_agent_launcher_test.dart create mode 100644 mobile/test/shared/me/default_agent_test.dart create mode 100644 mobile/test/shared/widgets/preset_agent_avatar_test.dart diff --git a/mobile/android/app/src/main/kotlin/xyz/block/buzz/mobile/MainActivity.kt b/mobile/android/app/src/main/kotlin/xyz/block/buzz/mobile/MainActivity.kt index 72a7da67d0..a27564c831 100644 --- a/mobile/android/app/src/main/kotlin/xyz/block/buzz/mobile/MainActivity.kt +++ b/mobile/android/app/src/main/kotlin/xyz/block/buzz/mobile/MainActivity.kt @@ -137,6 +137,10 @@ class MainActivity : FlutterFragmentActivity() { override fun configureFlutterEngine(flutterEngine: FlutterEngine) { super.configureFlutterEngine(flutterEngine) + flutterEngine.platformViewsController.registry.registerViewFactory( + "buzz/transparent-avatar", + TransparentAvatarViewFactory(flutterEngine.dartExecutor.binaryMessenger), + ) hostedHpkePlugin = HostedHpkePlugin(flutterEngine.dartExecutor.binaryMessenger) identityFilePlugin = IdentityFilePlugin(this, flutterEngine.dartExecutor.binaryMessenger) hapticsPlugin = HapticsPlugin(this, flutterEngine.dartExecutor.binaryMessenger) diff --git a/mobile/android/app/src/main/kotlin/xyz/block/buzz/mobile/TransparentAvatarView.kt b/mobile/android/app/src/main/kotlin/xyz/block/buzz/mobile/TransparentAvatarView.kt new file mode 100644 index 0000000000..413f262027 --- /dev/null +++ b/mobile/android/app/src/main/kotlin/xyz/block/buzz/mobile/TransparentAvatarView.kt @@ -0,0 +1,110 @@ +package xyz.block.buzz.mobile + +import android.annotation.SuppressLint +import android.content.Context +import android.graphics.Color +import android.view.View +import android.webkit.WebResourceRequest +import android.webkit.WebResourceResponse +import android.webkit.WebView +import android.webkit.WebViewClient +import io.flutter.plugin.common.BinaryMessenger +import io.flutter.plugin.common.MethodChannel +import io.flutter.plugin.common.StandardMessageCodec +import io.flutter.plugin.platform.PlatformView +import io.flutter.plugin.platform.PlatformViewFactory +import java.io.ByteArrayInputStream + +// Only bundled avatar assets may enter the local HTML document. +internal fun isTransparentAvatarVideo(url: String): Boolean = Regex( + "https://dwwgwmfqqjotj\\.cloudfront\\.net/avatars/[A-Za-z0-9_-]+/webm/[A-Za-z0-9_-]+/[A-Za-z0-9_-]+\\.webm", +).matches(url) + +internal class TransparentAvatarViewFactory(private val messenger: BinaryMessenger) : + PlatformViewFactory(StandardMessageCodec.INSTANCE) { + override fun create(context: Context, viewId: Int, args: Any?): PlatformView { + val parameters = args as? Map<*, *> + return TransparentAvatarView(context, viewId, messenger, parameters?.get("url") as? String ?: "") + } +} + +/** Chromium composites WebM alpha; Android's native video decoder drops it. */ +@SuppressLint("SetJavaScriptEnabled") +private class TransparentAvatarView( + context: Context, + id: Int, + messenger: BinaryMessenger, + url: String, +) : PlatformView { + private val webView = WebView(context) + private val channel = MethodChannel(messenger, "buzz/transparent-avatar/$id") + private var playing = false + private var disposed = false + + init { + webView.setBackgroundColor(Color.TRANSPARENT) + webView.isFocusable = false + webView.isClickable = false + webView.importantForAccessibility = View.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS + webView.settings.apply { + javaScriptEnabled = true + mediaPlaybackRequiresUserGesture = false + allowFileAccess = false + allowContentAccess = false + domStorageEnabled = false + mixedContentMode = android.webkit.WebSettings.MIXED_CONTENT_NEVER_ALLOW + } + val valid = isTransparentAvatarVideo(url) + val poster = url.replace("/webm/", "/poster/").removeSuffix(".webm") + ".png" + webView.webViewClient = object : WebViewClient() { + override fun shouldOverrideUrlLoading(view: WebView, request: WebResourceRequest) = true + override fun shouldInterceptRequest(view: WebView, request: WebResourceRequest): WebResourceResponse? { + val target = request.url.toString() + return if (valid && (target == url || target == poster)) null else + WebResourceResponse("text/plain", "UTF-8", ByteArrayInputStream(ByteArray(0))) + } + override fun onPageFinished(view: WebView, loadedUrl: String) { updatePlayback() } + } + channel.setMethodCallHandler { call, result -> + if (!valid) { + result.error("unsupported_avatar", "The avatar is not a bundled HTTPS WebM.", null) + } else if (call.method == "setPlaying") { + playing = call.arguments == true + updatePlayback() + result.success(null) + } else { + result.notImplemented() + } + } + if (valid) { + // No remote HTML, scripts, navigation, native JS bridge, or user-provided markup. + webView.loadDataWithBaseURL( + "https://dwwgwmfqqjotj.cloudfront.net/", + """ + + + + """, + "text/html", "UTF-8", null, + ) + } + } + + private fun updatePlayback() { + if (disposed) return + webView.evaluateJavascript( + "var v=document.getElementById('avatar');if(v){" + + if (playing) "v.play().catch(function(){});}" else "v.pause();}", + null, + ) + } + + override fun getView(): View = webView + + override fun dispose() { + disposed = true + channel.setMethodCallHandler(null) + webView.stopLoading() + webView.destroy() + } +} diff --git a/mobile/android/app/src/test/kotlin/xyz/block/buzz/mobile/TransparentAvatarViewTest.kt b/mobile/android/app/src/test/kotlin/xyz/block/buzz/mobile/TransparentAvatarViewTest.kt new file mode 100644 index 0000000000..7f9f324527 --- /dev/null +++ b/mobile/android/app/src/test/kotlin/xyz/block/buzz/mobile/TransparentAvatarViewTest.kt @@ -0,0 +1,23 @@ +package xyz.block.buzz.mobile + +import org.junit.Assert.assertFalse +import org.junit.Assert.assertTrue +import org.junit.Test + +class TransparentAvatarViewTest { + @Test + fun `only bundled HTTPS WebM URLs may enter the local document`() { + val url = "https://dwwgwmfqqjotj.cloudfront.net/avatars/20260925T154625166Z/webm/gloopies/gloopies-13.webm" + assertTrue(isTransparentAvatarVideo(url)) + listOf( + url.replace("https:", "http:"), + url.replace(".net/", ".net.evil.example/"), + url.replace("/avatars/", "/other/"), + url.replace("gloopies-13", "../gloopies-13"), + "$url?redirect=https://evil.example", + "$url#fragment", + url.replace("gloopies-13", "\">