therustypickle / chirp Goto Github PK
View Code? Open in Web Editor NEWA creative playground for diving into the world of GTK4-rs, building a chat application from scratch
License: MIT License
A creative playground for diving into the world of GTK4-rs, building a chat application from scratch
License: MIT License
Rough TODO to allow deleting message
message_row.xml
with a menu that would open on right-click with an option to Delete Message.Instead of storing everything on the memory, use a DB that should store
Goals:
Upon receiving a message ListStore is iterated for every single message which is highly inefficient. The same for finding the deletion target. This must be improved to prevent the UI from lagging when syncing a large amount of data.
For every New Chat that is added, the gschema should store the relevant user ID and use that when the GUI starts to re-add the users available for chatting
In case of not being able to connect to the WS, it should continue to try to connect to it. Maintain a queue system in FIFO order. As soon as the WS is connected, it will start sending them, if there is anything to send. Channel could be a solution here. All WS function calls should be handled by a single function to unite them
The server side already stores all message data. On connect/reconnect the server should send all relevant message data to the GUI so it can process and show them in the interface.
Currently, any deletion attempt will loop the entire liststore, even if it doesn't exist. This should be verified before any deletion attempt is done
It spams connect to ws every 10 seconds if the connection fails. The timer should keep increasing after each failed attempt.
The UI can still use some improvement such as
Any contribution toward improving the UI is welcome!
setup_callbacks
function to call grab_focus
on new user selectRough modifications needed for the issue:
bind
and edit_name
functions on user_prompts.rs
to ensure names with over 250 chars don't get acceptedbind
function should be separated for name and image editing for easier handling similar to bind_int
for numbersCurrently following APIs are used
Would be nice to have more sources of random images. The following needs to be updated
utils.rs
generate_random_avatar_link
should be updated with an option to call the new function.Use the SVG file in the project directory and make it usable as the app icon
Due to the usage of MessageDialog, the UI is restricted to simple actions. MessageDialog doesn't allow further verification after the input is given when adding a new chat and editing the image link. Converting it to AdwWindow will allow verifying everything before any prompt is accepted.
The converted UI should
Manually scrolling the ScrolledWindow sets the screen as blank. This needs to be fixed
It should be possible to set an empty link on the profile section which would use the AdwAvatar fallback. Adding another button on the image link row to delete this should be good enough
user_profile.xml
image link row with a new button. Perhaps the icon user-trash
can be used on the buttonThe UI currently doesn't show any time/date of when a message was created. It should be updated to show a timestamp
message_row.xml
UI to show the timer. As a label perhaps? This should be done carefully with a smaller text sizeMessageObject
already stores the timestamp. Only the UI needs to be connected to the variable.Currently the users on userlist has 2 statuses. Selected or non-selected. Selected users has a blue CSS while non-selected has gray CSS. For non-selected users, if any message is received, it should show a separate style
handle_ws_message
function needs to be updated to properly add the new CSS on message receiveIt would be nice to have an indication on the profile section to see if it's connected to the server properly
user_profile.xml
and add a relevant button or image or something to communicate the statusWSObject
After reconnecting for send message instead of /message, /new-user-message is getting used. Ideally, it should be using /message by identifying existing active connections and passing it to the proper WS session.
The plan is to eventually deploy it in Shuttle so the Gui can connect directly to communicate.
When a new user is created but the server connection is not available and messages are sent in the queue, the message sending fails after the connection is established as it tries to send to User 0 which should not happen.
In the current state, ListBox starts lagging with only 5k messages. Migrate from ListBox to ListView as ListView is designed to be more scalable than ListBox.
Each userobject currently uses RefCell to keep track of the queue. In certain cases, it can cause double borrow_mut and crash it. It should be updated to ensure this doesn't happen. Perhaps make use of mutex?
Currently after updating the profile it only reflects the UI. It should be broadcast to the WS where the updated info will be sent to all active sessions where the user_id (user_id of the user who's info was updated) was added.
The smiley button on textview currently does nothing but it's supposed to popup emoji selector
This can be used https://docs.gtk.org/gtk4/class.EmojiChooser.html
When the server is offline but messages are sent, it should show an indicator perhaps a spinner(?) to highlight that it has not been sent yet. Rough TODO
message_row.xml
with the indicatorMessageObject
with a var to save whether it was sent or not and bind that with the new indicator UIMessageObject
. Update the object's sent variableWith the current communication style, anyone can pretend to be someone else if they have the user ID. Generate a unique token that should be passed with every request to identify if it's the correct user.
Prerequisite: #31 should be implemented first.
As of now, only new chat/users can be added using the New Chat button but cannot be removed. Would be nice to be able to delete users. The functionality can be added on a mouse right click
user_row.xml
Currently on each restart it creates a new profile with a new user id. This should persist among launches and be able to reconnect to the WS using the previously saved User ID. gio::Settings schema can be used to save it.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.