feat: web client improvements and contact matching#2984
feat: web client improvements and contact matching#2984ThePieMonster wants to merge 3 commits intoBlueBubblesApp:developmentfrom
Conversation
…d build fixes - Fix contact name display on web by improving matching logic (case-insensitive emails, numeric phone comparison, bidirectional suffix matching) and ensuring chat tiles reactively update after contacts are fetched from the server - Add in-app notification snackbar setting with UI toggle - Add web stubs for HTML models, media_kit, network_tools, tenor, and objectbox - Use conditional import for NativeAdapter (native_dio_adapter) to fix web build with Flutter 3.27.4 - Pin js package to 0.7.1 for Dart 3.6 compatibility - Initialize dummy database boxes on web instead of skipping entirely - Remove triggerImmediately from ObjectBox watch queries - Add contacts/handle matching status to server management panel - Re-fetch chats on web after incremental sync - Prevent duplicate chats in addChat by checking guid
There was a problem hiding this comment.
Pull request overview
This PR focuses on improving the Flutter web experience and build compatibility by enhancing contact/handle matching & reactive UI updates, adding an in-app notification snackbar setting, and introducing/expanding web stubs and conditional imports to unblock web builds.
Changes:
- Improve web contact matching (case-insensitive emails, numeric phone comparison, bidirectional suffix matching) and refresh chat titles after contacts load.
- Add “In-App Message Notifications” setting and display snackbar notifications when enabled.
- Add/extend web shims (ObjectBox, media_kit, network_tools, HTML models) and adjust dependencies/imports for web + Dart compatibility.
Reviewed changes
Copilot reviewed 39 out of 42 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| web/index.html | Switch base href to Flutter’s build-time base-href variable. |
| pubspec.yaml | Pin js override to 0.7.1 for compatibility. |
| pubspec.lock | Lockfile update reflecting js 0.7.1. |
| lib/utils/logger.dart | Barrel export for restructured logger module. |
| lib/services/ui/message/messages_service.dart | Remove triggerImmediately from ObjectBox watch. |
| lib/services/ui/contact_service.dart | Improve contact-to-handle and handle-to-contact matching logic. |
| lib/services/ui/chat/global_chat_service.dart | Remove triggerImmediately from chats watch. |
| lib/services/ui/chat/chats_service.dart | Web contact fetch/matching after chat load; dedupe addChat; refresh list; snackbar on load. |
| lib/services/network/native_adapter_stub.dart | Web stub for setting Dio native adapter (no-op). |
| lib/services/network/native_adapter_io.dart | IO implementation to set Dio NativeAdapter. |
| lib/services/network/http_service.dart | Conditional import + use setNativeAdapter to fix web build. |
| lib/services/backend/sync/sync_service.dart | On web, re-fetch chats after incremental sync. |
| lib/services/backend/settings/settings_service.dart | Change saveFCMData persistence behavior (no wait). |
| lib/services/backend/notifications/notifications_service.dart | Remove triggerImmediately; add in-app snackbar notifications toggle. |
| lib/models/models.dart | Barrel export for renamed database models path. |
| lib/models/html/theme.dart | Web theme struct shim implementation. |
| lib/models/html/theme_object.dart | Deprecated ThemeObject shim for web builds. |
| lib/models/html/theme_entry.dart | ThemeEntry shim for web builds. |
| lib/models/html/tenor.dart | Web Tenor API key stub. |
| lib/models/html/objectbox.dart | ObjectBox API shims for web compilation. |
| lib/models/html/network_tools.dart | network_tools shim for web compilation. |
| lib/models/html/message.dart | Web Message model shim and merge/toMap/fromMap logic. |
| lib/models/html/media_kit.dart | media_kit/media_kit_video shim for web compilation. |
| lib/models/html/launch_at_startup.dart | Web LaunchAtStartup stub (throws unsupported). |
| lib/models/html/handle.dart | Web Handle model shim with webContact linkage. |
| lib/models/html/fcm_data.dart | Web FCMData shim using prefs. |
| lib/models/html/contact.dart | Web Contact model shim. |
| lib/models/html/chat.dart | Web Chat model shim + participant syncing hooks. |
| lib/models/html/attachment.dart | Web Attachment model shim. |
| lib/helpers/network/network_tasks.dart | On web connect, fetch server contacts and match to handles. |
| lib/database/html/network_tools.dart | Expand existing DB web shim to include HostScannerService + configure stub. |
| lib/database/html/media_kit.dart | Expand existing DB web shim to include missing API surface. |
| lib/database/html/fcm_data.dart | Make deleteFcmData return Future. |
| lib/database/global/settings.dart | Add showInAppNotifications; change some defaults to true. |
| lib/database/database.dart | Initialize dummy boxes on web (instead of returning early). |
| lib/app/layouts/settings/pages/system/notification_panel.dart | Add UI toggle for in-app message notifications. |
| lib/app/layouts/settings/pages/server/server_management_panel.dart | Display server contacts + contact matching status indicators. |
| lib/app/layouts/conversation_list/widgets/tile/conversation_tile.dart | Web: ensure titles rebuild when contacts are matched/updated. |
| lib/app/layouts/conversation_list/pages/search/search_view.dart | Conditional import for ObjectBox native query types to compile on web. |
| .gitignore | Simplify .dart_tool ignore rule. |
| .fvmrc | Add Flutter version pinning for FVM. |
Comments suppressed due to low confidence (1)
lib/services/ui/message/messages_service.dart:64
currentCountstarts at 0 and, withwatch()not triggering immediately, the first incoming message can be skipped because handling is gated oncurrentCount != 0. RestoretriggerImmediately: trueor initializecurrentCountfrom an initial query count before subscribing so the first message is processed.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
"Platform._operatingSystem" crashes on web. Fixes rendering errors in Notification Providers, Developer Tools, More Settings, Connection & Server Management, and Backup & Restore panels. - Add !kIsWeb guards to Platform.isAndroid/isWindows/isLinux calls across settings panels and settings_items_list.dart - Wrap file system calls in troubleshoot_panel initState with !kIsWeb - Reorder backup_restore_panel.defaultName() to check kIsWeb first - Remove deprecated --web-renderer html flag (fixes wide font spacing) - Add mobile-web-app-capable meta tag to suppress deprecation warning - Add "App Build: Debug/Release" to Connection & Server Details - Add startup completion log message via debugPrint
- Fix dbStructuredName setter in web contact stub to actually assign the value - Complete Database.initComplete on web so waitForInit() doesn't hang - Update .fvmrc to match actual Flutter 3.27.4 build target Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
@zlshames when you have a minute can you take a look? |
|
So, as far as web goes, due to how different the architecture is compared to android/desktop, I've highly considered deprecating Web from the main codebase. Supporting it requires significant custom handling, making it hard to maintain and manage alongside the android/desktop code. And ultimately, it kinda results in spaghetti code. I'm addition, Flutter isn't super great with web... yet. I'm currently rewriting the app, and as I've been going along, I've been removing certain parts of code that pertained to web. Eventually, I'd like to get rid of all of the web specific code out of the app's codebase. This makes maintaining and updating the rest of the code base a lot more difficult as well. So moving forward, I think it makes sense to maintain a separate app/repo, specifically for web, using a web-dedicated framework like React or Vue. It would mean that we would need to maintain separate code for the app, but it would make everything easier imo. I haven't made up my mind yet, but I'm leaning towards that. As far as how we continue maintaining it, I think we just need to branch off the current development branch and merge any web specific code into there. Completely separate from the main code base. As I'm rewriting the app, I don't have time rn to review this, but once I'm done (which should be soon), I'm going to go and review all the PRs that have been made recently |
|
The alternative is to refactor the app code even further, to a repository-model where the UI is completely decoupled from the database layer. We'd also have to implement a sort of "hydration" strategy to ensure relationships are accounted for. In my current rewrite, I've already done a lot of that decoupling. So what I'm describing would mean more refactors. So it'll just take a while before we can fully do that. Again, for now, we'll just have to maintain a separate branch for web-specific updates |
|
Thanks for the reply @zlshames. More than happy to help with the Web UI. I am not big on the mobile usage, but I am a big user of the web interface and overtime have been wanting to change things around myself also. If you have any communication platforms (my Discord is in my bio) feel free to shot me a message on there and we can talk about the future of the web ui. Looking forward to the re-write! |
We have a discord channel that's on our website. That's the best way, just tag me in a message. I think as far as web goes, what I'd like to do is:
I think for step 3, it's best to keep a cache/DB like we do on other clients, but we aren't there yet anyways. Don't need to make the decision now. I think I'd personally want to do 1 and 2 first and then start 3 before letting contributors start helping with that. If you would like to contribute more regularly, I'd feel more comfortable letting you do more of the setup. But right now I'm just trying to avoid spaghetti code |
|
@zlshames Sounds good. Sent a Discord DM. We can continue the convo there. 💬 |
…d build fixes