ui: private chats on the Direct Messages page, not in the chat tabs
The server's chat strip shows the server chat and the channel chats. Private chats stay tabs of their session, so history, the composer and previews keep working, but the strip leaves them out (vm::chat::strip) and a private chat is current only while the Direct Messages page shows it; leaving the page goes back to the strip's last chat. The rail and the Chats tab count only the server's and channels' unread messages; private ones count on Direct Messages and, on the phone, on the Home tab. Closing a tab left of the selected one no longer selects the next chat. Voice connecting while a private chat is open keeps that conversation (it became the voice channel's chat, and the composer sent there). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AVRENKftQqGoEeswiR9TDQ
This commit is contained in:
1 parent
2e3ddc11ec
commit
48bc99a594
14 files changed
+414
-64
No files matched your search
@@ -13,11 +13,20 @@ pub(super) fn wire(ui: &MainWindow) {
|
||||
bridge.on_open_channel_chat(|cid| {
|
||||
with_app(|app| app.open_chat(ChatTarget::Channel(cid as ChannelId), true));
|
||||
});
|
||||
// A tab of the chat strip, which leaves out private chats.
|
||||
bridge.on_select_tab(|i| {
|
||||
with_app(|app| app.select_tab(i as usize));
|
||||
with_app(|app| {
|
||||
if let Some(index) = app.strip_tab(i) {
|
||||
app.select_tab(index);
|
||||
}
|
||||
});
|
||||
});
|
||||
bridge.on_close_tab(|i| {
|
||||
with_app(|app| app.close_tab(i as usize));
|
||||
with_app(|app| {
|
||||
if let Some(index) = app.strip_tab(i) {
|
||||
app.close_tab(index);
|
||||
}
|
||||
});
|
||||
});
|
||||
bridge.on_send_message(|text| {
|
||||
with_app(|app| app.send_message(text.to_string()));
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
use slint::ComponentHandle;
|
||||
|
||||
use crate::app::{Bridge, MainWindow, with_app};
|
||||
use crate::app::{App, Bridge, MainWindow, with_app};
|
||||
|
||||
pub(super) fn wire(ui: &MainWindow) {
|
||||
let bridge = ui.global::<Bridge>();
|
||||
@@ -111,9 +111,16 @@ pub(super) fn wire(ui: &MainWindow) {
|
||||
with_app(|app| app.open_preview(key, index)).unwrap_or_default()
|
||||
});
|
||||
|
||||
// Opening the messages or the Library loads what they list.
|
||||
// Opening the messages or the Library loads what they list; the open
|
||||
// private chat is the current chat while the messages page shows it.
|
||||
bridge.on_open_messages(|| {
|
||||
with_app(|app| app.load_recent_chats());
|
||||
with_app(|app| {
|
||||
app.messages_shown();
|
||||
app.load_recent_chats();
|
||||
});
|
||||
});
|
||||
bridge.on_close_messages(|| {
|
||||
with_app(App::close_messages);
|
||||
});
|
||||
bridge.on_open_library(|| {
|
||||
with_app(|app| app.load_library());
|
||||
|
||||
Reference in new issue
Block a user