Commit graph

68 commits

Author SHA1 Message Date
bunnie
83e26ff4c7 update num-derive dependency
this became mandatory in 1.83 to remove warnings. I think it
should have no impact on functionality.
2024-12-02 18:52:59 +08:00
bunnie
043dfd84ae update formatting to latest nightly rules 2024-09-24 01:49:45 +08:00
bunnie
f494da21cc absorb new xous-ipc version 2024-09-23 22:05:50 +08:00
bunnie
c699e06c5a port rkyv ser/de usage in mtxchat 2024-09-23 17:00:16 +08:00
bunnie
75954de8d6 commit the version bump 2024-09-23 01:46:25 +08:00
bunnie
4c7c9312c1 change xous-ipc api to 0.10.0 2024-09-23 00:24:48 +08:00
bunnie
34e6f46d63 formatting changes that resulted from the regex search
a bunch of lines are shorter or different length now which
triggers a mandatory reformat. this patch cleans that up,
so that going forward the manual rework patches are clearer and
not tied up with formatting patches.
2024-09-22 15:31:14 +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
311154e231 absorb version bump 2024-06-27 00:26:12 +08:00
bunnie
a360f3ee52 bump xous pins for RawTrng API 2024-06-13 15:49:35 +08:00
bunnie
35e7cf3a5b bump xous dep revs 2024-05-29 02:07:06 +08:00
bunnie
9e66c1bee2 commit the version bump 2024-05-07 01:03:05 +08:00
bunnie
d6b33159a5 stage version pin bump 2024-04-01 15:46:26 +08:00
bunnie
699004e7b0 bump xous pins 2024-02-06 14:49:10 +08:00
bunnie
0267a56989 format Cargo.tomls
because apparently cargo fmt doesn't format Cargo.toml files???
2024-01-15 00:14:39 +08:00
bunnie
660c3b06f9 format libs/chat 2024-01-14 19:12:20 +08:00
bunnie
fda782663a bump version pins for xous change 2023-12-26 00:13:10 +08:00
bunnie
efb087c01a
Merge pull request #455 from betrusted-io/mtxchat-layout-tests
WIP: Mtxchat layout refactor
2023-12-02 16:13:04 +08:00
bunnie
fa3f349a0a bump pins as xous-rs has changed 2023-12-01 21:20:01 +08:00
bunnie
f88afd1a1a fix various edge cases; move status bar redraw to end of routine
putting the status bar redraw at the end means that even if
the fitting of the boxes isn't 100% correct, the status bar still
ends up "on top".
2023-12-01 17:55:39 +08:00
bunnie
0da86640b1 cleanup debug statement 2023-12-01 17:55:26 +08:00
bunnie
e4fba76ed2 add some debugging infos
the scroll-down freeze is actually because of the nature of
the test program hijacking the main loop. the test program
probably needs to be redesigned so it takes in events so we
don't eventually end up in deadlock
2023-12-01 03:17:00 +08:00
bunnie
157f0031e6 refactor layout to take advantage of pre-computed height bubbles
mostly works, so checkpointing it here. need to debug why going down
after going up (in terms of selection) is not working.
2023-12-01 02:23:47 +08:00
bunnie
7222fb0de9 add an optional bounding rectangle field to posts
this is computed when the post is added to the list of posts.

Also split out the visual properties of a UI into a separate
struct so that we can pass it as a single argument to routines
that could handle layout-related tasks.
2023-11-30 23:05:41 +08:00
bunnie
4a5bedd6ab Merge branch 'main' of github.com:betrusted-io/xous-core into mtxchat-layout-tests 2023-11-30 14:22:15 +08:00
nworbnhoj
ffa3d56af4 fix ChatOp::PostAdd to default correctly to dialogue_key set by ChatOp::DialogueSet 2023-11-30 07:24:58 +11:00
bunnie
dcd8076306 pull in the comments and notes from #445 so it's in the code 2023-11-28 17:53:12 +08:00
bunnie
c2becc089b implement default behavior when no dialog is specified.
- the `post_add()` API on the 'lib' side of things says Add a new Post
  to the current `Dialogue`, and it passes an empty `dialogue_id` string.
- the `post_add()` handler on the server dutifully unpacks the `dialog_id`
  field with `post.dialogue_id.as_str().unwrap()`, and then passes on to
  the `post_add()` call inside the UI object
- the `post_add()` implementation in the UI object then checks the
  `dialog_id` with if `pddb_key.eq(&dialogue_id)`, expecting that the key
  should match the dialog id. But through this path, the dialogue ID
  is always the empty string, so the function can't work.

