Skip to content

fix: new thread sheet in android and add firebase support#57

Merged
sirily11 merged 2 commits into
mainfrom
new-thread-android
May 25, 2026
Merged

fix: new thread sheet in android and add firebase support#57
sirily11 merged 2 commits into
mainfrom
new-thread-android

Conversation

@sirily11

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings May 25, 2026 17:35
@vercel

vercel Bot commented May 25, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
rxcode Ready Ready Preview, Comment May 25, 2026 5:51pm

Request Review

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds Firebase (Analytics/Crashlytics + Android FCM push plumbing) across the macOS, iOS, Android apps and the relay server, and refreshes the Android “New Thread” sheet UI to better match the iOS experience.

Changes:

  • Add Firebase bootstrapping on Apple platforms, plus shared AnalyticsService and new analytics events emitted from key UI surfaces.
  • Add Android Firebase deps, FCM notification handling + deep-link routing, and push-token reporting to the desktop via the sync protocol.
  • Extend the relay /push endpoint to forward either APNs or FCM notifications (provider-selected).

Reviewed changes

Copilot reviewed 56 out of 57 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
scripts/ci/write-firebase-config.sh Decodes Firebase config files from CI secrets into expected paths.
RxCodeMobile/Views/ThreadChangesSheet.swift Logs analytics when diff sheet is opened.
RxCodeMobile/Views/ProjectsSidebar.swift Logs analytics for project start/open events.
RxCodeMobile/Views/NewThreadSheet.swift Logs analytics when a thread is created.
RxCodeMobile/Views/MobileRunProfileEditorView.swift Logs analytics when run profile editor opens.
RxCodeMobile/Views/MobileInAppBrowserView.swift Logs analytics when in-app browser opens (with host/proxy metadata).
RxCodeMobile/Views/MobileChatView.swift Logs analytics when a thread is opened.
RxCodeMobile/Views/MobileBriefingView.swift Logs analytics when briefing list opens.
RxCodeMobile/Views/MobileBriefingDetailView.swift Logs analytics when briefing detail opens.
RxCodeMobile/FirebaseBootstrap.swift Adds Firebase init + installs analytics handler (iOS).
RxCodeMobile/AppDelegate.swift Calls Firebase bootstrap during app launch.
RxCodeAndroid/gradle/libs.versions.toml Adds Firebase BOM + plugins to version catalog.
RxCodeAndroid/build.gradle.kts Adds Google Services + Crashlytics plugins (apply false).
RxCodeAndroid/app/src/main/java/app/rxlab/rxcode/ui/sheets/NewThreadSheet.kt New Android “New Thread” sheet UI and flow, returns draft session id.
RxCodeAndroid/app/src/main/java/app/rxlab/rxcode/ui/sessions/SessionsScreen.kt Updates new-thread flow to accept sessionId; makes viewModel non-nullable.
RxCodeAndroid/app/src/main/java/app/rxlab/rxcode/ui/RxCodeApp.kt Routes notification deep-links to the session and switches tabs.
RxCodeAndroid/app/src/main/java/app/rxlab/rxcode/ui/projects/ProjectsPane.kt Skips draft ids in cross-tab navigation; navigates to created session id.
RxCodeAndroid/app/src/main/java/app/rxlab/rxcode/ui/briefing/BriefingPane.kt Updates briefing new-thread navigation to consume session id.
RxCodeAndroid/app/src/main/java/app/rxlab/rxcode/ui/briefing/BriefingDetailScreen.kt Adds in-place NewThreadSheet from briefing details.
RxCodeAndroid/app/src/main/java/app/rxlab/rxcode/state/MobileState.kt Adds buffered notification deep-link session id to state.
RxCodeAndroid/app/src/main/java/app/rxlab/rxcode/state/MobileAppState.kt Reports FCM token on start/pair; adds notification deep-link buffer; adds draft→real session redirect map; returns draft id from startNewSession.
RxCodeAndroid/app/src/main/java/app/rxlab/rxcode/RxCodeApplication.kt Initializes Firebase and enables Crashlytics when configured.
RxCodeAndroid/app/src/main/java/app/rxlab/rxcode/push/RxCodeFirebaseMessagingService.kt Receives FCM messages, decrypts alert, shows notification, reports token refresh.
RxCodeAndroid/app/src/main/java/app/rxlab/rxcode/push/FcmTokenReporter.kt Sends FCM push token to paired desktops via sync protocol.
RxCodeAndroid/app/src/main/java/app/rxlab/rxcode/push/EncryptedAlert.kt Defines encrypted alert envelope + plaintext model.
RxCodeAndroid/app/src/main/java/app/rxlab/rxcode/proto/Payload.kt Adds push_token payload and serializer support (Android).
RxCodeAndroid/app/src/main/java/app/rxlab/rxcode/MainActivity.kt Requests notification permission (API 33+), forwards notification session deep-links to state.
RxCodeAndroid/app/src/main/AndroidManifest.xml Adds POST_NOTIFICATIONS permission + registers FCM messaging service.
RxCodeAndroid/app/build.gradle.kts Conditionally applies google-services/crashlytics; adds Firebase deps.
RxCode/Views/Sidebar/BriefingView.swift Logs analytics when briefing list opens (macOS).
RxCode/Views/Settings/MobileSettingsTab.swift Improves device icon + push badge to handle APNs vs FCM.
RxCode/Views/RunProfile/RunProfileDetailForm.swift Logs analytics when run profile editor opens (macOS).
RxCode/Views/Inspector/ThisThreadDiffView.swift Logs analytics when “This Thread” diff view opens.
RxCode/Views/Inspector/ChangesView.swift Logs analytics when inspector changes view opens.
RxCode/Services/MobileSyncService+LiveActivity.swift Makes APNs rejection logging nil-safe.
RxCode/Services/MobileSyncService+EventDispatch.swift Persists provider-aware push token fields; handles push_token inbound.
RxCode/Services/MobileSyncService.swift Adds provider-aware push fanout + FCM send path; extends paired-device model.
RxCode/App/RxCodeApp.swift Bootstraps Firebase at app init (macOS).
RxCode/App/FirebaseBootstrap.swift Adds Firebase init + installs analytics handler (macOS).
RxCode/App/AppState+Project.swift Logs analytics when a project is selected/opened (macOS).
RxCode.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved Adds Firebase iOS SDK pins.
RxCode.xcodeproj/project.pbxproj Adds Firebase SPM dependency/products to Xcode project.
relay-server/README.md Documents APNs + FCM forwarding and new env/flags.
relay-server/push.go Adds provider selection and FCM dispatch path for /push.
relay-server/main.go Loads FCM service account + wires FCM sender into handlers.
relay-server/k8s/README.md Documents FCM secrets/config for Kubernetes deployment.
relay-server/k8s/configmap.yaml Adds FCM_PROJECT_ID to non-secret config.
relay-server/health.go Extends /healthz to report APNs and FCM availability.
relay-server/go.mod Adds jwt dependency (now direct) for FCM auth.
relay-server/fcm.go Implements FCM HTTP v1 sender + service-account loading.
Packages/Tests/RxCodeSyncTests/PayloadTests.swift Adds unit test for push_token round-trip encoding/decoding.
Packages/Sources/RxCodeSync/Protocol/Payload.swift Adds push_token payload to shared Swift protocol.
Packages/Sources/RxCodeCore/Utilities/AnalyticsService.swift Introduces transport-agnostic analytics facade + event enum.
ci_scripts/ci_post_clone.sh Runs Firebase config materialization in Xcode Cloud post-clone.
.gitignore Ignores decoded Firebase config artifacts.
.github/workflows/test.yaml Writes Firebase config in CI before macOS/iOS/Android builds/tests.
.github/workflows/build.yaml Writes Firebase config before release build.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +24 to +27
fi
mkdir -p "$(dirname "$out_path")"
printf '%s' "$b64" | base64 --decode > "$out_path"
echo "[firebase] wrote $out_path ($(wc -c < "$out_path") bytes)"
Comment on lines +14 to +33
@Singleton
class FcmTokenReporter @Inject constructor(
private val store: PairingStore,
private val client: SyncClient,
) {
suspend fun report(token: String) {
if (token.isBlank()) return
val desktops = store.pairedDesktops.first()
if (desktops.isEmpty()) {
Log.w(TAG, "FCM token report skipped: no paired desktops")
return
}

for (desktop in desktops) {
desktop.relayUrl?.let { client.setRelayUrl(it) }
client.addPeer(desktop.pubkeyHex)
client.start()
withTimeoutOrNull(CONNECT_TIMEOUT_MS) {
client.connectionState.first { it == RelayClient.ConnectionState.CONNECTED }
}
Comment thread relay-server/push.go
Comment on lines +149 to +160
provider := strings.ToLower(strings.TrimSpace(req.Provider))
if provider == "" {
provider = pushProviderAPNs
}
if provider == pushProviderFCM {
if fcmSender == nil {
http.Error(w, "fcm disabled on this relay", http.StatusServiceUnavailable)
return
}
sendFCMResponse(w, fcmSender, &req)
return
}
@sirily11 sirily11 force-pushed the new-thread-android branch from b6af7c4 to b3dc333 Compare May 25, 2026 17:50
@sirily11 sirily11 enabled auto-merge (squash) May 25, 2026 17:51
@sirily11 sirily11 merged commit 59962fa into main May 25, 2026
11 checks passed
@sirily11 sirily11 deleted the new-thread-android branch May 25, 2026 18:03
@sirily11

Copy link
Copy Markdown
Contributor Author

🎉 This PR is included in version 1.12.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants