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.
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>
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.
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>
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>
also use IdTypeMap::insert_temp instead of insert_persisted.
The whole conception of using egui memory to share state is probably
going to be changed to a more robust solution in the future.
Signed-off-by: kernelkind <kernelkind@gmail.com>
Create a side panel UI element for desktop with three buttons for:
adding a column, settings, and account management. The account
management button is temporary pending a better design. It is the only
one that is interactable at the moment. When the user clicks it, the
global popup window will be shown and the AccountManagementView will be
presented on the window. The user can click on the X on the top right of
the window to close it.
Signed-off-by: kernelkind <kernelkind@gmail.com>
Signed-off-by: William Casarin <jb55@jb55.com>
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.
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.