Commit Graph

174 Commits

Author SHA1 Message Date
William Casarin
4c490e1436 Merge 'impl linux credential storage' #115
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
2024-07-01 10:49:15 -07:00
William Casarin
6f6d5f05af always have some default timeline
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-01 10:35:47 -07:00
William Casarin
69a8438f33 cleanup some dead code
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-01 07:31:43 -07:00
William Casarin
2d10b20ae2 allow multiple invocations of --sec
for multi-account

Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-01 07:02:22 -07:00
William Casarin
a04df88ff6 initial note posting
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-01 06:49:12 -07:00
William Casarin
8dc829791e cli: add --sec argument to quickly add an account
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-01 06:41:32 -07:00
William Casarin
3ed09dadf0 damus: make relay pool public
we will be using this for our post view

Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-01 06:39:39 -07:00
William Casarin
307b8af8f1 enostr: rename Event to Note
we will likely replace Note with nostrdb::Note in the future,
this just helps with that transition

Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-01 06:38:08 -07:00
kernelkind
2a47a66bbb impl linux credential storage
Signed-off-by: kernelkind <kernelkind@gmail.com>
2024-06-28 15:27:46 -04:00
William Casarin
26c4d90be3 initial postbox for testing
not sure if we want to put this here yet, but it matches the design
and will be useful for testing

Fixes: https://github.com/damus-io/notedeck/issues/110
Suggested-by: Rob
2024-06-25 14:08:56 -05:00
William Casarin
a6856867a9 Merge remote-tracking branch 'pr/107' 2024-06-25 13:20:56 -05:00
William Casarin
f8c8e48c26 postview: add vertical scroll
Suggested-by: kernelkind <kernelkind@gmail.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2024-06-24 16:19:06 -07:00
kernelkind
6afb618089 reintroduce account management
Signed-off-by: kernelkind <kernelkind@gmail.com>
2024-06-23 20:04:00 -04:00
William Casarin
0b3d6f7e37 initial post reply view
Signed-off-by: William Casarin <jb55@jb55.com>
2024-06-21 14:01:40 -07:00
William Casarin
86b0583221 use unique id for post/reply view
Signed-off-by: William Casarin <jb55@jb55.com>
2024-06-21 09:58:47 -07:00
William Casarin
18d5d95ef9 fix postbox design
Signed-off-by: William Casarin <jb55@jb55.com>
2024-06-20 13:44:35 -07:00
William Casarin
395ff57edf add vertical separators between timelines
Fixes: https://github.com/damus-io/notedeck/issues/52
Signed-off-by: William Casarin <jb55@jb55.com>
2024-06-20 13:02:18 -07:00
kernelkind
98a61c0aa7 reintroduce account switcher
Signed-off-by: kernelkind <kernelkind@gmail.com>
2024-06-18 19:16:11 -04:00
William Casarin
1458498131 initial post box view
Signed-off-by: William Casarin <jb55@jb55.com>
2024-06-17 16:21:46 -07:00
William Casarin
577aa76ac7 add --light lightmode flag to previews and notedeck
Signed-off-by: William Casarin <jb55@jb55.com>
2024-06-14 11:12:16 -07:00
William Casarin
d17b5e0703 Add forward navigation animation
Also fix a few nav clipping bugs

From egui-nav:

William Casarin (5):
      add forward nav support
      fix body overlapping header
      fix transition clipping when in a smaller container
      fix forward nav clipping in small containers
      fix background layer having the wrong UI id

Signed-off-by: William Casarin <jb55@jb55.com>
2024-06-13 11:59:08 -07:00
William Casarin
24d400d5aa small inline preview pfps
Signed-off-by: William Casarin <jb55@jb55.com>
2024-06-11 17:50:15 -07:00
William Casarin
0dd33c90e7 initial navigation 2024-06-11 17:50:09 -07:00
William Casarin
a47f0ba1b2 args: allow filter files and raw filters on cli
Signed-off-by: William Casarin <jb55@jb55.com>
2024-06-10 07:52:51 -07:00
William Casarin
d576082297 reset virtual list if notes are spliced into timeline
Calling egui_virtual_list's `items_inserted_at_start` is incorrect if we
insert notes inbetween other notes in the timeline. To prevent our list
getting confused, let's handle this case explicitly by calling 'reset'
when we splice notes in.

Ideally we would update egui_virtual_list to handle spliced-in items,
but we will leave that to a future update.
2024-06-09 08:53:10 -07:00
William Casarin
0eec8c8c2b dont since-optimize when we don't have enough notes
If our limit says we're ok with many more notes than we have, then don't
since-optimize, otherwise we may be missing notes. This results in a

