Another massive refactor to change the way routing works. Now any
column can route anywhere.
Also things are generally just much better and more modular via the
new struct split borrowing technique.
I didn't even try to split this into smaller commits for my sanity.
Signed-off-by: William Casarin <jb55@jb55.com>
- allows use of more interesting args w/o risk of checking them in by mistake
- allows use of different args w/o rebuilding the app
- uses compiled in defaults if config file missing or broken
Example android-config.json:
```
{
"args": [
"--npub",
"npub1h50pnxqw9jg7dhr906fvy4mze2yzawf895jhnc3p7qmljdugm6gsrurqev",
"-c",
"contacts",
"-c",
"notifications"
]
}
```
Install/update android-config.json with:
```
adb push android-config.json /sdcard/Android/data/com.damus.app/files/android-config.json
```
Using internal storage would be better but it seems hard to get the config file onto
the device ...
This is a huge improvement over what it was before. Now all unknown id
lookups are debounced and happen through a central coordinator. This
ensures there is no duplication between timelines.
Fixes: https://github.com/damus-io/notedeck/issues/279
Signed-off-by: William Casarin <jb55@jb55.com>
This is a really dumb and broken version of threads, but it will be our
foundation for future changes.
All it currently does is load whatever notes we have locally for a
thread in chronological order. It currently does not open any
subscriptions. It is not clear what is replying to what, but hey, its a
start.
Signed-off-by: William Casarin <jb55@jb55.com>
From PR description:
See the test_basic() test in linux_key_storage.rs. I ran it successfully
on my MacOS machine and a linux VM. The BasicFileStorage impl just
stores each Keypair as a SerializableKeypair json object with the file
name as the public key hex in ~/.notedeck_credentials. The
SerializableKeypair uses the nip49 EncryptedSecretKey, but we just use
an empty string as the password for now.
The BasicFileStorage impl works in MacOS, but it only conditionally
compiles to linux for simplicity.
pub enum KeyStorageResponse<R> {
Waiting,
ReceivedResult(Result<R, KeyStorageError>),
}
This is used as a response so that it's possible for the storage impl to
be async, since secret_service is async. It seems that secret_service
would allow for a more robust linux key storage impl so I went ahead and
made the API compatible with an async impl.
* kernelkind (1):
impl linux credential storage
This is exactly the same as the DisplayName enum in Damus iOS. Due to
the various inconsistencies in `name` and `display_name` between
clients, we have to generalize DisplayName into two variants: one name
or two names.
If we have two names, we treat it in the standard way of display_name is
the real name, and `name` is the username.
If only one is set, then it is considered both the username and "real name".
Signed-off-by: William Casarin <jb55@jb55.com>
In this commit we refactor the preview mechanism, and switch to
responsive views by default.
To create a preview, your view now has to implement the Preview trait.
This is very similar to SwiftUI's preview mechanism.
Signed-off-by: William Casarin <jb55@jb55.com>
Adds ability to run UI components isolated from main app.
`cargo run --bin ui_test_harness -- AccountLoginView`
Signed-off-by: kernelkind <kernelkind@gmail.com>
egui widgets are nice because there are many helper methods on the
egui::Ui struct for adding widgets to the screen in various ways. For
example, add_sized which designates an area to paint a widget. This is
useful in the note_contents case, as it allows us to reserve
available_space-20.0 pixels of the available area, saving 20.0 pixels
for a side-actionbar popout.
I'm not sure I'll use the side actionbar yet, but I've been
experimenting with that as an option to save vertical space in the
timeline.
I still need to make the side actionbar into a widget as well. It
currently uses the CollapsingHeader widget, which is designed for
expanding elements vertically. We may need to make our own widget for
animating an horizontal expansion if we want to achieve a similar effect
for the side actionbar.
Some things we definitely don't want to generate every frame, such as
relative-time formatted strings, as that would create a heap allocation
each frame.
Introduce TimeCached<T> which is responsible for updating some state
after some expiry.
Signed-off-by: William Casarin <jb55@jb55.com>