mirror of
https://github.com/Dasemu/Synapse.git
synced 2026-11-26 15:26:17 +00:00
Merge branch 'feat/tags-types-view' into feat/settings-theme-tree
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
12c3cd463b
45 files changed
+3142
-248
No files matched your search
@@ -50,6 +50,28 @@ pub struct TagDto {
|
||||
pub count: u32,
|
||||
/// One of the seeded suggestions.
|
||||
pub suggested: bool,
|
||||
/// Emoji of a type (types only).
|
||||
pub icon: Option<String>,
|
||||
/// Pages listing it as an explicit tag (tags only).
|
||||
pub explicit: u32,
|
||||
/// Pages having it as their type (tags only).
|
||||
pub typed: u32,
|
||||
/// Pages carrying it through their hub (tags only; hub tags cannot be renamed or removed).
|
||||
pub from_hub: u32,
|
||||
}
|
||||
|
||||
impl From<synapse_core::TagInfo> for TagDto {
|
||||
fn from(t: synapse_core::TagInfo) -> Self {
|
||||
Self {
|
||||
name: t.name,
|
||||
count: t.count,
|
||||
suggested: t.suggested,
|
||||
icon: t.icon,
|
||||
explicit: t.explicit,
|
||||
typed: t.typed,
|
||||
from_hub: t.from_hub,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// One row of the outline, in pre-order.
|
||||
@@ -110,6 +132,8 @@ pub struct BacklinkGroup {
|
||||
pub page_id: String,
|
||||
pub page_title: String,
|
||||
pub is_journal: bool,
|
||||
/// Type of the referencing page (for its icon).
|
||||
pub page_type: Option<String>,
|
||||
pub blocks: Vec<BlockDto>,
|
||||
}
|
||||
|
||||
@@ -119,6 +143,8 @@ pub struct PageBrief {
|
||||
pub title: String,
|
||||
pub is_journal: bool,
|
||||
pub is_hub: bool,
|
||||
/// The page's type (the UI shows its icon next to the title).
|
||||
pub page_type: Option<String>,
|
||||
}
|
||||
|
||||
impl From<&Page> for PageBrief {
|
||||
@@ -128,6 +154,7 @@ impl From<&Page> for PageBrief {
|
||||
title: p.title.clone(),
|
||||
is_journal: p.is_journal(),
|
||||
is_hub: p.is_hub(),
|
||||
page_type: p.page_type().map(String::from),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -185,6 +212,8 @@ pub struct TitleHit {
|
||||
/// The matched title or alias.
|
||||
pub title: String,
|
||||
pub is_alias: bool,
|
||||
/// Type of the page (for its icon).
|
||||
pub page_type: Option<String>,
|
||||
}
|
||||
|
||||
/// A block matching a search (`((` autocomplete, quick switcher content results).
|
||||
@@ -240,6 +269,8 @@ pub struct GraphNode {
|
||||
/// A virtual tag node (not a page, no outline): `id` is `tag:<title_key>`, `title` the
|
||||
/// display name, `degree` the number of pages carrying the tag.
|
||||
pub is_tag: bool,
|
||||
/// The page's type (tree labels show its icon; the network view does not).
|
||||
pub page_type: Option<String>,
|
||||
}
|
||||
|
||||
/// The whole page-level graph, edges as parallel arrays (cheap to move across the FFI).
|
||||
|
||||
@@ -209,15 +209,23 @@ impl SynapseGraph {
|
||||
if !seen.insert(bl.block.id) {
|
||||
continue;
|
||||
}
|
||||
let i = *index.entry(bl.block.page_id).or_insert_with(|| {
|
||||
groups.push(BacklinkGroup {
|
||||
page_id: bl.block.page_id.to_string(),
|
||||
page_title: bl.page_title.clone(),
|
||||
is_journal: parse_day(&bl.page_title).is_some(),
|
||||
blocks: Vec::new(),
|
||||
});
|
||||
groups.len() - 1
|
||||
});
|
||||
let i = match index.get(&bl.block.page_id) {
|
||||
Some(&i) => i,
|
||||
None => {
|
||||
let page_type = g
|
||||
.get_page(bl.block.page_id)?
|
||||
.and_then(|p| p.page_type().map(String::from));
|
||||
groups.push(BacklinkGroup {
|
||||
page_id: bl.block.page_id.to_string(),
|
||||
page_title: bl.page_title.clone(),
|
||||
is_journal: parse_day(&bl.page_title).is_some(),
|
||||
page_type,
|
||||
blocks: Vec::new(),
|
||||
});
|
||||
index.insert(bl.block.page_id, groups.len() - 1);
|
||||
groups.len() - 1
|
||||
}
|
||||
};
|
||||
groups[i].blocks.push(BlockDto::new(0, &bl.block, false));
|
||||
}
|
||||
Ok(groups)
|
||||
|
||||
@@ -83,6 +83,11 @@ pub(crate) fn build(g: &Graph, seq: i64) -> Result<GraphData> {
|
||||
.into_iter()
|
||||
.map(|(id, t)| (id.to_string(), t))
|
||||
.collect();
|
||||
let mut page_types: HashMap<String, String> = g
|
||||
.all_page_types()?
|
||||
.into_iter()
|
||||
.map(|(id, t)| (id.to_string(), t))
|
||||
.collect();
|
||||
{
|
||||
let mut st = conn.prepare(
|
||||
"SELECT id, title, journal_date, origin_journal, created_at FROM pages
|
||||
@@ -100,6 +105,7 @@ pub(crate) fn build(g: &Graph, seq: i64) -> Result<GraphData> {
|
||||
})?;
|
||||
for row in rows {
|
||||
let (id, title, journal_date, origin_journal, created_at) = row?;
|
||||
let page_type = page_types.remove(&id);
|
||||
let tags = page_tags.get(&id).cloned().unwrap_or_default();
|
||||
index.insert(id.clone(), nodes.len() as u32);
|
||||
nodes.push(GraphNode {
|
||||
@@ -116,6 +122,7 @@ pub(crate) fn build(g: &Graph, seq: i64) -> Result<GraphData> {
|
||||
home_hub: None,
|
||||
tags,
|
||||
is_tag: false,
|
||||
page_type,
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -328,6 +335,7 @@ fn tagged(
|
||||
home_hub: None,
|
||||
tags: Vec::new(),
|
||||
is_tag: true,
|
||||
page_type: None,
|
||||
});
|
||||
nodes.len() as u32 - 1
|
||||
});
|
||||
|
||||
@@ -23,6 +23,7 @@ impl SynapseGraph {
|
||||
page_id: p.id.to_string(),
|
||||
title: p.title.clone(),
|
||||
is_alias: false,
|
||||
page_type: p.page_type().map(String::from),
|
||||
})
|
||||
.collect());
|
||||
}
|
||||
@@ -52,13 +53,15 @@ impl SynapseGraph {
|
||||
hits.truncate(limit as usize);
|
||||
let mut out = Vec::with_capacity(hits.len());
|
||||
for (_, _, title, id) in hits {
|
||||
let is_alias = g
|
||||
.get_page(id)?
|
||||
let page = g.get_page(id)?;
|
||||
let is_alias = page
|
||||
.as_ref()
|
||||
.is_some_and(|p| title_key(&p.title) != title_key(&title));
|
||||
out.push(TitleHit {
|
||||
page_id: id.to_string(),
|
||||
title,
|
||||
is_alias,
|
||||
page_type: page.and_then(|p| p.page_type().map(String::from)),
|
||||
});
|
||||
}
|
||||
Ok(out)
|
||||
|
||||
@@ -42,11 +42,7 @@ impl SynapseGraph {
|
||||
.lock()
|
||||
.tag_catalog()?
|
||||
.into_iter()
|
||||
.map(|t| TagDto {
|
||||
name: t.name,
|
||||
count: t.count,
|
||||
suggested: t.suggested,
|
||||
})
|
||||
.map(TagDto::from)
|
||||
.collect())
|
||||
}
|
||||
|
||||
@@ -72,17 +68,34 @@ impl SynapseGraph {
|
||||
)?))
|
||||
}
|
||||
|
||||
/// Types in use (most used first) followed by the seeded suggestions not used yet.
|
||||
/// Adds a type to the vocabulary even if no page uses it; returns its spelling.
|
||||
pub fn create_type(&self, name: String) -> Result<String> {
|
||||
Ok(self.lock().create_type(&name)?)
|
||||
}
|
||||
|
||||
/// Sets (or with `None` clears) the emoji of a type, defining the type if needed.
|
||||
pub fn set_type_icon(&self, name: String, icon: Option<String>) -> Result<()> {
|
||||
Ok(self.lock().set_type_icon(&name, icon.as_deref())?)
|
||||
}
|
||||
|
||||
/// Renames a type (and same-name tags), keeping its icon; returns the pages changed.
|
||||
pub fn rename_type(&self, old: String, new: String) -> Result<u32> {
|
||||
Ok(self.lock().rename_type(&old, &new)? as u32)
|
||||
}
|
||||
|
||||
/// Deletes a type: its pages lose it and its icon is dropped; returns the pages changed.
|
||||
pub fn remove_type(&self, name: String) -> Result<u32> {
|
||||
Ok(self.lock().remove_type(&name)? as u32)
|
||||
}
|
||||
|
||||
/// Types in use (most used first), then defined unused types, then the seeded suggestions
|
||||
/// not used yet; each with its icon.
|
||||
pub fn type_catalog(&self) -> Result<Vec<TagDto>> {
|
||||
Ok(self
|
||||
.lock()
|
||||
.type_catalog()?
|
||||
.into_iter()
|
||||
.map(|t| TagDto {
|
||||
name: t.name,
|
||||
count: t.count,
|
||||
suggested: t.suggested,
|
||||
})
|
||||
.map(TagDto::from)
|
||||
.collect())
|
||||
}
|
||||
}
|
||||
@@ -41,7 +41,7 @@ flutter_rust_bridge::frb_generated_boilerplate!(
|
||||
default_rust_auto_opaque = RustAutoOpaqueMoi,
|
||||
);
|
||||
pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_VERSION: &str = "2.13.0";
|
||||
pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_CONTENT_HASH: i32 = -1472342481;
|
||||
pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_CONTENT_HASH: i32 = 272705018;
|
||||
|
||||
// Section: executor
|
||||
|
||||
@@ -921,6 +921,61 @@ fn wire__crate__api__graph__SynapseGraph_create_page_from_template_impl(
|
||||
},
|
||||
)
|
||||
}
|
||||
fn wire__crate__api__graph__SynapseGraph_create_type_impl(
|
||||
port_: flutter_rust_bridge::for_generated::MessagePort,
|
||||
ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr,
|
||||
rust_vec_len_: i32,
|
||||
data_len_: i32,
|
||||
) {
|
||||
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::SseCodec, _, _>(
|
||||
flutter_rust_bridge::for_generated::TaskInfo {
|
||||
debug_name: "SynapseGraph_create_type",
|
||||
port: Some(port_),
|
||||
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
|
||||
},
|
||||
move || {
|
||||
let message = unsafe {
|
||||
flutter_rust_bridge::for_generated::Dart2RustMessageSse::from_wire(
|
||||
ptr_,
|
||||
rust_vec_len_,
|
||||
data_len_,
|
||||
)
|
||||
};
|
||||
let mut deserializer =
|
||||
flutter_rust_bridge::for_generated::SseDeserializer::new(message);
|
||||
let api_that = <RustOpaqueMoi<
|
||||
flutter_rust_bridge::for_generated::RustAutoOpaqueInner<SynapseGraph>,
|
||||
>>::sse_decode(&mut deserializer);
|
||||
let api_name = <String>::sse_decode(&mut deserializer);
|
||||
deserializer.end();
|
||||
move |context| {
|
||||
transform_result_sse::<_, flutter_rust_bridge::for_generated::anyhow::Error>(
|
||||
(move || {
|
||||
let mut api_that_guard = None;
|
||||
let decode_indices_ =
|
||||
flutter_rust_bridge::for_generated::lockable_compute_decode_order(
|
||||
vec![flutter_rust_bridge::for_generated::LockableOrderInfo::new(
|
||||
&api_that, 0, false,
|
||||
)],
|
||||
);
|
||||
for i in decode_indices_ {
|
||||
match i {
|
||||
0 => api_that_guard = Some(api_that.lockable_decode_sync_ref()),
|
||||
_ => unreachable!(),
|
||||
}
|
||||
}
|
||||
let api_that_guard = api_that_guard.unwrap();
|
||||
let output_ok = crate::api::graph::SynapseGraph::create_type(
|
||||
&*api_that_guard,
|
||||
api_name,
|
||||
)?;
|
||||
std::result::Result::Ok(output_ok)
|
||||
})(),
|
||||
)
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
fn wire__crate__api__graph__SynapseGraph_delete_block_impl(
|
||||
port_: flutter_rust_bridge::for_generated::MessagePort,
|
||||
ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr,
|
||||
@@ -2722,6 +2777,61 @@ fn wire__crate__api__graph__SynapseGraph_remove_tag_impl(
|
||||
},
|
||||
)
|
||||
}
|
||||
fn wire__crate__api__graph__SynapseGraph_remove_type_impl(
|
||||
port_: flutter_rust_bridge::for_generated::MessagePort,
|
||||
ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr,
|
||||
rust_vec_len_: i32,
|
||||
data_len_: i32,
|
||||
) {
|
||||
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::SseCodec, _, _>(
|
||||
flutter_rust_bridge::for_generated::TaskInfo {
|
||||
debug_name: "SynapseGraph_remove_type",
|
||||
port: Some(port_),
|
||||
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
|
||||
},
|
||||
move || {
|
||||
let message = unsafe {
|
||||
flutter_rust_bridge::for_generated::Dart2RustMessageSse::from_wire(
|
||||
ptr_,
|
||||
rust_vec_len_,
|
||||
data_len_,
|
||||
)
|
||||
};
|
||||
let mut deserializer =
|
||||
flutter_rust_bridge::for_generated::SseDeserializer::new(message);
|
||||
let api_that = <RustOpaqueMoi<
|
||||
flutter_rust_bridge::for_generated::RustAutoOpaqueInner<SynapseGraph>,
|
||||
>>::sse_decode(&mut deserializer);
|
||||
let api_name = <String>::sse_decode(&mut deserializer);
|
||||
deserializer.end();
|
||||
move |context| {
|
||||
transform_result_sse::<_, flutter_rust_bridge::for_generated::anyhow::Error>(
|
||||
(move || {
|
||||
let mut api_that_guard = None;
|
||||
let decode_indices_ =
|
||||
flutter_rust_bridge::for_generated::lockable_compute_decode_order(
|
||||
vec![flutter_rust_bridge::for_generated::LockableOrderInfo::new(
|
||||
&api_that, 0, false,
|
||||
)],
|
||||
);
|
||||
for i in decode_indices_ {
|
||||
match i {
|
||||
0 => api_that_guard = Some(api_that.lockable_decode_sync_ref()),
|
||||
_ => unreachable!(),
|
||||
}
|
||||
}
|
||||
let api_that_guard = api_that_guard.unwrap();
|
||||
let output_ok = crate::api::graph::SynapseGraph::remove_type(
|
||||
&*api_that_guard,
|
||||
api_name,
|
||||
)?;
|
||||
std::result::Result::Ok(output_ok)
|
||||
})(),
|
||||
)
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
fn wire__crate__api__graph__SynapseGraph_rename_page_impl(
|
||||
port_: flutter_rust_bridge::for_generated::MessagePort,
|
||||
ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr,
|
||||
@@ -2836,6 +2946,63 @@ fn wire__crate__api__graph__SynapseGraph_rename_tag_impl(
|
||||
},
|
||||
)
|
||||
}
|
||||
fn wire__crate__api__graph__SynapseGraph_rename_type_impl(
|
||||
port_: flutter_rust_bridge::for_generated::MessagePort,
|
||||
ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr,
|
||||
rust_vec_len_: i32,
|
||||
data_len_: i32,
|
||||
) {
|
||||
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::SseCodec, _, _>(
|
||||
flutter_rust_bridge::for_generated::TaskInfo {
|
||||
debug_name: "SynapseGraph_rename_type",
|
||||
port: Some(port_),
|
||||
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
|
||||
},
|
||||
move || {
|
||||
let message = unsafe {
|
||||
flutter_rust_bridge::for_generated::Dart2RustMessageSse::from_wire(
|
||||
ptr_,
|
||||
rust_vec_len_,
|
||||
data_len_,
|
||||
)
|
||||
};
|
||||
let mut deserializer =
|
||||
flutter_rust_bridge::for_generated::SseDeserializer::new(message);
|
||||
let api_that = <RustOpaqueMoi<
|
||||
flutter_rust_bridge::for_generated::RustAutoOpaqueInner<SynapseGraph>,
|
||||
>>::sse_decode(&mut deserializer);
|
||||
let api_old = <String>::sse_decode(&mut deserializer);
|
||||
let api_new = <String>::sse_decode(&mut deserializer);
|
||||
deserializer.end();
|
||||
move |context| {
|
||||
transform_result_sse::<_, flutter_rust_bridge::for_generated::anyhow::Error>(
|
||||
(move || {
|
||||
let mut api_that_guard = None;
|
||||
let decode_indices_ =
|
||||
flutter_rust_bridge::for_generated::lockable_compute_decode_order(
|
||||
vec![flutter_rust_bridge::for_generated::LockableOrderInfo::new(
|
||||
&api_that, 0, false,
|
||||
)],
|
||||
);
|
||||
for i in decode_indices_ {
|
||||
match i {
|
||||
0 => api_that_guard = Some(api_that.lockable_decode_sync_ref()),
|
||||
_ => unreachable!(),
|
||||
}
|
||||
}
|
||||
let api_that_guard = api_that_guard.unwrap();
|
||||
let output_ok = crate::api::graph::SynapseGraph::rename_type(
|
||||
&*api_that_guard,
|
||||
api_old,
|
||||
api_new,
|
||||
)?;
|
||||
std::result::Result::Ok(output_ok)
|
||||
})(),
|
||||
)
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
fn wire__crate__api__graph__SynapseGraph_search_blocks_impl(
|
||||
port_: flutter_rust_bridge::for_generated::MessagePort,
|
||||
ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr,
|
||||
@@ -3178,6 +3345,63 @@ fn wire__crate__api__graph__SynapseGraph_set_page_type_impl(
|
||||
},
|
||||
)
|
||||
}
|
||||
fn wire__crate__api__graph__SynapseGraph_set_type_icon_impl(
|
||||
port_: flutter_rust_bridge::for_generated::MessagePort,
|
||||
ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr,
|
||||
rust_vec_len_: i32,
|
||||
data_len_: i32,
|
||||
) {
|
||||
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::SseCodec, _, _>(
|
||||
flutter_rust_bridge::for_generated::TaskInfo {
|
||||
debug_name: "SynapseGraph_set_type_icon",
|
||||
port: Some(port_),
|
||||
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
|
||||
},
|
||||
move || {
|
||||
let message = unsafe {
|
||||
flutter_rust_bridge::for_generated::Dart2RustMessageSse::from_wire(
|
||||
ptr_,
|
||||
rust_vec_len_,
|
||||
data_len_,
|
||||
)
|
||||
};
|
||||
let mut deserializer =
|
||||
flutter_rust_bridge::for_generated::SseDeserializer::new(message);
|
||||
let api_that = <RustOpaqueMoi<
|
||||
flutter_rust_bridge::for_generated::RustAutoOpaqueInner<SynapseGraph>,
|
||||
>>::sse_decode(&mut deserializer);
|
||||
let api_name = <String>::sse_decode(&mut deserializer);
|
||||
let api_icon = <Option<String>>::sse_decode(&mut deserializer);
|
||||
deserializer.end();
|
||||
move |context| {
|
||||
transform_result_sse::<_, flutter_rust_bridge::for_generated::anyhow::Error>(
|
||||
(move || {
|
||||
let mut api_that_guard = None;
|
||||
let decode_indices_ =
|
||||
flutter_rust_bridge::for_generated::lockable_compute_decode_order(
|
||||
vec![flutter_rust_bridge::for_generated::LockableOrderInfo::new(
|
||||
&api_that, 0, false,
|
||||
)],
|
||||
);
|
||||
for i in decode_indices_ {
|
||||
match i {
|
||||
0 => api_that_guard = Some(api_that.lockable_decode_sync_ref()),
|
||||
_ => unreachable!(),
|
||||
}
|
||||
}
|
||||
let api_that_guard = api_that_guard.unwrap();
|
||||
let output_ok = crate::api::graph::SynapseGraph::set_type_icon(
|
||||
&*api_that_guard,
|
||||
api_name,
|
||||
api_icon,
|
||||
)?;
|
||||
std::result::Result::Ok(output_ok)
|
||||
})(),
|
||||
)
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
fn wire__crate__api__graph__SynapseGraph_tag_catalog_impl(
|
||||
port_: flutter_rust_bridge::for_generated::MessagePort,
|
||||
ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr,
|
||||
@@ -3533,11 +3757,13 @@ impl SseDecode for crate::api::dto::BacklinkGroup {
|
||||
let mut var_pageId = <String>::sse_decode(deserializer);
|
||||
let mut var_pageTitle = <String>::sse_decode(deserializer);
|
||||
let mut var_isJournal = <bool>::sse_decode(deserializer);
|
||||
let mut var_pageType = <Option<String>>::sse_decode(deserializer);
|
||||
let mut var_blocks = <Vec<crate::api::dto::BlockDto>>::sse_decode(deserializer);
|
||||
return crate::api::dto::BacklinkGroup {
|
||||
page_id: var_pageId,
|
||||
page_title: var_pageTitle,
|
||||
is_journal: var_isJournal,
|
||||
page_type: var_pageType,
|
||||
blocks: var_blocks,
|
||||
};
|
||||
}
|
||||
@@ -3657,6 +3883,7 @@ impl SseDecode for crate::api::dto::GraphNode {
|
||||
let mut var_homeHub = <Option<u32>>::sse_decode(deserializer);
|
||||
let mut var_tags = <Vec<String>>::sse_decode(deserializer);
|
||||
let mut var_isTag = <bool>::sse_decode(deserializer);
|
||||
let mut var_pageType = <Option<String>>::sse_decode(deserializer);
|
||||
return crate::api::dto::GraphNode {
|
||||
id: var_id,
|
||||
title: var_title,
|
||||
@@ -3671,6 +3898,7 @@ impl SseDecode for crate::api::dto::GraphNode {
|
||||
home_hub: var_homeHub,
|
||||
tags: var_tags,
|
||||
is_tag: var_isTag,
|
||||
page_type: var_pageType,
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -4073,11 +4301,13 @@ impl SseDecode for crate::api::dto::PageBrief {
|
||||
let mut var_title = <String>::sse_decode(deserializer);
|
||||
let mut var_isJournal = <bool>::sse_decode(deserializer);
|
||||
let mut var_isHub = <bool>::sse_decode(deserializer);
|
||||
let mut var_pageType = <Option<String>>::sse_decode(deserializer);
|
||||
return crate::api::dto::PageBrief {
|
||||
id: var_id,
|
||||
title: var_title,
|
||||
is_journal: var_isJournal,
|
||||
is_hub: var_isHub,
|
||||
page_type: var_pageType,
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -4201,10 +4431,18 @@ impl SseDecode for crate::api::dto::TagDto {
|
||||
let mut var_name = <String>::sse_decode(deserializer);
|
||||
let mut var_count = <u32>::sse_decode(deserializer);
|
||||
let mut var_suggested = <bool>::sse_decode(deserializer);
|
||||
let mut var_icon = <Option<String>>::sse_decode(deserializer);
|
||||
let mut var_explicit = <u32>::sse_decode(deserializer);
|
||||
let mut var_typed = <u32>::sse_decode(deserializer);
|
||||
let mut var_fromHub = <u32>::sse_decode(deserializer);
|
||||
return crate::api::dto::TagDto {
|
||||
name: var_name,
|
||||
count: var_count,
|
||||
suggested: var_suggested,
|
||||
icon: var_icon,
|
||||
explicit: var_explicit,
|
||||
typed: var_typed,
|
||||
from_hub: var_fromHub,
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -4243,10 +4481,12 @@ impl SseDecode for crate::api::dto::TitleHit {
|
||||
let mut var_pageId = <String>::sse_decode(deserializer);
|
||||
let mut var_title = <String>::sse_decode(deserializer);
|
||||
let mut var_isAlias = <bool>::sse_decode(deserializer);
|
||||
let mut var_pageType = <Option<String>>::sse_decode(deserializer);
|
||||
return crate::api::dto::TitleHit {
|
||||
page_id: var_pageId,
|
||||
title: var_title,
|
||||
is_alias: var_isAlias,
|
||||
page_type: var_pageType,
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -4337,211 +4577,235 @@ fn pde_ffi_dispatcher_primary_impl(
|
||||
rust_vec_len,
|
||||
data_len,
|
||||
),
|
||||
17 => wire__crate__api__graph__SynapseGraph_delete_block_impl(
|
||||
17 => wire__crate__api__graph__SynapseGraph_create_type_impl(
|
||||
port,
|
||||
ptr,
|
||||
rust_vec_len,
|
||||
data_len,
|
||||
),
|
||||
18 => wire__crate__api__graph__SynapseGraph_delete_page_impl(
|
||||
18 => wire__crate__api__graph__SynapseGraph_delete_block_impl(
|
||||
port,
|
||||
ptr,
|
||||
rust_vec_len,
|
||||
data_len,
|
||||
),
|
||||
20 => {
|
||||
19 => wire__crate__api__graph__SynapseGraph_delete_page_impl(
|
||||
port,
|
||||
ptr,
|
||||
rust_vec_len,
|
||||
data_len,
|
||||
),
|
||||
21 => {
|
||||
wire__crate__api__graph__SynapseGraph_graph_data_impl(port, ptr, rust_vec_len, data_len)
|
||||
}
|
||||
21 => wire__crate__api__graph__SynapseGraph_hub_conversion_preview_impl(
|
||||
22 => wire__crate__api__graph__SynapseGraph_hub_conversion_preview_impl(
|
||||
port,
|
||||
ptr,
|
||||
rust_vec_len,
|
||||
data_len,
|
||||
),
|
||||
22 => wire__crate__api__graph__SynapseGraph_hub_template_impl(
|
||||
23 => wire__crate__api__graph__SynapseGraph_hub_template_impl(
|
||||
port,
|
||||
ptr,
|
||||
rust_vec_len,
|
||||
data_len,
|
||||
),
|
||||
23 => wire__crate__api__graph__SynapseGraph_hubs_impl(port, ptr, rust_vec_len, data_len),
|
||||
24 => wire__crate__api__graph__SynapseGraph_indent_block_impl(
|
||||
24 => wire__crate__api__graph__SynapseGraph_hubs_impl(port, ptr, rust_vec_len, data_len),
|
||||
25 => wire__crate__api__graph__SynapseGraph_indent_block_impl(
|
||||
port,
|
||||
ptr,
|
||||
rust_vec_len,
|
||||
data_len,
|
||||
),
|
||||
25 => wire__crate__api__graph__SynapseGraph_insert_block_impl(
|
||||
26 => wire__crate__api__graph__SynapseGraph_insert_block_impl(
|
||||
port,
|
||||
ptr,
|
||||
rust_vec_len,
|
||||
data_len,
|
||||
),
|
||||
26 => wire__crate__api__graph__SynapseGraph_journal_impl(port, ptr, rust_vec_len, data_len),
|
||||
27 => wire__crate__api__graph__SynapseGraph_journal_neighbors_impl(
|
||||
27 => wire__crate__api__graph__SynapseGraph_journal_impl(port, ptr, rust_vec_len, data_len),
|
||||
28 => wire__crate__api__graph__SynapseGraph_journal_neighbors_impl(
|
||||
port,
|
||||
ptr,
|
||||
rust_vec_len,
|
||||
data_len,
|
||||
),
|
||||
28 => {
|
||||
29 => {
|
||||
wire__crate__api__graph__SynapseGraph_journals_impl(port, ptr, rust_vec_len, data_len)
|
||||
}
|
||||
29 => wire__crate__api__graph__SynapseGraph_legacy_candidates_impl(
|
||||
30 => wire__crate__api__graph__SynapseGraph_legacy_candidates_impl(
|
||||
port,
|
||||
ptr,
|
||||
rust_vec_len,
|
||||
data_len,
|
||||
),
|
||||
30 => {
|
||||
31 => {
|
||||
wire__crate__api__graph__SynapseGraph_list_pages_impl(port, ptr, rust_vec_len, data_len)
|
||||
}
|
||||
31 => wire__crate__api__graph__SynapseGraph_merge_block_impl(
|
||||
32 => wire__crate__api__graph__SynapseGraph_merge_block_impl(
|
||||
port,
|
||||
ptr,
|
||||
rust_vec_len,
|
||||
data_len,
|
||||
),
|
||||
32 => {
|
||||
33 => {
|
||||
wire__crate__api__graph__SynapseGraph_move_block_impl(port, ptr, rust_vec_len, data_len)
|
||||
}
|
||||
33 => wire__crate__api__graph__SynapseGraph_open_impl(port, ptr, rust_vec_len, data_len),
|
||||
34 => {
|
||||
34 => wire__crate__api__graph__SynapseGraph_open_impl(port, ptr, rust_vec_len, data_len),
|
||||
35 => {
|
||||
wire__crate__api__graph__SynapseGraph_open_page_impl(port, ptr, rust_vec_len, data_len)
|
||||
}
|
||||
35 => wire__crate__api__graph__SynapseGraph_outdent_block_impl(
|
||||
36 => wire__crate__api__graph__SynapseGraph_outdent_block_impl(
|
||||
port,
|
||||
ptr,
|
||||
rust_vec_len,
|
||||
data_len,
|
||||
),
|
||||
36 => wire__crate__api__graph__SynapseGraph_outline_impl(port, ptr, rust_vec_len, data_len),
|
||||
37 => wire__crate__api__graph__SynapseGraph_page_impl(port, ptr, rust_vec_len, data_len),
|
||||
38 => wire__crate__api__graph__SynapseGraph_page_by_title_impl(
|
||||
37 => wire__crate__api__graph__SynapseGraph_outline_impl(port, ptr, rust_vec_len, data_len),
|
||||
38 => wire__crate__api__graph__SynapseGraph_page_impl(port, ptr, rust_vec_len, data_len),
|
||||
39 => wire__crate__api__graph__SynapseGraph_page_by_title_impl(
|
||||
port,
|
||||
ptr,
|
||||
rust_vec_len,
|
||||
data_len,
|
||||
),
|
||||
39 => wire__crate__api__graph__SynapseGraph_page_structure_impl(
|
||||
40 => wire__crate__api__graph__SynapseGraph_page_structure_impl(
|
||||
port,
|
||||
ptr,
|
||||
rust_vec_len,
|
||||
data_len,
|
||||
),
|
||||
40 => wire__crate__api__graph__SynapseGraph_pages_with_tag_impl(
|
||||
41 => wire__crate__api__graph__SynapseGraph_pages_with_tag_impl(
|
||||
port,
|
||||
ptr,
|
||||
rust_vec_len,
|
||||
data_len,
|
||||
),
|
||||
41 => wire__crate__api__graph__SynapseGraph_purge_pages_impl(
|
||||
42 => wire__crate__api__graph__SynapseGraph_purge_pages_impl(
|
||||
port,
|
||||
ptr,
|
||||
rust_vec_len,
|
||||
data_len,
|
||||
),
|
||||
42 => wire__crate__api__graph__SynapseGraph_put_asset_bytes_impl(
|
||||
43 => wire__crate__api__graph__SynapseGraph_put_asset_bytes_impl(
|
||||
port,
|
||||
ptr,
|
||||
rust_vec_len,
|
||||
data_len,
|
||||
),
|
||||
43 => wire__crate__api__graph__SynapseGraph_put_asset_file_impl(
|
||||
44 => wire__crate__api__graph__SynapseGraph_put_asset_file_impl(
|
||||
port,
|
||||
ptr,
|
||||
rust_vec_len,
|
||||
data_len,
|
||||
),
|
||||
44 => wire__crate__api__graph__SynapseGraph_record_visit_impl(
|
||||
45 => wire__crate__api__graph__SynapseGraph_record_visit_impl(
|
||||
port,
|
||||
ptr,
|
||||
rust_vec_len,
|
||||
data_len,
|
||||
),
|
||||
45 => wire__crate__api__graph__SynapseGraph_related_impl(port, ptr, rust_vec_len, data_len),
|
||||
46 => wire__crate__api__graph__SynapseGraph_remove_alias_impl(
|
||||
46 => wire__crate__api__graph__SynapseGraph_related_impl(port, ptr, rust_vec_len, data_len),
|
||||
47 => wire__crate__api__graph__SynapseGraph_remove_alias_impl(
|
||||
port,
|
||||
ptr,
|
||||
rust_vec_len,
|
||||
data_len,
|
||||
),
|
||||
47 => wire__crate__api__graph__SynapseGraph_remove_from_hub_impl(
|
||||
48 => wire__crate__api__graph__SynapseGraph_remove_from_hub_impl(
|
||||
port,
|
||||
ptr,
|
||||
rust_vec_len,
|
||||
data_len,
|
||||
),
|
||||
48 => wire__crate__api__graph__SynapseGraph_remove_page_tag_impl(
|
||||
49 => wire__crate__api__graph__SynapseGraph_remove_page_tag_impl(
|
||||
port,
|
||||
ptr,
|
||||
rust_vec_len,
|
||||
data_len,
|
||||
),
|
||||
49 => {
|
||||
50 => {
|
||||
wire__crate__api__graph__SynapseGraph_remove_tag_impl(port, ptr, rust_vec_len, data_len)
|
||||
}
|
||||
50 => wire__crate__api__graph__SynapseGraph_rename_page_impl(
|
||||
51 => wire__crate__api__graph__SynapseGraph_remove_type_impl(
|
||||
port,
|
||||
ptr,
|
||||
rust_vec_len,
|
||||
data_len,
|
||||
),
|
||||
51 => {
|
||||
52 => wire__crate__api__graph__SynapseGraph_rename_page_impl(
|
||||
port,
|
||||
ptr,
|
||||
rust_vec_len,
|
||||
data_len,
|
||||
),
|
||||
53 => {
|
||||
wire__crate__api__graph__SynapseGraph_rename_tag_impl(port, ptr, rust_vec_len, data_len)
|
||||
}
|
||||
52 => wire__crate__api__graph__SynapseGraph_search_blocks_impl(
|
||||
54 => wire__crate__api__graph__SynapseGraph_rename_type_impl(
|
||||
port,
|
||||
ptr,
|
||||
rust_vec_len,
|
||||
data_len,
|
||||
),
|
||||
53 => wire__crate__api__graph__SynapseGraph_search_titles_impl(
|
||||
55 => wire__crate__api__graph__SynapseGraph_search_blocks_impl(
|
||||
port,
|
||||
ptr,
|
||||
rust_vec_len,
|
||||
data_len,
|
||||
),
|
||||
54 => wire__crate__api__graph__SynapseGraph_set_collapsed_impl(
|
||||
56 => wire__crate__api__graph__SynapseGraph_search_titles_impl(
|
||||
port,
|
||||
ptr,
|
||||
rust_vec_len,
|
||||
data_len,
|
||||
),
|
||||
55 => wire__crate__api__graph__SynapseGraph_set_hub_description_impl(
|
||||
57 => wire__crate__api__graph__SynapseGraph_set_collapsed_impl(
|
||||
port,
|
||||
ptr,
|
||||
rust_vec_len,
|
||||
data_len,
|
||||
),
|
||||
56 => wire__crate__api__graph__SynapseGraph_set_page_tags_impl(
|
||||
58 => wire__crate__api__graph__SynapseGraph_set_hub_description_impl(
|
||||
port,
|
||||
ptr,
|
||||
rust_vec_len,
|
||||
data_len,
|
||||
),
|
||||
57 => wire__crate__api__graph__SynapseGraph_set_page_type_impl(
|
||||
59 => wire__crate__api__graph__SynapseGraph_set_page_tags_impl(
|
||||
port,
|
||||
ptr,
|
||||
rust_vec_len,
|
||||
data_len,
|
||||
),
|
||||
58 => wire__crate__api__graph__SynapseGraph_tag_catalog_impl(
|
||||
60 => wire__crate__api__graph__SynapseGraph_set_page_type_impl(
|
||||
port,
|
||||
ptr,
|
||||
rust_vec_len,
|
||||
data_len,
|
||||
),
|
||||
59 => {
|
||||
61 => wire__crate__api__graph__SynapseGraph_set_type_icon_impl(
|
||||
port,
|
||||
ptr,
|
||||
rust_vec_len,
|
||||
data_len,
|
||||
),
|
||||
62 => wire__crate__api__graph__SynapseGraph_tag_catalog_impl(
|
||||
port,
|
||||
ptr,
|
||||
rust_vec_len,
|
||||
data_len,
|
||||
),
|
||||
63 => {
|
||||
wire__crate__api__graph__SynapseGraph_timeline_impl(port, ptr, rust_vec_len, data_len)
|
||||
}
|
||||
61 => wire__crate__api__graph__SynapseGraph_type_catalog_impl(
|
||||
65 => wire__crate__api__graph__SynapseGraph_type_catalog_impl(
|
||||
port,
|
||||
ptr,
|
||||
rust_vec_len,
|
||||
data_len,
|
||||
),
|
||||
62 => wire__crate__api__graph__SynapseGraph_update_block_impl(
|
||||
66 => wire__crate__api__graph__SynapseGraph_update_block_impl(
|
||||
port,
|
||||
ptr,
|
||||
rust_vec_len,
|
||||
@@ -4561,8 +4825,8 @@ fn pde_ffi_dispatcher_sync_impl(
|
||||
match func_id {
|
||||
1 => wire__crate__api__layout__ForceLayout_new_impl(ptr, rust_vec_len, data_len),
|
||||
10 => wire__crate__api__graph__SynapseGraph_asset_path_impl(ptr, rust_vec_len, data_len),
|
||||
19 => wire__crate__api__graph__SynapseGraph_dir_impl(ptr, rust_vec_len, data_len),
|
||||
60 => wire__crate__api__graph__SynapseGraph_today_impl(ptr, rust_vec_len, data_len),
|
||||
20 => wire__crate__api__graph__SynapseGraph_dir_impl(ptr, rust_vec_len, data_len),
|
||||
64 => wire__crate__api__graph__SynapseGraph_today_impl(ptr, rust_vec_len, data_len),
|
||||
_ => unreachable!(),
|
||||
}
|
||||
}
|
||||
@@ -4624,6 +4888,7 @@ impl flutter_rust_bridge::IntoDart for crate::api::dto::BacklinkGroup {
|
||||
self.page_id.into_into_dart().into_dart(),
|
||||
self.page_title.into_into_dart().into_dart(),
|
||||
self.is_journal.into_into_dart().into_dart(),
|
||||
self.page_type.into_into_dart().into_dart(),
|
||||
self.blocks.into_into_dart().into_dart(),
|
||||
]
|
||||
.into_dart()
|
||||
@@ -4751,6 +5016,7 @@ impl flutter_rust_bridge::IntoDart for crate::api::dto::GraphNode {
|
||||
self.home_hub.into_into_dart().into_dart(),
|
||||
self.tags.into_into_dart().into_dart(),
|
||||
self.is_tag.into_into_dart().into_dart(),
|
||||
self.page_type.into_into_dart().into_dart(),
|
||||
]
|
||||
.into_dart()
|
||||
}
|
||||
@@ -4893,6 +5159,7 @@ impl flutter_rust_bridge::IntoDart for crate::api::dto::PageBrief {
|
||||
self.title.into_into_dart().into_dart(),
|
||||
self.is_journal.into_into_dart().into_dart(),
|
||||
self.is_hub.into_into_dart().into_dart(),
|
||||
self.page_type.into_into_dart().into_dart(),
|
||||
]
|
||||
.into_dart()
|
||||
}
|
||||
@@ -5030,6 +5297,10 @@ impl flutter_rust_bridge::IntoDart for crate::api::dto::TagDto {
|
||||
self.name.into_into_dart().into_dart(),
|
||||
self.count.into_into_dart().into_dart(),
|
||||
self.suggested.into_into_dart().into_dart(),
|
||||
self.icon.into_into_dart().into_dart(),
|
||||
self.explicit.into_into_dart().into_dart(),
|
||||
self.typed.into_into_dart().into_dart(),
|
||||
self.from_hub.into_into_dart().into_dart(),
|
||||
]
|
||||
.into_dart()
|
||||
}
|
||||
@@ -5088,6 +5359,7 @@ impl flutter_rust_bridge::IntoDart for crate::api::dto::TitleHit {
|
||||
self.page_id.into_into_dart().into_dart(),
|
||||
self.title.into_into_dart().into_dart(),
|
||||
self.is_alias.into_into_dart().into_dart(),
|
||||
self.page_type.into_into_dart().into_dart(),
|
||||
]
|
||||
.into_dart()
|
||||
}
|
||||
@@ -5165,6 +5437,7 @@ impl SseEncode for crate::api::dto::BacklinkGroup {
|
||||
<String>::sse_encode(self.page_id, serializer);
|
||||
<String>::sse_encode(self.page_title, serializer);
|
||||
<bool>::sse_encode(self.is_journal, serializer);
|
||||
<Option<String>>::sse_encode(self.page_type, serializer);
|
||||
<Vec<crate::api::dto::BlockDto>>::sse_encode(self.blocks, serializer);
|
||||
}
|
||||
}
|
||||
@@ -5251,6 +5524,7 @@ impl SseEncode for crate::api::dto::GraphNode {
|
||||
<Option<u32>>::sse_encode(self.home_hub, serializer);
|
||||
<Vec<String>>::sse_encode(self.tags, serializer);
|
||||
<bool>::sse_encode(self.is_tag, serializer);
|
||||
<Option<String>>::sse_encode(self.page_type, serializer);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5574,6 +5848,7 @@ impl SseEncode for crate::api::dto::PageBrief {
|
||||
<String>::sse_encode(self.title, serializer);
|
||||
<bool>::sse_encode(self.is_journal, serializer);
|
||||
<bool>::sse_encode(self.is_hub, serializer);
|
||||
<Option<String>>::sse_encode(self.page_type, serializer);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5664,6 +5939,10 @@ impl SseEncode for crate::api::dto::TagDto {
|
||||
<String>::sse_encode(self.name, serializer);
|
||||
<u32>::sse_encode(self.count, serializer);
|
||||
<bool>::sse_encode(self.suggested, serializer);
|
||||
<Option<String>>::sse_encode(self.icon, serializer);
|
||||
<u32>::sse_encode(self.explicit, serializer);
|
||||
<u32>::sse_encode(self.typed, serializer);
|
||||
<u32>::sse_encode(self.from_hub, serializer);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5691,6 +5970,7 @@ impl SseEncode for crate::api::dto::TitleHit {
|
||||
<String>::sse_encode(self.page_id, serializer);
|
||||
<String>::sse_encode(self.title, serializer);
|
||||
<bool>::sse_encode(self.is_alias, serializer);
|
||||
<Option<String>>::sse_encode(self.page_type, serializer);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user