add NotedeckOptions and feature flags, add notebook feature

This switches from bools to flags in our Args struct. We also add
notebook as an optional feature flag (--notebook) since its not ready.
This commit is contained in:
William Casarin
2025-07-31 16:03:13 -07:00
parent d12e5b363c
commit b1a5dd6cab
11 changed files with 100 additions and 46 deletions

View File

@@ -10,14 +10,13 @@ static GLOBAL: AccountingAllocator<std::alloc::System> =
AccountingAllocator::new(std::alloc::System);
use notedeck::enostr::Error;
use notedeck::{DataPath, DataPathType, Notedeck};
use notedeck::{DataPath, DataPathType, Notedeck, NotedeckOptions};
use notedeck_chrome::{
setup::{generate_native_options, setup_chrome},
Chrome, NotedeckApp,
};
use notedeck_columns::Damus;
use notedeck_dave::Dave;
use notedeck_notebook::Notebook;
use tracing::error;
use tracing_appender::non_blocking::WorkerGuard;
use tracing_subscriber::EnvFilter;
@@ -98,7 +97,6 @@ async fn main() {
let mut chrome = Chrome::new();
let columns = Damus::new(&mut notedeck.app_context(), &args);
let dave = Dave::new(cc.wgpu_render_state.as_ref());
let notebook = Notebook::default();
setup_chrome(
ctx,
@@ -121,7 +119,13 @@ async fn main() {
chrome.add_app(NotedeckApp::Columns(Box::new(columns)));
chrome.add_app(NotedeckApp::Dave(Box::new(dave)));
chrome.add_app(NotedeckApp::Notebook(Box::new(notebook)));
if notedeck
.options()
.contains(NotedeckOptions::FeatureNotebook)
{
chrome.add_app(NotedeckApp::Notebook(Box::default()));
}
chrome.set_active(0);