Move PrivateChatSheet hosting into ChatDialogs and unify sheet state (#586)

* Automated update of relay data - Sun Sep 21 06:21:05 UTC 2025

* Automated update of relay data - Sun Sep 28 06:20:40 UTC 2025

* refactor: new close button like ios(but not liquid glass)

* Automated update of relay data - Sun Oct  5 06:20:09 UTC 2025

* Automated update of relay data - Sun Oct 12 06:20:12 UTC 2025

* Automated update of relay data - Sun Oct 19 06:21:51 UTC 2025

* Automated update of relay data - Sun Oct 26 06:21:31 UTC 2025

* Automated update of relay data - Sun Nov  2 06:22:16 UTC 2025

* Automated update of relay data - Sun Nov  9 06:21:43 UTC 2025

* Automated update of relay data - Sun Nov 16 06:22:37 UTC 2025

* Automated update of relay data - Sun Nov 23 06:22:51 UTC 2025

* Automated update of relay data - Sun Nov 30 06:24:08 UTC 2025

* Automated update of relay data - Sun Dec  7 06:22:59 UTC 2025

* Automated update of relay data - Sun Dec 14 06:24:33 UTC 2025

* Automated update of relay data - Sun Dec 21 06:24:49 UTC 2025

* Automated update of relay data - Sun Dec 28 06:25:38 UTC 2025

* Automated update of relay data - Sun Jan  4 06:26:28 UTC 2026

* Automated update of relay data - Sun Jan 11 06:26:19 UTC 2026

* feat: Show private chat in sheet from notification

* Refactor: Hoist private chat sheet state to ChatViewModel

* remove icon

* remove old bottom sheet

---------

Co-authored-by: GitHub Action <action@github.com>
Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>
This commit is contained in:
yet300
2026-01-14 17:12:40 +07:00
committed by GitHub
co-authored by GitHub Action callebtc
parent 829fb52a04
commit 94b28b2107
6 changed files with 52 additions and 263 deletions
@@ -171,6 +171,7 @@ class ChatViewModel(
val peerDirect: StateFlow<Map<String, Boolean>> = state.peerDirect
val showAppInfo: StateFlow<Boolean> = state.showAppInfo
val showMeshPeerList: StateFlow<Boolean> = state.showMeshPeerList
val privateChatSheetPeer: StateFlow<String?> = state.privateChatSheetPeer
val showVerificationSheet: StateFlow<Boolean> = state.showVerificationSheet
val showSecurityVerificationSheet: StateFlow<Boolean> = state.showSecurityVerificationSheet
val selectedLocationChannel: StateFlow<com.bitchat.android.geohash.ChannelID?> = state.selectedLocationChannel
@@ -403,6 +404,8 @@ class ChatViewModel(
setCurrentPrivateChatPeer(null)
// Clear mesh mention notifications since user is now back in mesh chat
clearMeshMentionNotifications()
// Ensure sheet is hidden
hidePrivateChatSheet()
}
// MARK: - Open Latest Unread Private Chat
@@ -451,7 +454,7 @@ class ChatViewModel(
canonical ?: targetKey
}
startPrivateChat(openPeer)
showPrivateChatSheet(openPeer)
} catch (e: Exception) {
Log.w(TAG, "openLatestUnreadPrivateChat failed: ${e.message}")
}
@@ -796,6 +799,18 @@ class ChatViewModel(
fun hideMeshPeerList() {
state.setShowMeshPeerList(false)
if (state.getPrivateChatSheetPeerValue() != null) {
endPrivateChat()
}
hidePrivateChatSheet()
}
fun showPrivateChatSheet(peerID: String) {
state.setPrivateChatSheetPeer(peerID)
}
fun hidePrivateChatSheet() {
state.setPrivateChatSheetPeer(null)
}
fun getPeerFingerprintForDisplay(peerID: String): String? {
@@ -1006,7 +1021,7 @@ class ChatViewModel(
*/
fun startGeohashDM(pubkeyHex: String) {
geohashViewModel.startGeohashDM(pubkeyHex) { convKey ->
startPrivateChat(convKey)
showPrivateChatSheet(convKey)
}
}
@@ -1049,7 +1064,7 @@ class ChatViewModel(
true
}
// Exit private chat
state.getSelectedPrivateChatPeerValue() != null -> {
state.getSelectedPrivateChatPeerValue() != null || state.getPrivateChatSheetPeerValue() != null -> {
endPrivateChat()
true
}