send-receive-message #36
No reviewers
Labels
No labels
bug
core
documentation
duplicate
enhancement
experiment
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
streigen/echelon!36
Loading…
Reference in a new issue
No description provided.
Delete branch "send-receive-message"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
yes yes i know this PR is freaking huge.
Changes made by this PR:
SpaceNodes.BTreeMap(edited)tag for messages that have been edited)ScrollViewtoListViewfor the messages view asListViewprovided better control for me for paginationwith_active_client()call since it would cause lifetime issues with async closures.This PR is massive. There was a lot of scope creep. I did not realize just how much I would need to rework for spaces to actually make this functional.
As a result of all the ongoing changes. The
lib.rshas grown massively. I think the next thing to do would need to be decouple all the UI glue fromlib.rsand split it into its own module.Good luck in reviewing this, I do not envy you.
Thank you for torturing me. Do not fix the issues, everything else should be relatively simple to fix.
@ -33,10 +34,13 @@ futures-core = "0.3.31"blake3 = "1.8.3"url = "2"open = "5"chrono = { version = "0.4", default-features = false, features = ["std", "clock"] }I would advise against using chrono, we can use jiff, see more here:
https://github.com/chronotope/chrono/issues/1768
oops i forgot i wasnt supposed to fix ones with issues. resolved
@ -71,1 +75,4 @@[profile.release]debug = trueremove 77 and 78
@ -0,0 +82,4 @@let bytes = client.media().get_media_content(&request, true)We have discussed this already, but just wanted to document it here, opened an issue about it too:
#37
as there is already an issue for it. ill mark this as resolved
@ -0,0 +110,4 @@format!("Attachment is {bytes} bytes, over the {limit} byte limit")}/// Download an attachment's original bytes, undecoded. Used for saving to disk, where the fileundecoded? 😭
You can just say download an attachment's raw bytes.
undecoded -> coded. yesyes.
fr tho ima just rename it to RAW instead
@ -0,0 +368,4 @@"audio/opus" => "opus","audio/wav" | "audio/x-wav" => "wav","audio/flac" | "audio/x-flac" => "flac","audio/mp4" | "audio/aac" => "m4a",Why are we converting mp4 or aac to m4a again? It would make sense to just have:
@ -103,2 +66,2 @@Ok(root_map)}let mut hierarchy = Vec::new();let mut visited = HashSet::new();Also, small bug where if a room is nested inside two root spaces, it will only appear inside the space that is processed first, it gets skipped in the other space since it's already inside visited.
@ -133,3 +69,1 @@};if !room.is_space() {return Err("Given space ID does not correspond to a space room".to_string());for root_id in roots {See #38, will implement in next PR when I do QOL
marking as resolved for now since this has an issue dedicated to it
@ -45,0 +275,4 @@const MESSAGE_PAGE: u32 = 50;/// Maximum number of message rows held in the UI model.const MAX_MESSAGE_ROWS: usize = MESSAGE_PAGE as usize * 20;maybe make this 2...
😍
how about.... 10?
set to 10 for now since max previews caps image previews to 24. the rest of the rows arent that expensive memory wise
@ -45,0 +285,4 @@return;}let mut dropped = Vec::with_capacity(overflow);Make this a hashset, for better efficiency.
your wish is my command sire
@ -0,0 +43,4 @@/// A media attachment, carrying just enough to fetch and render it later./// One shape covers every kind, so a new kind needs no new field here.#[derive(Debug, Clone)]pub struct Attachment {Comments for this struct are a bit too descriptive, shorten them down a little, some of the information is useful, but we would benefit from not having comments be too large.
yessir fixed
@ -0,0 +90,4 @@/// Pick the source that answers a request at `size`.////// The one definition of which of an attachment's two sources is used and/// what it weighs. Both the fetch that pulls the bytes down and the check???
Like this...?
Make the comments a bit clearer, and shorter, thanks!
exactly this. i did wanna start hitting the gym soon.
what better way to start than by using my chat attachments as weights? i mean, surely thousands of attachments will surely be enough to function as weights right?
@ -0,0 +260,4 @@/// redaction is, and each applies the answer to the message model itself/// rather than to a copy of it.#[derive(Debug, Clone)]pub enum EventEffect {Found a bug here, for SOME REASON, on some clients if you edit a media payload (WHY CAN YOU DO THIS????), it needs to be redacted and have the new media replace it. For example fluffychat lets you replace it with text, instead of more media, but Matrix does technically allow you to replace media with other media.
...why
welp fixed
@ -161,2 +215,4 @@}}#[cfg(test)]Remove the tests from here
@ -3,18 +3,137 @@// eliminating deep two-way binding chains that cause// "long callback/instantiation chain" warnings.// Mirrors `rooms::messages::AttachmentKind`, converted in lib.rs, plusnot again, pleaaaseeee reduce your UI comments, they are SO LONG.
hehe suffer
@ -8,12 +8,175 @@ import { MessageRow } from "./message-row.slint";export component ChatMain inherits Rectangle {background: #000000;// How close to the bottom (in px, roughly 5 message rows) counts as "stillMY EYES, PLEASE REDUCE THE COMMENTS ;-; .
@ -67,3 +96,3 @@}Text { text: msg.text; color: rgba(255, 255, 255, 0.85); font-size: 15px; wrap: word-wrap; }// The body and the "(edited)" marker sit in one row so the marker trailsPlease reduce comment size length, my eyes, they burn.
One more thing I forgot to mention @flaxeneel2, bump up the version number too, we can discuss what we want to bump it to as well if needed.
@rayyan wrote in #36 (comment):
Yep. bumped to
0.1.1(was0.1.0).I have gone through all the suggested changes and have made them. Pls lmk if anything else still needs changing.
Alright looks good, merge after all checks pass.
@rayyan wrote in #36 (comment):
nvm tenor gifs dont work. sad. <insert happy cat here>