Changelog-Changed: Don't since-optimize if we don't have enough notes
Signed-off-by: William Casarin <jb55@jb55.com>
2024-05-31 09:25:54 +02:00
William Casarin
2d9f45603c remote: use default_remote_limit instead of hardcoding
Signed-off-by: William Casarin <jb55@jb55.com>
2024-05-31 09:24:52 +02:00
William Casarin
ab08e678a9 filter: add default limit
This is just an opinionated default limit if we ever need it (we will)

Signed-off-by: William Casarin <jb55@jb55.com>
2024-05-31 09:24:52 +02:00
William Casarin
6e69407224 cleanups 2024-05-31 01:08:45 -05:00
William Casarin
2305f1e50a mobile: make mobile flag runtime-configurable
we need to pass a few more things around but it's not that bad. This
will allow you to launch damus with --mobile for mobile testing without
recompilation.
2024-05-31 01:05:53 -05:00
William Casarin
83eab71148 Merge remote-tracking branch 'pr/80' 2024-05-31 01:01:05 -05:00
William Casarin
92ce718e8b side_panel: return more detailed side panel responses
We should be treating all ui widgets as pure functions that do not
mutate anything. This will make testing easier, as well as avoiding
shared mutable references.

Signed-off-by: William Casarin <jb55@jb55.com>
2024-05-28 15:09:19 -07:00
William Casarin
31b2b5c950 initial refactor in preparation for routing
Signed-off-by: William Casarin <jb55@jb55.com>
2024-05-28 15:09:01 -07:00
William Casarin
2af44641db cap size of remote filter limits
I noticed the responses are a bit slow without this. Local query limits
are not capped.

Fixes: https://github.com/damus-io/notedeck/issues/98
Changelog-Changed: Restrict remote filter sizes to 250 (for now)
Signed-off-by: William Casarin <jb55@jb55.com>
2024-05-27 11:50:45 -07:00
kernelkind
df0377cb89 Pfp integration to side panel
Signed-off-by: kernelkind <kernelkind@gmail.com>
2024-05-27 10:48:28 -07:00
kernelkind
2ca47edf4d AccountManager: add ability to make a selection
Signed-off-by: kernelkind <kernelkind@gmail.com>
2024-05-27 10:48:28 -07:00
kernelkind
11b3effa51 Add AccountManager to app
Signed-off-by: kernelkind <kernelkind@gmail.com>
2024-05-27 10:48:28 -07:00
kernelkind
748d9d2358 Integrate global popup into app
Signed-off-by: kernelkind <kernelkind@gmail.com>
2024-05-27 10:48:28 -07:00
William Casarin
194f41d39c integrate sidebar into main view
buttons don't do anything yet

Signed-off-by: William Casarin <jb55@jb55.com>
2024-05-27 10:48:28 -07:00
kernelkind
1dc832baea app: add accounts to Damus & mock
Signed-off-by: kernelkind <kernelkind@gmail.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2024-05-27 10:48:28 -07:00
William Casarin
9e5048d4f2 input: fix deadlock on resize
weird egui Context quirk

Fixes: https://github.com/damus-io/notedeck/issues/97
Signed-off-by: William Casarin <jb55@jb55.com>
2024-05-24 13:42:57 -07:00
William Casarin
2bef02106a mobile: use my timeline for testing again
Signed-off-by: William Casarin <jb55@jb55.com>
2024-05-24 13:21:37 -07:00
William Casarin
c5cc2f923c mobile: a tad more padding at the top
Signed-off-by: William Casarin <jb55@jb55.com>
2024-05-24 13:21:22 -07:00
William Casarin
739e9f87f2 nip10: fetch unknown replied-to notes
Signed-off-by: William Casarin <jb55@jb55.com>
2024-05-24 13:20:33 -07:00
William Casarin
6fc5eb27fc working notes + notes&replies
Signed-off-by: William Casarin <jb55@jb55.com>
2024-05-23 15:31:24 -07:00
William Casarin
232ba0e3aa list: switch from arc mutext to rc refcell
we don't have any multithreaded stuff yet

Signed-off-by: William Casarin <jb55@jb55.com>
2024-05-23 15:27:37 -07:00
William Casarin
a8693a2bd3 timeline: refactor tabs into TimelineView
TimelineView is a filtered view of a timeline. We will use this for
future tab rendering. We also introduce a new "selection" concept for
selecting notes on different timeline views. This is in preparation for
vim keybindings.
2024-05-23 15:27:37 -07:00
William Casarin
8663851e7e input: handle raw events 2024-05-23 15:27:37 -07:00
William Casarin
cf2a832a5e input: switch to scanning over raw input events
Calling key_pressed invokes a filter over the entire event list every
time, this is much more efficient, which is important when we are
handling many key events.
2024-05-23 11:16:50 -07:00
William Casarin
3a891a982c input: process input once
Instead of calling ctx.input multiple times, let's do it once. We are
going to do a lot more stuff in here, such as vim key bindings
2024-05-23 11:16:50 -07:00