Introducing Damus Notedeck: a nostr browser
This splits notedeck into: - notedeck - notedeck_chrome - notedeck_columns The `notedeck` crate is the library that `notedeck_chrome` and `notedeck_columns`, use. It contains common functionality related to notedeck apps such as the NoteCache, ImageCache, etc. The `notedeck_chrome` crate is the binary and ui chrome. It is responsible for managing themes, user accounts, signing, data paths, nostrdb, image caches etc. It will eventually have its own ui which has yet to be determined. For now it just manages the browser data, which is passed to apps via a new struct called `AppContext`. `notedeck_columns` is our columns app, with less responsibility now that more things are handled by `notedeck_chrome` There is still much work left to do before this is a proper browser: - process isolation - sandboxing - etc This is the beginning of a new era! We're just getting started. Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
use crate::error::{Error, FilterError};
|
||||
use crate::filter;
|
||||
use crate::filter::FilterState;
|
||||
use crate::error::Error;
|
||||
use crate::timeline::Timeline;
|
||||
use enostr::{Filter, Pubkey};
|
||||
use nostrdb::{Ndb, Transaction};
|
||||
use notedeck::{filter::default_limit, FilterError, FilterState};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::{borrow::Cow, fmt::Display};
|
||||
use tracing::{error, warn};
|
||||
@@ -111,7 +110,7 @@ impl TimelineKind {
|
||||
TimelineKind::Universe,
|
||||
FilterState::ready(vec![Filter::new()
|
||||
.kinds([1])
|
||||
.limit(filter::default_limit())
|
||||
.limit(default_limit())
|
||||
.build()]),
|
||||
)),
|
||||
|
||||
@@ -129,7 +128,7 @@ impl TimelineKind {
|
||||
let filter = Filter::new()
|
||||
.authors([pk])
|
||||
.kinds([1])
|
||||
.limit(filter::default_limit())
|
||||
.limit(default_limit())
|
||||
.build();
|
||||
|
||||
Some(Timeline::new(
|
||||
@@ -147,7 +146,7 @@ impl TimelineKind {
|
||||
let notifications_filter = Filter::new()
|
||||
.pubkeys([pk])
|
||||
.kinds([1])
|
||||
.limit(crate::filter::default_limit())
|
||||
.limit(default_limit())
|
||||
.build();
|
||||
|
||||
Some(Timeline::new(
|
||||
@@ -179,10 +178,12 @@ impl TimelineKind {
|
||||
}
|
||||
|
||||
match Timeline::contact_list(&results[0].note, pk_src.clone()) {
|
||||
Err(Error::Filter(FilterError::EmptyContactList)) => Some(Timeline::new(
|
||||
TimelineKind::contact_list(pk_src),
|
||||
FilterState::needs_remote(vec![contact_filter]),
|
||||
)),
|
||||
Err(Error::App(notedeck::Error::Filter(FilterError::EmptyContactList))) => {
|
||||
Some(Timeline::new(
|
||||
TimelineKind::contact_list(pk_src),
|
||||
FilterState::needs_remote(vec![contact_filter]),
|
||||
))
|
||||
}
|
||||
Err(e) => {
|
||||
error!("Unexpected error: {e}");
|
||||
None
|
||||
|
||||
Reference in New Issue
Block a user