create new page

This commit is contained in:
2026-04-11 16:14:59 -06:00
parent b534630675
commit 869a27c220
4 changed files with 207 additions and 3 deletions

View File

@@ -116,6 +116,18 @@ pub enum Panel {
Pages,
}
pub struct NewPageDialog {
pub title: String,
pub creating: bool,
pub error: Option<String>,
}
impl NewPageDialog {
pub fn new() -> Self {
Self { title: String::new(), creating: false, error: None }
}
}
pub struct MainView {
pub spaces: Vec<Space>,
pub pages: Vec<Page>,
@@ -126,6 +138,7 @@ pub struct MainView {
pub loading_pages: bool,
pub loading_page_content: bool,
pub error: Option<String>,
pub new_page_dialog: Option<NewPageDialog>,
}
impl MainView {
@@ -140,6 +153,7 @@ impl MainView {
loading_pages: false,
loading_page_content: false,
error: None,
new_page_dialog: None,
}
}
}
@@ -251,6 +265,8 @@ pub enum AppMsg {
PageContentLoaded { page_id: String, title: String, content: String },
PageSaved,
SaveError(String),
PageCreated { page_id: String, title: String },
CreateError(String),
SearchResults(Vec<SearchResult>),
SearchError(String),
ApiError(String),