This patch causes the code to "fall through" and use the default
`pddb_key` if the length of the `dialog_id` is zero. Not sure if
this is the intended behavior, but in the test case at least I get
posts appearing now once this patch is in.
2023-11-28 17:24:56 +08:00
bunnie
d4624124c9
Merge pull request #443 from betrusted-io/chat-status
WIP: Chat status
2023-11-03 13:54:34 +08:00
bunnie
6ab88117f6 bump xous-api-log version & fix version pins 2023-10-31 20:07:28 +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
4423339059 move wifi delay hook to the correct area
- remove modal pop-up for wifi connection, and replace with
busy animation
- specify units of delay in the constants (_MS to indicate milliseconds;
this is a convention I'm trying to adhere to)
- partial progress on debugging why the animation isn't running
(value of animation variable is not being passed back at the GAM layer).

Also a general note on coding styles that probably is going to cause
confusion now that more people are contributing to the code base.

Generally, when a lot of "generic" library functions fail, we've been
passing an error message up the stack. However, these functions are
actually meant to be infalliable, and when you kick the error up the
stack you just end up with a panic at an unhelpful location (because
you finally catch the error only at the main loop or something and
by that point there's nothing you can really do about it but panic,
since it's supposed to be an infalliable operation).

As a result I have been trying to tamp down on needless error propagations
and having them fail with a unwrap or expect at the point where the
abstraction should be infalliable. This helps in debugging the actual
failure root cause because you're closer to the line of code that
actually broke, instead of just some line at a generic error handler.

Of course if you build with stack unwinding the top-level unwraps are more
useful because you can peer down into the call chain, but even then,
with the limited screen real estate I think deeply nested failures
would probably overflow any panic display. So even with panic unwinding
I think we stil want to keep the root cause within a few stack frames,
instead of errors being passed up sixteen levels of abstraction before
finally dying.

This only applies to things that are meant to be truly infalliable,
like syscalls that should not fail, or like unpacking a buffer or
memory message that has already been allocated. In this case the errors
are more like asserts, and are helpful if they fail at the line where
they break instead of being passed up the call stack (which was the
original architecture).

Probably I should add a note about this to the Xous Book.
2023-10-29 16:33:03 +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
d844c4306c reduce size of chat status bar to match status bars above 2023-10-28 22:50:23 +08:00
bunnie
be39c44b17 add a stand-in initial startup message
This prompts users on how to raise the menu. Not sure if it's
the right thing, but it's something.
2023-10-20 00:48:10 +08:00
bunnie
b456bfaf3b add busy-wait animation server and hooks for managing the same
Busy-wait animaitions are handled by a helper server that is normally
blocked. A single shared `bool` indicates whether the animation should
run or not.

When woken up, the busy-wait animator will check if the shared `bool`
is set, and if so, send a message to the main loop to update
the animation, then send wait an appropriate timeout and send itself
a message to re-check the animation status.

This particular format of server is fairly compact but can be vulnerable
to a "message storm" if busy state updates happen in rapid
succession without allowing the server to unblock and handle messages.
Thus, all messages to this server use a `try_send` method, with a silent
failure if the message can't be sent. In other words, if the animator
is already super busy and its queue is full, don't send it more messages,
just drop the existing updates so we can fail without a panic or deadlock.
The typical consequence of this is some UX inconsistency, which is
not a critical error.
2023-10-20 00:43:09 +08:00
bunnie
355425726d add data structures to track status bar state
- status bar gets some initial text on boot
- previous status message is saved when entering a busy state,
and restored on exit
- add routines for hopefully making the redraw a bit more efficient
if the only thing happening is a busy-wait update.
2023-10-20 00:41:19 +08:00
bunnie
8401d924e0 add opcodes for updating status bar and running busy animations 2023-10-20 00:40:26 +08:00
bunnie
d63b5912b1 absorb new xous-rs version 2023-10-10 16:50:00 +08:00
bunnie
83256257e1 bump xous-rs crate to absorb Send derives on Messages
this is necessary for the smoltcp port
2023-10-03 20:54:14 +08:00
bunnie
08827633ac bring Chat dependencies up to date 2023-09-19 19:41:56 +08:00
bunnie
c5d81ef08b
initialize menu before mounting PDDB
This is necessary because mounting the PDDB is a "secure" operation, and secure ops will fail until all UX contexts are occupied.

This problem does not manifest in hosted mode because we cheat and automount the PDDB in hosted mode.
2023-09-19 19:08:36 +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
c50cc73610 mtxchat add navigation help on first login
chat add help navigation modal
2023-09-09 10:24:52 +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