Commit graph

210 commits

Author SHA1 Message Date
bunnie
59c6d6ae77 format libs/xous-pl230 2024-01-14 19:24:12 +08:00
bunnie
ee2c7ef140 format xous-pio 2024-01-14 19:22:37 +08:00
bunnie
f00293a3a8 suppress formatting on in-line assembly in xous-pio 2024-01-14 19:22:18 +08:00
bunnie
508476a085 libs/userprefs 2024-01-14 19:14:08 +08:00
bunnie
c43fd370ee format libs/tls 2024-01-14 19:13:54 +08:00
bunnie
84590c58fc format libs/cos_table 2024-01-14 19:12:38 +08:00
bunnie
660c3b06f9 format libs/chat 2024-01-14 19:12:20 +08:00
bunnie
f196bcf469
Merge pull request #465 from nworbnhoj/sigchat
Link sigchat to existing Signal account
2024-01-08 17:23:09 +08:00
bunnie
8ec08c9c76 fix rust v1.75.0 warnings that are probably benign
a lot of re-import warnings have cropped up. While I appreciate
their studiousness on this, the problem is that removing some
of these exports in the API crate could mean that future users
who want access to some API features that aren't used in this
configuration are now unaccessible.

I think it's not a huge problem at the moment, just spam-cleaning
the warnings because there are too many to deal with carefully
at the moment.
2024-01-04 19:15:28 +08:00
nworbnhoj
05c991e3a2 Merge branch 'main' into sigchat 2023-12-26 08:14:42 +11:00
bunnie
fda782663a bump version pins for xous change 2023-12-26 00:13:10 +08:00
nworbnhoj
854b2198c4 tls doc & tidy-up 2023-12-24 06:03:26 +11:00
nworbnhoj
5703707cca implement Tls.accessible() 2023-12-22 14:25:51 +11:00
nworbnhoj
7d72387cb9 simplify TLS.probe() modals 2023-12-22 14:24:08 +11:00
nworbnhoj
0ca24db2f0 implement Tls.is_trusted_cert() & Tls.is_trusted_x509() 2023-12-22 14:23:04 +11:00
nworbnhoj
6e1947d3b0 rename Tls.*_cert() to Tls.*_rota()
actually this is a correction of the names of these fn
these fn are actually handling trust_anchors rather than certificates
and in some cases we will need equivalent fn for certificates
2023-12-21 16:33:47 +11:00
nworbnhoj
12c74e724f implement Tls.inspect(host)
Tls.probe() now returns a Vec<Certificate> and Tls.inspect(host) presents the trust_modal to the user
2023-12-21 07:48:09 +11:00
nworbnhoj
de1dcffd66 rename shellchat net tls inspect
rename shellchat `net tls probe` to `net tls inspect`
2023-12-20 18:44:52 +11:00
nworbnhoj
2684a55888 Merge branch 'main' into sigchat 2023-12-20 05:26:19 +11:00
nworbnhoj
d22317018b rename Tls.trust_modal() 2023-12-19 06:03:23 +11:00
nworbnhoj
de6b6baab9 extend shellchat net ws to utilize /lib/tls 2023-12-19 05:09:11 +11:00
nworbnhoj
bcb6a8c3bf implement tls.stream_owned() 2023-12-18 17:16:33 +11:00
nworbnhoj
90daccea46 merge main into sigchat 2023-12-05 13:19:49 +11: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
c5dff9d35d Merge branch 'main' of github.com:betrusted-io/xous-core into mtxchat-layout-tests 2023-11-30 18:19:20 +08:00
nworbnhoj
e8e875742e replace more TcpStream::connect(&str) with TcpStream::connect((&str, u16))
resolves #453
2023-11-30 20:29:15 +11:00
nworbnhoj
0fc9a07f5e replace TcpStream::connect(&str) with TcpStream::connect((&str, u16))
resolves #453
2023-11-30 19:41:42 +11: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
nworbnhoj
7e485885b7 introduce tls probe help modals
- invalid certificate modal
- unknown issuer modal
- not valid yet modal
2023-11-29 16:42:21 +11:00
nworbnhoj
492d089d5c fix typos 2023-11-29 12:06:02 +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