Commit graph

24 commits

Author SHA1 Message Date
bunnie
c699e06c5a port rkyv ser/de usage in mtxchat 2024-09-23 17:00:16 +08:00
bunnie
52ffd88b40 regex search/replace instances of xous_ipc::String to String
split into multiple commits for easier committing
2024-09-22 14:17:03 +08:00
bunnie
660c3b06f9 format libs/chat 2024-01-14 19:12:20 +08:00
bunnie
5aefcac8ec add forced redraw function, fix misdirected message
- rapid redraws are normally aborted by this routine. offer a forced
redraw in the case that a "final state" has to be rendered without
fail.

- fix a misdirected message (sending it to app instead of to ui by
accident)
2023-10-29 23:03:46 +08:00
bunnie
d4a934785b re-introduce a default text to display when going out of busy state
this simplifies the problem of tracking concurrency if multiple threads
are requesting a busy-state to be presented. In this case, when the
final thread leaves its busy state, the idle-state will be shown.
2023-10-29 20:07:22 +08:00
bunnie
4e027b676c remove logic from status primitive and make the interface simpler
- status bar text is just status bar text now
- idle animation runs/stops based on an explicit run/stop message

Note that at the moment if one starts the busy bar and a modal pops
up, you might overflow the queue of the ui drawing thread with animation
requests, because the thread blocks when the modal is summoned.

Modals "take the screen" anyways, so maybe the solution to this is
to add an additional interlock around any modal calls within the UI
main thread. Need to think about it a bit more.
2023-10-29 01:08:38 +08:00
bunnie
8401d924e0 add opcodes for updating status bar and running busy animations 2023-10-20 00:40:26 +08:00
nworbnhoj
7803efec7f pass room_alias aka dialogue_id aka dialogue.pddb_key to mtxchat.listen()
this ensures that new Matrix Events received from the server are added to the correct chat::Dialogue
2023-09-18 18:49:59 +10:00
nworbnhoj
61743a9c76 mtxchat tidy-up 2023-09-14 05:30:33 +10:00
nworbnhoj
a46dad11d2 mtxchat tidy-up 2023-09-09 10:36:37 +10:00
nworbnhoj
3542103510 mtxchat tidy-up 2023-09-08 13:46:52 +10:00
nworbnhoj
ff68567140 chat UI rawkeys toggle menu_mode & raise app/msg menus 2023-09-07 11:38:21 +10:00
nworbnhoj
c7c0041922 Chat readme & comments 2023-09-01 05:41:40 +10:00
nworbnhoj
2f157d5957 implement ChatOp::Dialogue::Save 2023-08-30 04:46:44 +10:00
nworbnhoj
7b7a7003f1 implement chat Dialogue navigation with up/down keys 2023-08-28 09:58:57 +10:00
nworbnhoj
77f25bc416 implement chat icontray 2023-08-23 09:04:42 +10:00
nworbnhoj
197ed63058 chat tidy-up 2023-08-22 16:59:26 +10:00
nworbnhoj
4f03a27e79 implement chat app_menu 2023-08-15 04:27:15 +10:00
nworbnhoj
ca211e170a implement mtxchat.connect() 2023-08-11 05:24:50 +10:00
nworbnhoj
62a3bae502 extend chat::Dialogue to accept Option<pddb_key>
extend ui.dialogue_set() to select existing Dialogue when operating offline
2023-08-10 20:22:15 +10:00
nworbnhoj
9db7a3c2c5 refactor chat timestamp to u64 2023-08-04 09:17:43 +10:00
nworbnhoj
34334cb80a rename ChatOp::Rawkeys 2023-07-27 04:39:30 +10:00
nworbnhoj
9451ea90d0 implement chat::dialogue_save() & chat::dialogue_read() 2023-07-24 06:36:12 +10:00
nworbnhoj
aab92c2b37 sketch chat UI library
A Chat object provides a generic UI to read a series of Posts in a Dialogue stored in the pddb - and to Author a new Post.

The idea is to provide a solid common Xous Chat interface, so that Chat Apps can specialize in the unique aspects of a chat Platform protocol (Matrix, Signal etc).

A Chat App will typically call `Chat::new()` and then `Chat::dialogue_set()` with a pddb dict and key holding a Dialogue of Posts. The Chat object will fire-up the UI and retrieve the Dialogue from the pddb. The user will be able to peruse the stored Posts in the Dialogue - and potentially Author a new Post. A new User Post will be sent to the Chat App in a `MemoryMessage` via the (optional) `CID` and `Opcode` provided by the Chat App. Conversely, when the Chat App receives a new Post from the Platform, it will call Chat::post_add() to have it saved in the pddb.

The Chat UI will also accept (optional) opcodes to forward raw-keystrokes and UI-Events to the Chat App. This allows the Chat App to respond to key UI Events. For example if the User navigates to the `top` of the list of stored Posts, then the Chat App might retrieve older Posts from the Platform to be stored Dialogue with calls to Chat::post_add().
2023-07-12 17:23:41 +10:00