The screens were built before the mockups were at hand and guessed at their layout: a strip of voice controls over the chat, pins and topics floating over the messages, the voice channel as a grid of tiles and a members panel of our channel only. The mockups put them elsewhere. - The members panel lists everyone on the server, "Members — N" with a search: those streaming (or, in the voice channel and while watching, the people in our channel) first, then each server group in the server's order, people elsewhere with the channel they are in, and moderator groups as a role next to the name. - Pinned messages and topics take the members panel's place, as cards; topics can be searched and show when they were last active, and the chat header opens them with labelled buttons. - The voice channel view is a header with Voice Settings and Leave, the people as large avatars with talking and muted marks, the streams as large cards (with the picture while we watch) and the channel's chat. - The chat drops the extra voice strip (the sidebar has the controls); messages are larger, times read "Today at 10:14", reactions end with an add button, and the composer has a round attach button. - Hold-to-talk shows only with push-to-talk. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
68 lines
1.8 KiB
Rust
68 lines
1.8 KiB
Rust
//! The chat view: tabs, messages, reactions, pins, topics and files.
|
|
|
|
use slint::ComponentHandle;
|
|
use voelin_model::{ChannelId, ChatTarget};
|
|
|
|
use crate::app::{App, Bridge, MainWindow, with_app};
|
|
|
|
pub(super) fn wire(ui: &MainWindow) {
|
|
let bridge = ui.global::<Bridge>();
|
|
bridge.on_search_topics(|text| {
|
|
with_app(|app| app.search_topics(text.to_string()));
|
|
});
|
|
bridge.on_open_channel_chat(|cid| {
|
|
with_app(|app| app.open_chat(ChatTarget::Channel(cid as ChannelId), true));
|
|
});
|
|
bridge.on_select_tab(|i| {
|
|
with_app(|app| app.select_tab(i as usize));
|
|
});
|
|
bridge.on_close_tab(|i| {
|
|
with_app(|app| app.close_tab(i as usize));
|
|
});
|
|
bridge.on_send_message(|text| {
|
|
with_app(|app| app.send_message(text.to_string()));
|
|
});
|
|
bridge.on_load_older(|| {
|
|
with_app(App::load_older);
|
|
});
|
|
bridge.on_react(|key, emoji| {
|
|
with_app(|app| app.react(key, emoji.to_string()));
|
|
});
|
|
bridge.on_pin(|key, on| {
|
|
with_app(|app| app.pin(key, on));
|
|
});
|
|
bridge.on_download_file(|key, index| {
|
|
with_app(|app| app.download_file(key, index));
|
|
});
|
|
bridge.on_attach_file(|| {
|
|
with_app(App::attach_file);
|
|
});
|
|
bridge.on_open_pins(|| {
|
|
with_app(App::open_pins);
|
|
});
|
|
bridge.on_jump_to_pin(|key| {
|
|
with_app(|app| app.jump_to_pin(key));
|
|
});
|
|
bridge.on_open_topics(|| {
|
|
with_app(App::open_topics);
|
|
});
|
|
bridge.on_open_topic(|id| {
|
|
with_app(|app| app.open_topic(id));
|
|
});
|
|
bridge.on_send_topic_message(|text| {
|
|
with_app(|app| app.send_topic_message(text.to_string()));
|
|
});
|
|
bridge.on_create_topic(|key, title| {
|
|
with_app(|app| app.create_topic(key, title.to_string()));
|
|
});
|
|
bridge.on_open_member(|id| {
|
|
with_app(|app| app.open_member(id));
|
|
});
|
|
bridge.on_member_action(|action| {
|
|
with_app(|app| app.member_action(&action));
|
|
});
|
|
bridge.on_member_volume(|percent| {
|
|
with_app(|app| app.member_volume(percent));
|
|
});
|
|
}
|